| Total Complexity | 1 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | # -*- coding: utf-8 -*- |
||
| 2 | |||
| 3 | |||
| 4 | from utils.db_api.creat_db import db, cursor |
||
| 5 | |||
| 6 | |||
| 7 | """ |
||
| 8 | |||
| 9 | |||
| 10 | Created on 24.09.2021 |
||
| 11 | |||
| 12 | @author: Nikita |
||
| 13 | |||
| 14 | |||
| 15 | """ |
||
| 16 | |||
| 17 | |||
| 18 | async def ban_members(user_id, time_out): |
||
| 19 | |||
| 20 | """ |
||
| 21 | |||
| 22 | The function is designed to ban the chat user. |
||
| 23 | |||
| 24 | """ |
||
| 25 | |||
| 26 | add_members = f""" |
||
| 27 | INSERT |
||
| 28 | INTO banned_chat_members (user_id, time_out) |
||
| 29 | VALUES ({user_id}, FROM_UNIXTIME({time_out})) |
||
| 30 | ON DUPLICATE KEY UPDATE time_out = time_out |
||
| 31 | """ |
||
| 32 | |||
| 33 | cursor.execute(add_members) |
||
| 34 | |||
| 35 | db.commit() |
||
| 36 |