【发布时间】:2020-06-14 18:09:10
【问题描述】:
我想知道如何使用命令在某个频道(在 python 中)发送消息
我的命令:
@bot.command()
@commands.has_role("Administrator")
async def message(ctx, message):
await ctx.channel.purge(limit=1)
await ctx.send(message)
【问题讨论】:
我想知道如何使用命令在某个频道(在 python 中)发送消息
我的命令:
@bot.command()
@commands.has_role("Administrator")
async def message(ctx, message):
await ctx.channel.purge(limit=1)
await ctx.send(message)
【问题讨论】:
您必须获取要发送消息的频道ID
await ctx.channel.purge(limit=1)
chn = bot.get_channel(721666738835685437)
await chn.send(message)
【讨论】: