feature request: New example for Cogs #19

Open
opened 2026-02-15 23:16:15 -05:00 by yindo · 1 comment
Owner

Originally created by @MysticMia on GitHub (Jun 17, 2023).

Something along the lines of this, perhaps?

import revolt
from revolt.ext import commands

class TestCog(commands.Cog):
    @commands.command()
    async def ping(self, ctx: commands.Context):
        await ctx.send("pong")

class Client(commands.CommandsClient):
    async def get_prefix(self, message: revolt.Message):
        return "!"
    
async def main():
    async with revolt.utils.client_session() as session:
        client = Client(session, "BOT TOKEN HERE")
        client.add_cog(TestCog()) # initialize your custom cog
        await client.start()

asyncio.run(main())
Originally created by @MysticMia on GitHub (Jun 17, 2023). Something along the lines of this, perhaps? ```py import revolt from revolt.ext import commands class TestCog(commands.Cog): @commands.command() async def ping(self, ctx: commands.Context): await ctx.send("pong") class Client(commands.CommandsClient): async def get_prefix(self, message: revolt.Message): return "!" async def main(): async with revolt.utils.client_session() as session: client = Client(session, "BOT TOKEN HERE") client.add_cog(TestCog()) # initialize your custom cog await client.start() asyncio.run(main()) ```
yindo added the unconfirmed bug label 2026-02-15 23:16:15 -05:00
Author
Owner

@1dfk commented on GitHub (Jun 18, 2023):

I'll make an example

@1dfk commented on GitHub (Jun 18, 2023): I'll make an example
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: stoatchat/python-client-sdk#19