diff --git a/discord_bot.py b/discord_bot.py new file mode 100644 index 0000000..16ffd99 --- /dev/null +++ b/discord_bot.py @@ -0,0 +1,16 @@ +import discord +from discord.ext import tasks + +bot = discord.Bot() + +@bot.event +async def on_ready(): + print(f"We have logged in as {bot.user}") + +@tasks.loop(seconds=10) +async def send_message(): + channel = bot.get_channel(1152167937852055552) + await channel.send('Hello World!') + print('send message') + +bot.run('MTE1MjE2NTc3NDMwNDIyMzI2Mg.GEi-17.VvuIkRy_cFD9XF6wtTagY95LKEbTxKaxy-FxGw') # 这里替换成你自己的 token