从管理员向频道发送消息(Discord Bot)
sending a message from the administrator to the channel (Discord Bot)
如果服务器管理员写信给bot,那么bot会把这条消息发到频道吗?
机器人只从服务器管理员发送消息到频道,管理员给机器人写一条私人消息…
我是新手谢谢大家的帮助
你可以很简单地做到:
@bot.command()
@commands.has_guild_permissions(administrator=True)
async def send_message(ctx, channel: discord.TextChannel, *, message: str):
await channel.send(message)
要使用此命令类型:[your_prefix]send_message #channel your message
注意:此命令仅适用于具有administrator
权限的成员。
如果服务器管理员写信给bot,那么bot会把这条消息发到频道吗?
机器人只从服务器管理员发送消息到频道,管理员给机器人写一条私人消息…
我是新手谢谢大家的帮助
你可以很简单地做到:
@bot.command()
@commands.has_guild_permissions(administrator=True)
async def send_message(ctx, channel: discord.TextChannel, *, message: str):
await channel.send(message)
要使用此命令类型:[your_prefix]send_message #channel your message
注意:此命令仅适用于具有administrator
权限的成员。