Answers for "discord.py cog command alias"

0

discord.py aliases

@commands.command(name='test', aliases=['testcommand', 'testing'])
async def test(self, ctx):
    await ctx.send("This a test command")

#will run with either 'test, testcommand or testing
Posted by: Guest on January-14-2021
2

discord.py cog

from discord.ext import commands

class Ping(commands.Cog):
    """Receives ping commands"""
    
    @commands.command()
    async def ping(self, ctx: commands.Context):
        await ctx.send("Pong")

def setup(bot: commands.Bot):
    bot.add_cog(Ping())
Posted by: Guest on June-01-2021
0

discord.py cog classes

class Test(commands.cog):

    def __init__(self, client):
        self.client = client
        self._last_member = None
Posted by: Guest on February-05-2021

Python Answers by Framework

Browse Popular Code Answers by Language