示例#1
0
    async def setmemerole(self, ctx, rolename: str):
        """Sets the meme role

        Example:
        [p]setmemerole Regular"""

        role = get_role(ctx.message.guild.roles, rolename)
        self.settings.setPrivileged(ctx.guild.id, role.id)
        await ctx.send("done")
示例#2
0
    async def setStreamerRole(self, ctx, *, role_name: str):
        try:
            role = get_role(ctx.guild.roles, role_name)
        except:
            await ctx.send(inline('Unknown role'))
            return

        self.settings.set_streamer_role(ctx.guild.id, role.id)
        await ctx.send(
            inline(
                'Done. Make sure that role is below the bot in the hierarchy'))
示例#3
0
    async def role(self, ctx, role_name: str, remove_amount: int,
                   warn_amount: int, grant_amount: int):
        """Set the configuration for a role.

        role_name: Role name to configure
        remove_amount: Automatic role removal threshold. Set to 0 to disable.
        warn_amount: Print a warning in the announcement channel when exceeded. Set to 0 to disable.
        grant_amount: Automatic role grant threshold. Set to 0 to disable.

        remove_amount must be less than grant_amount.
        Set all three to 0 to delete the entry.
        """
        server = ctx.guild
        role = rpadutils.get_role(server.roles, role_name)
        self.settings.set_role(server.id, role.id, remove_amount, warn_amount,
                               grant_amount)

        if remove_amount == 0 and grant_amount == 0:
            await ctx.send(inline('Role configuration deleted'))
            return

        msg = 'Done.'
        if remove_amount <= 0:
            msg += '\nThis role will not be automatically removed.'
        else:
            msg += '\nThis role will be removed when points in remove window drop below {}.'.format(
                remove_amount)
        if grant_amount <= 0:
            msg += '\nThis role will not be automatically granted.'
        else:
            if warn_amount <= 0:
                msg += '\nNo early warning will be given for this role.'
            else:
                msg += '\nI will warn when a user exceeds {} points in the grant window.'.format(
                    warn_amount)
            msg += '\nThis role will be granted when points in grant window exceed {}.'.format(
                grant_amount)

        await ctx.send(box(msg))
示例#4
0
 async def rmNeutralRole(self, ctx, *, role):
     """Cancels a role from notable but not ping-worthy status."""
     role = get_role(ctx.guild.roles, role)
     self.settings.rmNeutralRole(ctx.guild.id, role.id)
     await ctx.send(inline('Removed neutral role "' + role.name + '"'))
示例#5
0
 async def addNeutralRole(self, ctx, *, role):
     """Designate a role as a notable but not ping-worthy role."""
     role = get_role(ctx.guild.roles, role)
     self.settings.addNeutralRole(ctx.guild.id, role.id)
     await ctx.send(inline('Added neutral role "' + role.name + '"'))
示例#6
0
 async def rmPositiveRole(self, ctx, *, role):
     """Cancels a role from 'benefit' status."""
     role = get_role(ctx.guild.roles, role)
     self.settings.rmPositiveRole(ctx.guild.id, role.id)
     await ctx.send(inline('Removed positive role "' + role.name + '"'))
示例#7
0
 async def addPositiveRole(self, ctx, *, role):
     """Designate a role as a 'benefit' role."""
     role = get_role(ctx.guild.roles, role)
     self.settings.addPositiveRole(ctx.guild.id, role.id)
     await ctx.send(inline('Added positive role "' + role.name + '"'))
示例#8
0
 async def rmNegativeRole(self, ctx, *, role):
     """Cancels a role from 'punishment' status."""
     role = get_role(ctx.guild.roles, role)
     self.settings.rmPunishmentRole(ctx.guild.id, role.id)
     await ctx.send(inline('Removed punishment role "' + role.name + '"'))
示例#9
0
 async def addNegativeRole(self, ctx, *, role):
     """Designate a role as a 'punishment' role."""
     role = get_role(ctx.guild.roles, role)
     self.settings.addPunishmentRole(ctx.guild.id, role.id)
     await ctx.send(inline('Added punishment role "' + role.name + '"'))