Exemple #1
0
 async def muteRole(self, ctx: commands.Context, role: discord.Role):
     """Sets what role to use for mutes."""
     guild: discord.Guild = ctx.guild
     perms = guild.me.guild_permissions
     if not perms.manage_roles:
         await ctx.send("I require the 'manage_roles' permission to be able to add the role to people.")
         return
     if not guild.me.top_role > role:
         await ctx.send(f"I need a role that is higher then the {role.mention} role to be able to add it to people.")
         return
     Configuration.setConfigVar(ctx.guild.id, "MUTE_ROLE", int(role.id))
     await ctx.send(f"{role.mention} will now be used for muting people, denying send permissions for the role.")
     failed = []
     for channel in guild.text_channels:
         try:
             await channel.set_permissions(role, reason="Automatic mute role setup.", send_messages=False,
                                           add_reactions=False)
         except discord.Forbidden as ex:
             failed.append(channel.mention)
     for channel in guild.voice_channels:
         try:
             await channel.set_permissions(role, reason="Automatic mute role setup.", speak=False, connect=False)
         except discord.Forbidden as ex:
             failed.append(f"Voice channel {channel.name}")
     if len(failed) > 0:
         message = f"I was unable to configure muting in the following channels, there probably is an explicit deny on that channel for 'manage channel' on those channels or their category (if they are synced) for one of my roles (includes everyone role). Please make sure I can manage those channels and run this command again or deny the `send_messages` and `add_reactions` permissions for {role.mention} manually\n."
         for fail in failed:
             if len(message) + len(fail) > 2048:
                 await ctx.send(message)
                 message = ""
             message = message + fail
         if len(message) > 0:
             await ctx.send(message)
     else:
         await ctx.send(f"Automatic mute setup complete.")
 async def welcomeMessage(self, ctx: commands.Context, *, message):
     if message != "":
         Configuration.setConfigVar(ctx.guild.id, "WELCOME_MESSAGE",
                                    message)
         await ctx.send("The welcome message for this server was changed.")
     else:
         await ctx.send("I need a message i can work with.")
Exemple #3
0
 async def censored(self, ctx: commands.Context, channel: TextChannel):
     mods = discord.utils.get(ctx.guild.roles, id=590955362106998784)
     if 590955362106998784 not in [role.id for role in ctx.author.roles]:
         return
     else:
         Configuration.setConfigVar(ctx.guild.id, "CENSORED_LOGS",
                                    channel.id)
         await ctx.send(f"The censored channel is now {channel.mention}")
Exemple #4
0
 async def welcomeChannel(self, ctx:commands.Context, channel: discord.TextChannel):
     
     permissions = channel.permissions_for(ctx.guild.get_member(self.bot.user.id))
     if permissions.read_messages and permissions.send_messages and permissions.embed_links:
         Configuration.setConfigVar(ctx.guild.id, "WELCOME_CHANNEL", channel.id)
         await ctx.send(f"<#{channel.id}> will now be used for welcome messages.")
     else:
         await ctx.send(f"I cannot use {channel.mention} for logging, I do not have the required permissions in there (read_messages, send_messages and embed_links).")
Exemple #5
0
 async def social(self, ctx: commands.Context, channel: TextChannel):
     mods = discord.utils.get(ctx.guild.roles, id=590955362106998784)
     if 590955362106998784 not in [role.id for role in ctx.author.roles]:
         return
     else:
         Configuration.setConfigVar(ctx.guild.id, "SOCIAL", channel.id)
         await ctx.send(
             f"The Shitpost Bot category channel is now {channel.mention}")
Exemple #6
0
 async def mute(self, ctx: commands.Context):
     """Disable the mute feature."""
     role = discord.utils.get(ctx.guild.roles, id=Configuration.getConfigVar(ctx.guild.id, "MUTE_ROLE"))
     if role is not None:
         for member in role.members:
             await member.remove_roles(role, reason=f"Mute feature has been disabled.")
     Configuration.setConfigVar(ctx.guild.id, "MUTE_ROLE", 0)
     await ctx.send("Mute feature has been disabled, all people muted have been unmuted and the role can now be removed.")
Exemple #7
0
 async def add(self, ctx: commands.Context, role: discord.Role):
     """Used to add roles to the joinable list"""
     role_list = Configuration.getConfigVar(ctx.guild.id, "JOINABLE_ROLES")
     if role.id in role_list:
         await ctx.send("This role is already joinable! To remove joinable roles use `!configure removejoinableRole` instead.")
     else:
         role_list.extend([role.id])
         Configuration.setConfigVar(ctx.guild.id, "JOINABLE_ROLES", role_list)
         await ctx.send(f"{role.name} has been added to the selfrole list.")
Exemple #8
0
 async def productivity(self, ctx: commands.Context, channel: TextChannel):
     mods = discord.utils.get(ctx.guild.roles, id=590955362106998784)
     if 590955362106998784 not in [role.id for role in ctx.author.roles]:
         return
     else:
         Configuration.setConfigVar(ctx.guild.id, "PRODUCTIVITY",
                                    channel.id)
         await ctx.send(
             f"The Functional Bot category channel is now {channel.mention}"
         )
Exemple #9
0
 async def merch(self, ctx: commands.Context, channel: TextChannel):
     """Sets the Merch Art channel."""
     mods = discord.utils.get(ctx.guild.roles, id=590955362106998784)
     if 590955362106998784 not in [role.id for role in ctx.author.roles]:
         return
     else:
         Configuration.setConfigVar(ctx.guild.id, "MERCH_CHANNEL",
                                    channel.id)
         await ctx.send(
             f"The Merch Art category channel is now {channel.mention}")
Exemple #10
0
 async def modLogChannel(self, ctx: commands.Context,
                         channel: discord.TextChannel):
     """Sets the logging channel for modlogs (mute/kick/ban/...)"""
     permissions = channel.permissions_for(
         ctx.guild.get_member(self.bot.user.id))
     if permissions.read_messages and permissions.send_messages:
         Configuration.setConfigVar(ctx.guild.id, "MOD_LOGS", channel.id)
         await ctx.send(f"{channel.mention} will now be used for mod logs.")
     else:
         await ctx.send(
             f"I cannot use {channel.mention} for logging, I do not have the required permissions in there (read_messages, send_messages)"
         )
Exemple #11
0
    async def modrole(self, ctx: commands.Context, roleID):
        """Sets the role with moderation rights."""
        heads = [
            187606096418963456, 298618155281154058, 169197827002466304,
            263495765270200320, 117101067136794628, 164475721173958657,
            191793155685744640
        ]
        if ctx.author.id not in heads:
            return

        Configuration.setConfigVar(ctx.guild.id, "MOD_ROLE_ID", roleID)
        await ctx.send(f"The server moderation role is now `{roleID}`.")
Exemple #12
0
    async def submission(self, ctx: commands.Context, channelID):
        """Sets the submission channel."""
        heads = [
            187606096418963456, 298618155281154058, 169197827002466304,
            263495765270200320, 117101067136794628, 164475721173958657,
            191793155685744640
        ]
        if ctx.author.id not in heads:
            return

        Configuration.setConfigVar(ctx.guild.id, "SUBMISSION_CHANNEL",
                                   channelID)
        await ctx.send(f"The submission channel now is <#{channelID}>")
Exemple #13
0
 async def remove(self, ctx: commands.Context, roleraw):
     """Used to remove roles from the joinable list"""
     role_list = Configuration.getConfigVar(ctx.guild.id, "JOINABLE_ROLES")
     try:
         role = await commands.RoleConverter().convert(ctx, roleraw)
         if role.id in role_list:
             role_list.remove(role.id)
             Configuration.setConfigVar(ctx.guild.id, "JOINABLE_ROLES", role_list)
             await ctx.send(f"{role.name} has been removed from the selfrole list.")
         else:
             await ctx.send("That role already isn't joinable!")
     except:
         if role in role_list:
             role_list.remove(role)
             Configuration.setConfigVar(ctx.guild.id, "JOINABLE_ROLES", role_list)
             await ctx.send("Role successfully removed from the selfrole list.")
         else:
             await ctx.send("That role already isn't joinable or if you are trying to remove a role from the selfrole list you have already deleted please use the ID.")
