diff --git a/weeeabot.py b/weeeabot.py new file mode 100644 index 0000000..95a8633 --- /dev/null +++ b/weeeabot.py @@ -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)