Skip to content

Instantly share code, notes, and snippets.

@Arthurdw
Created September 16, 2020 12:05
Show Gist options
  • Save Arthurdw/1919afa6dc00b3d92ae94b7b7ebeb132 to your computer and use it in GitHub Desktop.
Save Arthurdw/1919afa6dc00b3d92ae94b7b7ebeb132 to your computer and use it in GitHub Desktop.
A basic hello command
from discord.ext.commands import command, Bot, Context
from utilsx.discord import BotX, Cog
BOT_TOKEN = "XXXYOURBOTTOKENHEREXXX"
class MyBot(BotX):
def __init__(self):
super().__init__()
self.add_cog(CustomCommands(self))
class CustomCommands(Cog):
def __init__(self, bot: Bot):
super().__init__()
self.bot = bot
@command()
async def hello(self, ctx: Context):
await self.send(ctx, f"Hello {ctx.author.mention}")
if __name__ == "__main__":
MyBot().run(BOT_TOKEN)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment