Conditions | 1 |
Total Lines | 19 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | # -*- coding: utf-8 -*- |
||
18 | async def unban_member(user_id, ban_time): |
||
19 | |||
20 | """ |
||
21 | |||
22 | The function is designed to unban the chat user. |
||
23 | |||
24 | """ |
||
25 | |||
26 | del_members = f"DELETE from banned_chat_members WHERE time_out < DATE_SUB(NOW(), INTERVAL {ban_time} SECOND)" |
||
27 | |||
28 | add_members = f"""SELECT user_id FROM banned_chat_members WHERE user_id={user_id}""" |
||
29 | |||
30 | cursor.execute(del_members) |
||
31 | cursor.execute(add_members) |
||
32 | |||
33 | result = cursor.fetchall() |
||
34 | result = [row[0] for row in result] |
||
35 | |||
36 | return result |
||
37 |