The command is not working and I am not getting any errors
main.py
import discord
from discord.ext import commands
import logging
logging.basicConfig(level=logging.INFO)
intents = discord.Intents.all()
prefix="."
class Bot(commands.Bot):
def __init__(self):
super().__init__(command_prefix=commands.when_mentioned_or('.'), intents=discord.Intents().all())
self.cogslist = ['cogs.info']
async def on_ready(self):
print("Online")
async def setup_hook(self):
for ext in self.cogslist:
await self.load_extension(ext)
TOKEN = ':)'
bot = Bot()
bot.run(TOKEN)
info.py
from __future__ import annotations
import discord
from discord.ext import commands
class info(commands.Cog):
def __init__(self, client: commands.Bot):
self.client = client
@commands.command()
async def serverinfo(self, ctx):
embed = discord.Embed(title = f"**{ctx.guild.name}**", description = "Server Info", color = discord.Colour.yellow())
embed.add_field(name="Created at:", value=f"None", inline=True)
embed.set_thumbnail(url=ctx.guild.icon)
embed.add_field(name="Member Count", value=f"**{ctx.guild.member_count}**", inline=True)
embed.add_field(name="Server Owner", value=f"**{ctx.guild.owner.mention}**", inline=True)
embed.add_field(name="Rules Channel", value=f"**{ctx.guild.rules_channel}**")
embed.add_field(name="Emoji Limit", value=f"**{ctx.guild.emoji_limit}**", inline=True)
embed.add_field(name="Boosters", value=f"**{ctx.guild.premium_subscription_count}**", inline=True)
embed.add_field(name="Boost Tier", value=f"**{ctx.guild.premium_tier}**")
embed.set_footer(text=f"Command issued by {ctx.author}")
await ctx.send(embed=embed)
print("server command issued")
async def setup(client:commands.Bot) -> None:
await client.add_cog(info(client))