Пример #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, ))
Пример #4
0
    def stars_block(self, event, user):
        _, created = StarboardBlock.get_or_create(guild_id=event.guild.id,
                                                  user_id=user.id,
                                                  defaults={
                                                      'actor_id':
                                                      event.author.id,
                                                  })

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

        # Update the starboard, remove stars and posts
        StarboardEntry.block_user(user.id)

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

        event.msg.reply(u'Blocked {} from the starboard'.format(user, ))
Пример #5
0
    def stars_block(self, event, entity):
        _, created = StarboardBlock.get_or_create(guild_id=event.guild.id,
                                                  user_id=entity.id,
                                                  defaults={
                                                      'actor_id':
                                                      event.author.id,
                                                  })

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

        # Update the starboard, remove stars and posts
        StarboardEntry.block(entity.id)

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

        raise CommandSuccess('Disallowed {} from the starboard'.format(
            entity, ))