Exemplo n.º 1
0
 async def gun(self, ctx, user: discord.Member = None):
     if user == ctx.author:
         await ctx.send(embed=checks.create_embed(
             ":x: Oops!",
             "Your tried to shoot yourself in the head but your gun has no ammo in it so the only logical thing to do is shout I'M OUT OF AMMO!!!",
             error=True))
         pass
     elif user == None:
         await ctx.send(embed=checks.create_embed(
             ":x: Oops!",
             "You shot aimlessly everywhere but instead of hitting your target you accidently shot your leg.",
             error=True))
     else:
         e = discord.Embed(
             title="We got em!",
             description="**PEW PEW** {} HAS GUNNED DOWN {}!!!!".format(
                 ctx.author.name, user.name),
             color=nol)
         e.set_image(
             url="http://www.pngmart.com/files/3/Weapon-PNG-File.png")
         await ctx.send(embed=e)
         try:
             await user.send(embed=checks.create_embed(
                 ":warning: Warning!!!",
                 "**OI STOP RIGHT THERE YOU HAVE BEEN GUNNED FOR BEING VERY NAUGHTY!1!!!!11!!!!!** ```{} has gunned you down!!```"
                 .format(ctx.author.name),
                 warning=True))
         except discord.errors.HTTPException:
             await ctx.send(embed=checks.create_embed(
                 ":x: Error!",
                 "I could not send a DM to tell {} they have been gunned down! (Forbidden)"
                 .format(user.name),
                 error=True))
Exemplo n.º 2
0
 async def banid(self, ctx, id: int):
     guild = ctx.guild
     await guild.ban(discord.Object(id=id))
     await ctx.send(
         embed=checks.create_embed(":white_check_mark: Success!",
                                   "{} has been banned!".format(id),
                                   success=True))
Exemplo n.º 3
0
 async def unban(self, ctx, id: int):
     banlist = await ctx.guild.bans()
     user = None
     for ban in banlist:
         if ban.user.id == id:
             user = ban.user
     if user == None:
         await ctx.send(embed=checks.create_embed(
             ":x: That's an issue",
             "That's strange, this user is not banned, perhaps you misspelled the id?",
             error=True))
         return
     await ctx.guild.unban(user)
     await ctx.send(embed=checks.create_embed(
         ":white_check_mark: Success!",
         "{} has been unbanned!".format(user.name),
         success=True))
Exemplo n.º 4
0
 async def lockdown(self, ctx):
     await ctx.send("Please wait...")
     guild = ctx.message.guild
     await guild.edit(verification_level=discord.VerificationLevel.high)
     await ctx.send("Success!")
     channel = self.b.get_channel(config.lockdown_channel_id)
     await channel.send(embed=checks.create_embed(
         ":x: Oh no!",
         "We're sorry but we are currently experiencing a lockdown due to a raid! Please contact staff to gain access to the server! Sorry about that.",
         error=True))
Exemplo n.º 5
0
    async def dell(self, ctx, messages: int = 100):
        """
        Deletes x amount of messages in a channel.
        """
        if messages < 100:
            await ctx.channel.purge(limit=messages + 1)
            removed = messages + 0
            await ctx.send(embed=checks.create_embed(
                "💣boom!", "Removed {} messages".format(removed), success=True))

        elif messages > 100:
            await ctx.send(embed=checks.create_embed(
                ":x: That's an issue",
                "Sorry but i can't delete over 100+ messages, try aiming a bit lower",
                error=True))

        elif messages == 100:
            await ctx.send(embed=checks.create_embed(
                ":x: That's an issue",
                "Sorry but i can't delete over 100+ messages, try aiming a bit lower",
                error=True))
Exemplo n.º 6
0
 async def mute(self, ctx, *users: discord.Member):
     try:
         for user in users:
             embed = discord.Embed(
                 title="Success!",
                 description="{} has been muted! ✅".format(user.name),
                 colour=sol)
             embed.set_footer(text=ver)
             roles_without_everyone = [
                 r for r in user.roles if r.name != "@everyone"
             ]
             stored_muted_roles[user.id] = [
                 r.id for r in roles_without_everyone
             ]
             await user.remove_roles(*roles_without_everyone)
             role = discord.utils.get(ctx.guild.roles, name="Muted")
             await user.add_roles(role)
             await ctx.send(embed=embed)
             # Logging stuff
             if config.logging:
                 embed = discord.Embed(
                     title="Warning! ⚠",
                     description=
                     f"{user.name} has been muted by {ctx.message.author}",
                     colour=discord.Color.red())
                 ch = self.b.get_channel(config.logging_channel_id)
                 if ch:
                     await ch.send(embed=embed)
                 else:
                     print(
                         f'User muted with logging set but logging channel {config.logging_channel_id} not found!'
                     )
         # - SAVE -
         with open('cmds/muteds', 'wb') as f:
             pickle.dump(stored_muted_roles, f)
         # - END SAVE -
     except discord.errors.Forbidden:
         await ctx.send(embed=checks.create_embed(
             "❌ That's an issue!",
             "Sorry but i don't have the correct permissions to mute this user",
             error=True))
Exemplo n.º 7
0
    async def unmute(self, ctx, user: discord.Member):
        try:
            muted_role = discord.utils.get(ctx.guild.roles, name="Muted")
            await user.remove_roles(muted_role)
            if user.id in stored_muted_roles:
                role_ids = stored_muted_roles.pop(user.id)
                role_objs = []
                for role_id in role_ids:
                    r = discord.utils.get(ctx.guild.roles, id=role_id)
                    if r:
                        role_objs.append(r)
                    else:
                        await ctx.send(
                            f'The old role id {role_id} of the muted user cannot be found/was deleted. '
                            f'skipping it...')
                await user.add_roles(*role_objs)

                with open('cmds/muteds', 'wb') as f:
                    pickle.dump(stored_muted_roles, f)
            else:
                await ctx.send(
                    f'Error! User seems to not be muted! Muted role removed (if applicable) '
                    f'but roles not restored (Not found in the internal muted list).'
                )

        except discord.errors.Forbidden:
            await ctx.send(embed=checks.create_embed(
                ":x: That's an issue!",
                "Sorry but i don't have the correct permissions to unmute this user",
                error=True))
        else:
            embed = discord.Embed(title="Success!",
                                  description="{} has been unmuted!".format(
                                      user.name),
                                  colour=sol)
            embed.set_footer(text=ver)
            await ctx.send(embed=embed)
Exemplo n.º 8
0
 async def kick(self, ctx, user: discord.Member):
     await ctx.guild.kick(user)
     await ctx.send(
         embed=checks.create_embed(":white_check_mark: Success!",
                                   "{} has been kicked!".format(user.name),
                                   success=True))