Added bot main.py
This commit is contained in:
parent
568bb91aa0
commit
0d6a5e01f9
3
.gitignore
vendored
3
.gitignore
vendored
@ -127,3 +127,6 @@ dmypy.json
|
|||||||
|
|
||||||
# Pyre type checker
|
# Pyre type checker
|
||||||
.pyre/
|
.pyre/
|
||||||
|
|
||||||
|
# IDEA
|
||||||
|
.idea/
|
29
main.py
Normal file
29
main.py
Normal 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)
|
Loading…
Reference in New Issue
Block a user