예제 #1
0
 def _scrub_dead_channels_and_users(self):
     Channel.delete().where(
         ~(Channel.slack_id << self.known_slack_channel_ids))
     User.delete().where(~(User.slack_id << self.known_slack_user_ids))
예제 #2
0
def remove_channels(update, context):
    remove = context.user_data['remove_channels'][:]
    for channel in remove:
        Channel.delete(channel)
        context.user_data['remove_channels'].remove(channel)
    return channels(update, context)