Added bot skeleton

This commit is contained in:
Benjamyn Love 2022-12-09 12:19:06 +11:00
parent 70316ad7f2
commit 1beadf61f3

28
weeeabot.py Normal file
View File

@ -0,0 +1,28 @@
import discord
from sys import exit
try:
with open("token.secret", 'r') as f:
discord_client_token = f.read()
except FileNotFoundError:
print("Cannot locate token.secret please generate a token")
exit(69)
intents = discord.Intents.default()
intents.message_content = True
client = discord.Client(intents=intents)
@client.event
async def on_ready():
print(f'We have logged in as {client.user}')
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith('$hello'):
await message.channel.send('Hello!')
client.run(discord_client_token)