Bumping was broken due to it trying to fetch an invite for every server it wanted to send the ad to instead of for the server that was sending the ad. Invite was broken because you didnt call a method in the class or some shit.
45 lines
1.8 KiB
Python
45 lines
1.8 KiB
Python
import discord
|
|
|
|
from core.database import Servers
|
|
from core.files import Data
|
|
from core.embeds import Embeds
|
|
|
|
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()
|
|
))
|
|
|
|
@commands.guild_only()
|
|
@commands.command(aliases=["add"])
|
|
async def invite(self, ctx):
|
|
await ctx.send(embed=discord.Embed(title="Invte me to your server!", description=f"[Click here to invite me!](https://discord.com/api/oauth2/authorize?client_id={self.bot.user.id}&permissions=537152577&scope=bot)", color=discord.Color.green()))
|
|
|
|
def setup(bot):
|
|
bot.add_cog(Info(bot))
|