Пример #1
0
    def stars_unblock(self, event, user):
        StarboardBlock.delete().where(
            (StarboardBlock.guild_id == event.guild.id)
            & (StarboardBlock.user_id == user.id)).execute()

        if not count:
            raise CommandFail('{} was not blocked from the starboard'.format(
                user, ))

        # Renable posts and stars for this user
        StarboardEntry.unblock_user(user.id)

        # Finally, queue an update for the guild
        self.queue_update(event.guild.id, event.config)

        raise CommandSuccess('Unblocked {} from the starboard'.format(user, ))
Пример #2
0
    def stars_unblock(self, event, entity):
        count = StarboardBlock.delete().where(
            (StarboardBlock.guild_id == event.guild.id)
            & (StarboardBlock.entity_id == entity.id)).execute()

        if not count:
            raise CommandFail('{} is already allowed on the starboard'.format(
                entity, ))

        # Reenable posts and stars for this user
        StarboardEntry.unblock(entity.id)

        # Finally, queue an update for the guild
        self.queue_update(event.guild.id, event.config)

        raise CommandSuccess('Allowed {} on the starboard'.format(entity, ))
Пример #3
0
    def stars_unblock(self, event, user):
        count = StarboardBlock.delete().where(
            (StarboardBlock.guild_id == event.guild.id)
            & (StarboardBlock.user_id == user.id)).execute()

        if not count:
            event.msg.reply(u'{} was not blocked from the starboard'.format(
                user, ))
            return

        # Renable posts and stars for this user
        StarboardEntry.unblock_user(user.id)

        # Finally, queue an update for the guild
        self.queue_update(event.guild.id, event.config)

        event.msg.reply(u'Unblocked {} from the starboard'.format(user, ))