def deactivate(mute_id: int, unmute_mod: int = None, reason: str = None) -> "Mute": row: Mute = db.get(Mute, mute_id) row.active = False row.deactivation_timestamp = datetime.utcnow() row.unmute_mod = unmute_mod row.unmute_reason = reason return row
def deactivate(ban_id: int, unban_mod: int = None, unban_reason: str = None) -> "Ban": row: Ban = db.get(Ban, ban_id) row.active = False row.deactivation_timestamp = datetime.utcnow() row.unban_mod = unban_mod row.unban_reason = unban_reason return row
def update(guild_id: int, code: str, guild_name: str): row: AllowedInvite = db.get(AllowedInvite, guild_id) row.code = code row.guild_name = guild_name
def post(post_id: str) -> bool: if db.get(RedditPost, post_id) is not None: return False RedditPost.create(post_id) return True
def change_timestamp(user_id: int, timestamp: datetime): row: Searcher = db.get(Searcher, user_id) row.enqueued_at = timestamp
def change_owner(channel_id: int, owner: int): row: DynamicVoiceChannel = db.get(DynamicVoiceChannel, channel_id) row.owner = owner
def remove(channel_id: int): db.delete(db.get(LogExclude, channel_id))
def change_state(user_id: int, state: State): row: Searcher = db.get(Searcher, user_id) row.state = state
def exists(channel_id: int) -> bool: return db.get(LogExclude, channel_id) is not None
def change_last_contact(user_id: int, last_contact: DateTime): row: Donator = db.get(Donator, user_id) row.last_contact = last_contact
def change_state(user_id: int, state: State): row: Donator = db.get(Donator, user_id) row.state = state
def change_used_invites(user_id: int, used_invites: int): row: Donator = db.get(Donator, user_id) row.used_invites = used_invites
def change_invite_count(user_id: int, invite_count: int): row: Donator = db.get(Donator, user_id) row.invite_count = invite_count