Exemple #14
0
 async def minorLogChannel(self, ctx: commands.Context,
                           channel: discord.TextChannel):
     """Sets the logging channel for minor logs (edit/delete)"""
     if channel is None:
         raise BadArgument("Missing channel")
     permissions = channel.permissions_for(
         ctx.guild.get_member(self.bot.user.id))
     if permissions.read_messages and permissions.send_messages and permissions.embed_links:
         old = Configuration.getConfigVar(ctx.guild.id, "MINOR_LOGS")
         Configuration.setConfigVar(ctx.guild.id, "MINOR_LOGS", channel.id)
         await ctx.send(f"{channel.mention} will now be used for minor logs"
                        )
         if old == 0:
             await ctx.send(f"Caching recent messages for logging...")
             await self.buildCache(ctx.guild)
             await ctx.send("Caching complete")
     else:
         await ctx.send(
             f"I cannot use {channel.mention} for logging, I do not have the required permissions in there (read_messages, send_messages and embed_links)."
         )
Exemple #15
0
 async def announce1(self, ctx: commands.Context):
     Configuration.setConfigVar(ctx.guild.id, "ANNOUNCE", 0)
     await ctx.send("The announce channel has been reseted.")
Exemple #16
0
 async def disableMinorLogChannel(self, ctx: commands.Context):
     """Disables minor logs (edit/delete)"""
     Configuration.setConfigVar(ctx.guild.id, "MINOR_LOGS", 0)
     await ctx.send("Minor logs have been dissabled.")
Exemple #17
0
 async def modrole(self, ctx: commands.Context, roleID):
     """Sets the role with moderation rights"""
     Configuration.setConfigVar(ctx.guild.id, "MOD_ROLE_ID", roleID)
     await ctx.send(f"The server moderation role is now `{roleID}`.")
Exemple #18
0
 async def prefix(self, ctx: commands.Context, newPrefix):
     """Sets a new prefix for this server"""
     Configuration.setConfigVar(ctx.guild.id, "PREFIX", newPrefix)
     await ctx.send(f"The server prefix is now `{newPrefix}`.")
Exemple #19
0
 async def adminrole(self, ctx: commands.Context, roleID):
     """Sets the server admin role"""
     Configuration.setConfigVar(ctx.guild.id, "ADMIN_ROLE_ID", roleID)
     await ctx.send(f"The server admin role is now `{roleID}`.")
Exemple #20
0
 async def disablejoinLogChannel(self, ctx: commands.Context):
     """Disables join/leave logs"""
     Configuration.setConfigVar(ctx.guild.id, "JOIN_LOGS", 0)
     await ctx.send("Join logs have been dissabled.")
Exemple #21
0
 async def disableWelcome(self, ctx: commands.Context):
     Configuration.setConfigVar(ctx.guild.id, "WELCOME_CHANEL", 0)
     await ctx.send(
         "This server will no longer send welcome messages. Set a welcome channel to reactivate this feature."
     )
Exemple #22
0
 async def disablemodLogChannel(self, ctx: commands.Context):
     """Disables the modlogs (mute/kick/ban/...)"""
     Configuration.setConfigVar(ctx.guild.id, "MOD_LOGS", 0)
     await ctx.send("Mod logs have been disabled.")
Exemple #23
0
 async def announce(self, ctx: commands.Context, channelID):
     """Sets the announce channel."""
     Configuration.setConfigVar(ctx.guild.id, "ANNOUNCE", channelID)
     await ctx.send(f"The announces channel now is <#{channelID}>")