Skip to content

Instantly share code, notes, and snippets.

@elitecamerawoman
Forked from omiq/discord-bot.py
Created February 10, 2024 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elitecamerawoman/9dc007c6f1dfca80e0817fd6240c4619 to your computer and use it in GitHub Desktop.
Save elitecamerawoman/9dc007c6f1dfca80e0817fd6240c4619 to your computer and use it in GitHub Desktop.
Discord Bot
import discord
# discord client
client = discord.Client()
# create a new event
@client.event
async def on_ready():
print("BOOP BEEP BOOP SQUEEE!")
print("(Bot Ready)")
# listen for specific messages
@client.event
async def on_message(message):
if message.content.startswith("/hello"):
await client.send_message(message.channel, "BY YOUR COMMAND!")
# run the bot
bot = "YOUR BOT TOKEN"
client.run(bot)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment