Beispiel #1
0
 async def blacklist_delete(self, ctx, value: bool):
     """Toggle whether delete unsuccessful tries of command use"""
     db.update_setting(ctx.guild.id, "delete_blacklisted",
                       util.bool_to_int(value))
     await ctx.send(
         f":white_check_mark: Deletion of unsuccessful command usage is now "
         f"**{'on' if value else 'off'}**")
Beispiel #2
0
 async def autoresponses(self, ctx, value: bool):
     """Disable/enable automatic responses to certain messages and easter eggs."""
     db.update_setting(ctx.guild.id, "autoresponses",
                       util.bool_to_int(value))
     await ctx.send(
         f"Automatic message responses **{'enabled' if value else 'disabled'}**"
     )
 async def command_eligibility(self, ctx, value: bool):
     """Change whether everyone can add commands, or only server managers"""
     db.update_setting(ctx.guild.id, "custom_commands_everyone", util.bool_to_int(value))
     if value:
         await ctx.send("Everyone can now add custom commands!")
     else:
         await ctx.send("Adding commands now requires the `manage_server` permission!")
Beispiel #4
0
 async def patron_toggle(self, ctx, user: discord.User):
     """Toggle user's patron status."""
     current = util.int_to_bool(
         db.query("SELECT currently_active FROM patrons WHERE user_id = ?",
                  (user.id, ))[0][0])
     db.execute(
         "UPDATE patrons SET currently_active = ? WHERE user_id = ?",
         (util.bool_to_int(not current), user.id),
     )
     await ctx.send(f"**{user}** patreon activity set to **{not current}**")
Beispiel #5
0
    async def patron_toggle(self, ctx, user):
        """Toggle user's patron status."""
        discord_user = await util.get_user(ctx, user)
        if discord_user is None:
            return await ctx.send(f"Cannot find user {user}")

        current = util.int_to_bool(
            db.query("SELECT currently_active FROM patrons WHERE user_id = ?",
                     (discord_user.id, ))[0][0])
        db.execute("UPDATE patrons SET currently_active = ? WHERE user_id = ?",
                   (util.bool_to_int(not current), discord_user.id))
        await ctx.send(
            f"**{discord_user}** patreon activity set to **{not current}**")