【发布时间】:2021-08-07 03:45:13
【问题描述】:
我正在编写一个机器人,它需要在用户激活它的频道中发送消息。我似乎不知道如何从消息中获取频道 ID。
@bot.command(name="start", description="Starts for a channel")
async def start(ctx):
await ctx.send("Started")
#Get channel ID here and assign it to the var channel
@tasks.loop(seconds=2)
async def message()
channel = bot.get_channel(channel)
await channel.send("Message")
【问题讨论】:
标签: python discord discord.py