diff --git a/cogs/bump.py b/cogs/bump.py index 9929176..89ccd7c 100644 --- a/cogs/bump.py +++ b/cogs/bump.py @@ -23,7 +23,6 @@ class Bumps(commands.Cog): @commands.command() async def bump(self, ctx): server = Servers(ctx.guild.id) - server.update(icon_url=ctx.guild.icon_url_as(static_format="png")) guild = ctx.guild prefix = Servers(guild.id).getPrefix() if Servers(guild.id).hasPrefix else self.config["prefix"] @@ -31,6 +30,14 @@ class Bumps(commands.Cog): 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()) + wait_msg = await ctx.send(embed=discord.Embed( + title="ā³ Bumping...", + description="Please wait while we're sending out the bumps!", + color=discord.Color.orange() + )) + + server.update(icon_url=str(ctx.guild.icon_url_as(static_format="png")), server_name=ctx.guild.name) + servers = Servers().get_all() success, fail = 0, 0 @@ -91,7 +98,8 @@ class Bumps(commands.Cog): fail += 1 #os.remove("cache_data.json") - + await wait_msg.delete() + done_message = await ctx.send(embed=discord.Embed( title="ā« Server Bumped", description=f"Your server was bumped to `{success+fail}` servers!\nāœ… There were `{success}` successful bumps!\nāŽ There were `{fail}` failed ones, they got booted from the Database!", diff --git a/cogs/info.py b/cogs/info.py index 29d5bd2..14388a7 100644 --- a/cogs/info.py +++ b/cogs/info.py @@ -2,6 +2,7 @@ import discord from core.database import Servers from core.files import Data +from core.embeds import Embeds commands = discord.ext.commands @@ -34,5 +35,10 @@ class Info(commands.Cog): color=discord.Color.blurple() )) + @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)")) + def setup(bot): bot.add_cog(Info(bot)) \ No newline at end of file diff --git a/cogs/setup.py b/cogs/setup.py index bf7278c..273a94a 100644 --- a/cogs/setup.py +++ b/cogs/setup.py @@ -10,6 +10,7 @@ class BumpSetup(commands.Cog): def __init__(self, bot): self.bot = bot self.config = Data("config").yaml_read() + self.settings = Data("settings").json_read() global setting_up setting_up = [] @@ -99,9 +100,13 @@ class BumpSetup(commands.Cog): webhook = await listing.create_webhook(name=self.config['bot_name']) - Servers(ctx.guild.id).add(webhook=webhook.id, invite=invite.id, color=color, description=description, icon_url=ctx.guild.icon_url_as(static_format="png")) + Servers(ctx.guild.id).add(webhook=webhook.id, invite=invite.id, color=color, description=description, icon_url=str(ctx.guild.icon_url_as(static_format="png")), server_name=ctx.guild.name) - await ctx.send("Setup complete! Server added to DB and the webhook was created.") + return await ctx.send(embed=discord.Embed( + title="šŸ‘Œ Setup Complete", + description="The server was added to the Database and can now be bumped! Good luck on your server's growth! You can always use `=delete` to remove it." + (f"\nYour server was also added to our Server List! [Check it out!]({self.settings['serverlist_url']+'server/' + str(ctx.guild.id)}/)" if self.settings['enable_serverlist'] else ""), + color=discord.Color.green() + )) @commands.guild_only() @commands.has_permissions(manage_guild=True) diff --git a/core/database.py b/core/database.py index ad56169..a89b5d9 100644 --- a/core/database.py +++ b/core/database.py @@ -28,7 +28,7 @@ class Servers: Update a server in the database. """ - def update(self, **checks): + def update(self, **params): self.col.update_one({ "_id": self.server }, { diff --git a/data/settings.json b/data/settings.json index e147788..b468396 100644 --- a/data/settings.json +++ b/data/settings.json @@ -3,5 +3,5 @@ "show_motd": false, "show_motd_wait": 10, "enable_serverlist": false, - "serverlist_url": "https://localhost:5000/" + "serverlist_url": "http://127.0.0.1:5000/" } \ No newline at end of file