【发布时间】:2021-06-30 13:57:22
【问题描述】:
下午好。
我还有一个关于不和谐 python 机器人的问题。 所以我想做一个支持脚本之类的东西。我的想法是在所有支持者值班时为他们写一个命令,该命令保存在 json 文件中。这没问题,但我的问题是我希望用户在连接到名为“Support-Room”的特定语音频道时接收到有多少支持者值班。有谁知道我如何编写一个脚本,当成员加入这个特定的语音频道时,他会收到一条消息,例如:member.send('你现在在支持室。请等到支持者移动你。' )
@bot.command()
async def on_member_join(member):
for channel in bot.get_all_channels():
if channel.name == 'Support-Room':
await member.send(''You are now in the Support-Room. Please wait till a Supporter moves you.')
这是我尝试过的,但它不起作用:(
【问题讨论】:
-
@bot.command()错字 -->bot.command -
您真的(想要)在
command中使用event吗?
标签: python discord discord.py