Created
September 16, 2020 12:05
-
-
Save Arthurdw/1919afa6dc00b3d92ae94b7b7ebeb132 to your computer and use it in GitHub Desktop.
A basic hello command
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
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