【发布时间】:2022-01-04 17:57:39
【问题描述】:
我写了一个不和谐的机器人来显示欢迎和留言,但是当我启用它在有人进入公会时发送消息时,它不会显示欢迎信息。
import discord
from discord.ext import commands
bot = commands.Bot(command_prefix = '[')
@bot.event
async def on_ready():
print(" Bot is Online!")
@bot.event
async def on_member_join(member):
channel = bot.get_channel(Token)
await channel.send("{member}welcome to join!")
@bot.event
async def on_member_remove(member):
channel = bot.get_channel(Token)
await channel.send("{member} is leave the guild!")
bot.run('Token')
【问题讨论】:
标签: python discord.py