Category : python

My ping command doesn’t work in a cog but works in my main.py file. Here’s the code for the cog: import discord from discord.ext import commands class Misc(commands.Cog): def __init__(self, bot): self.bot = bot @commands.Cog.listener() async def on_ready(self): print(‘Misc cog loadedn—–‘) @commands.command() async def ping(self, ctx): await ctx.send(f’pong!n{round(bot.latency * 1000)}ms’) def setup(bot): bot.add_cog(Misc(bot)) When I ..

Read more