sparkytron3000/examples/cog_example.py

16 lines
No EOL
419 B
Python

from discord.ext import commands
from cogs.base_cog.bot_base_cog import BotBaseCog
class Ping(BotBaseCog):
def __init__(self, bot):
super().__init__(bot)
self.setup(__class__.__name__)
@commands.command()
async def ping(self, ctx):
await ctx.send("pong")
self.logger.info(f"Ping command called by {ctx.author.name}")
async def setup(bot):
await bot.add_cog(Ping(bot))