Create basic_greeting_bot.py

pull/1/head
Ruan Bekker 2 years ago committed by GitHub
parent cd4e449969
commit 496706bbb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 25
      basic_greeting_bot.py

@ -0,0 +1,25 @@
import discord
import os
from dotenv import load_dotenv
BOT_NAME = "MinecraftBot"
load_dotenv()
DISCORD_TOKEN = os.getenv("DISCORD_TOKEN")
bot = discord.Client()
@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}')
bot.run(DISCORD_TOKEN)
Loading…
Cancel
Save