【发布时间】:2020-09-15 03:11:32
【问题描述】:
我正在尝试向特定频道发送消息。我仍然无法弄清楚如何做到这一点。非常感谢您的帮助。
import keep_alive
import discord
client = discord.Client()
channel = client.get_channel('ID'`enter code here`)
@client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith('$hello'):
await channel.send('hello')
keep_alive.keep_alive()
client.run('ID')
【问题讨论】:
标签: python-3.x discord.py-rewrite