Added bot skeleton
This commit is contained in:
parent
70316ad7f2
commit
1beadf61f3
28
weeeabot.py
Normal file
28
weeeabot.py
Normal 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)
|
||||
Loading…
x
Reference in New Issue
Block a user