Added custom prefix & info
This commit is contained in:
38
cogs/info.py
Normal file
38
cogs/info.py
Normal file
@@ -0,0 +1,38 @@
|
||||
import discord
|
||||
|
||||
from core.database import Servers
|
||||
from core.files import Data
|
||||
|
||||
commands = discord.ext.commands
|
||||
|
||||
class Info(commands.Cog):
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
self.config = Data("config").yaml_read()
|
||||
|
||||
@commands.guild_only()
|
||||
@commands.command(aliases=['about'])
|
||||
async def info(self, ctx):
|
||||
return await ctx.send(embed=discord.Embed(
|
||||
title=f"{self.config['bot_name']} | Information",
|
||||
color=discord.Color.blurple()
|
||||
)
|
||||
.add_field(name="Version", value=self.config['version'])
|
||||
.add_field(name="Library", value=f"Discord.py v{discord.__version__}")
|
||||
.add_field(name="Latency", value=f"{round(self.bot.latency*1000)}ms")
|
||||
.add_field(name="Servers", value=len(self.bot.guilds))
|
||||
.add_field(name="Active Servers", value=len([i for i in Servers().get_all()]))
|
||||
.add_field(name="Open Source", value="[View](https://github.com/Nemika-Haj/BytesBump)") # DO NOT REMOVE
|
||||
.set_footer(text="Made by • " + ', '.join([str((await self.bot.fetch_user(i))) for i in self.config['managers']])))
|
||||
|
||||
@commands.guild_only()
|
||||
@commands.command(aliases=['support'])
|
||||
async def help(self, ctx):
|
||||
return await ctx.send(embed=discord.Embed(
|
||||
title=f"{self.config['bot_name']} | Help",
|
||||
description=Data("help").read(),
|
||||
color=discord.Color.blurple()
|
||||
))
|
||||
|
||||
def setup(bot):
|
||||
bot.add_cog(Info(bot))
|
||||
Reference in New Issue
Block a user