Created
December 27, 2021 17:02
-
-
Save Kqpa/9a1b669d5957f0ffd2c2806d162644e4 to your computer and use it in GitHub Desktop.
Python Discord Bot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get started by creating a project in Replit | |
import os, discord | |
from discord.ext import commands | |
bot = commands.Bot(command_prefix="!!") | |
@bot.event | |
async def on_connect(): | |
await bot.change_presence(status=discord.Status.online, | |
activity=discord.Game('This is the bots activity status.')) | |
print("Bot is online.") | |
@bot.command() | |
async def hello(ctx): | |
await ctx.send("Hey") | |
bot.run(os.getenv('TOKEN')) | |
my_secret = os.environ['TOKEN'] | |
# create a secret named 'TOKEN' and put your bot's token to the value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment