Added custom prefix & info

This commit is contained in:
Nemika
2021-03-08 13:53:06 +02:00
parent b34c24dfc4
commit 503e4e7871
9 changed files with 131 additions and 7 deletions

38
cogs/info.py Normal file
View 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))