【发布时间】:2020-12-11 19:22:16
【问题描述】:
import discord
client = discord.Client()
@client.event
async def on_ready():
print('ALERT: {0.user} has connected and is now ready for use.'.format(client))
@client.event
async def on_message(message):
if message.content.startswith('$request-whitelisting'):
print("1")
x = author.has_permissions(administrator)
print(author)
if x == False:
print("2")
await message.channel.send("OK, I am now alerting the admins who can approve your request.")
channel = bot.getchannel(784863111579435019)
idiot = message.author()
await message.channel.send("Alert: "+idiot+" has requested whitelist.")
client.run('Token')
这就是代码 - 它不起作用,我试图让它只这样做,然后运行机器人但它拒绝,我尝试移动东西,使用 print() 标记问题,但最后,函数未运行。
我从 shell 中得到的只是启动消息:
ALERT: Bot#NumID has connected and is now ready for use.
【问题讨论】:
标签: python discord.py