Fixed bumping as well as invite command #1

Merged
Pug234 merged 1 commits from main into main 2021-03-30 07:47:53 -04:00
3 changed files with 7 additions and 6 deletions

View File

@@ -24,7 +24,7 @@ class Bumps(commands.Cog):
server = Servers(ctx.guild.id) server = Servers(ctx.guild.id)
guild = ctx.guild guild = ctx.guild
prefix = Servers(guild.id).getPrefix() if Servers(guild.id).hasPrefix else self.config["prefix"] prefix = Servers(guild.id).getPrefix() if Servers(guild.id).hasPrefix else self.config["prefix"]
if not server.get(): if not server.get():
ctx.command.reset_cooldown(ctx) 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()) 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 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) invite = await invite_channel.create_invite(max_uses=0, max_age=0, unique=False)
embed = discord.Embed( embed = discord.Embed(
@@ -61,7 +63,6 @@ class Bumps(commands.Cog):
for entry in servers: for entry in servers:
try: try:
webhook = await self.bot.fetch_webhook(entry['webhook']) webhook = await self.bot.fetch_webhook(entry['webhook'])
invite_channel = self.bot.get_channel(entry['invite'])
await webhook.send( await webhook.send(
username=self.config['bot_name'], username=self.config['bot_name'],
@@ -95,7 +96,7 @@ class Bumps(commands.Cog):
fail += 1 fail += 1
os.remove("cache_data.json") os.remove("cache_data.json")
await wait_msg.delete() await wait_msg.delete()
done_message = await ctx.send(embed=discord.Embed( done_message = await ctx.send(embed=discord.Embed(
title="⏫ Server Bumped", title="⏫ Server Bumped",

View File

@@ -38,7 +38,7 @@ class Info(commands.Cog):
@commands.guild_only() @commands.guild_only()
@commands.command(aliases=["add"]) @commands.command(aliases=["add"])
async def invite(self, ctx): 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): def setup(bot):
bot.add_cog(Info(bot)) bot.add_cog(Info(bot))

View File

@@ -2,4 +2,4 @@ managers:
- your-id - your-id
prefix: '=' prefix: '='
token: token-here token: token-here
version: '1.0' version: '1.0'