我正试图让我的机器人检测到成员加入的时间。 当我在本地运行该bot时,它可以运行,但是当我在heroku上运行它时,则无法运行。
这是我的代码:
import discord
from discord.ext import commands
client = commands.Bot(command_prefix="$")
@client.event
async def on_ready():
print("Ready")
@client.event
async def on_member_join(member):
channel = discord.utils.get(member.guild.text_channels, name="name_of_channel")
await channel.send(f"{member} is new on the server, everyone say hi!")
show_avatar = discord.Embed(color = discord.Color.blue())
show_avatar.set_image(url="{}".format(member.avatar_url))
await channel.send(embed=show_avatar)
client.run(bot_token)
有人可以帮忙吗?