From d5ff3130bffae92e1c5c671db4ed8904c403e9dc Mon Sep 17 00:00:00 2001 From: Pug234 <50160567+Pug234@users.noreply.github.com> Date: Sun, 28 Mar 2021 13:14:24 -0600 Subject: [PATCH] Fixed bumping as well as invite command 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. --- cogs/bump.py | 7 ++++--- cogs/info.py | 4 ++-- data/config-example.yml | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/cogs/bump.py b/cogs/bump.py index 55be10d..619ede8 100644 --- a/cogs/bump.py +++ b/cogs/bump.py @@ -24,7 +24,7 @@ class Bumps(commands.Cog): server = Servers(ctx.guild.id) guild = ctx.guild prefix = Servers(guild.id).getPrefix() if Servers(guild.id).hasPrefix else self.config["prefix"] - + if not server.get(): ctx.command.reset_cooldown(ctx) return await ctx.send(embed=Embeds(f"You must setup this server first! Use `{prefix}setup` to do so!").error()) @@ -41,6 +41,8 @@ class Bumps(commands.Cog): success, fail = 0, 0 + + invite_channel = self.bot.get_channel(server.get()['invite']) invite = await invite_channel.create_invite(max_uses=0, max_age=0, unique=False) embed = discord.Embed( @@ -61,7 +63,6 @@ class Bumps(commands.Cog): for entry in servers: try: webhook = await self.bot.fetch_webhook(entry['webhook']) - invite_channel = self.bot.get_channel(entry['invite']) await webhook.send( username=self.config['bot_name'], @@ -95,7 +96,7 @@ class Bumps(commands.Cog): fail += 1 os.remove("cache_data.json") - await wait_msg.delete() + await wait_msg.delete() done_message = await ctx.send(embed=discord.Embed( title="⏫ Server Bumped", diff --git a/cogs/info.py b/cogs/info.py index 14388a7..fb712af 100644 --- a/cogs/info.py +++ b/cogs/info.py @@ -38,7 +38,7 @@ class Info(commands.Cog): @commands.guild_only() @commands.command(aliases=["add"]) async def invite(self, ctx): - return await ctx.send(embed=Embeds(f"[Click here to invite me!](https://discord.com/api/oauth2/authorize?client_id={self.bot.user.id}&permissions=537152577&scope=bot)")) + 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)) \ No newline at end of file + bot.add_cog(Info(bot)) diff --git a/data/config-example.yml b/data/config-example.yml index 3fb5e00..6621162 100644 --- a/data/config-example.yml +++ b/data/config-example.yml @@ -2,4 +2,4 @@ managers: - your-id prefix: '=' token: token-here -version: '1.0' \ No newline at end of file +version: '1.0'