feat(discord_bot.py): 增加了 discord_bot
增加了 discord_bot Signed-off-by: Ching <loooching@gmail.com>
This commit is contained in:
parent
4b95403735
commit
2133b78299
16
discord_bot.py
Normal file
16
discord_bot.py
Normal file
@ -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
|
||||
Loading…
x
Reference in New Issue
Block a user