Added bot main.py

This commit is contained in:
Lu Baumann 2022-10-30 23:36:37 +01:00
parent 568bb91aa0
commit 0d6a5e01f9
2 changed files with 32 additions and 0 deletions

3
.gitignore vendored
View File

@ -127,3 +127,6 @@ dmypy.json
# Pyre type checker # Pyre type checker
.pyre/ .pyre/
# IDEA
.idea/

29
main.py Normal file
View File

@ -0,0 +1,29 @@
import os
import discord
from dotenv import load_dotenv
BOT_NAME = "Dumb Bitch"
intents = discord.Intents.default()
bot = discord.Client(intents=intents)
@bot.event
async def on_ready():
print(f"{bot.user} has logged in.")
@bot.event
async def on_message(message):
if message.author == bot.user:
return
if message.content == "hello":
await message.channel.send(f"Hey {message.author}")
if message.content == "goodbye":
await message.channel.send(f"Goodbye {message.author}")
if __name__ == "__main__":
load_dotenv()
DISCORD_TOKEN = os.getenv("DISCORD_TOKEN")
bot.run(DISCORD_TOKEN)