mirror of
https://github.com/IgorL123/mafia_api.git
synced 2026-09-23 23:20:19 +00:00
add func
This commit is contained in:
@@ -1,3 +1,6 @@
|
|||||||
|
from random import shuffle
|
||||||
|
|
||||||
|
|
||||||
def isEnd(cur, trueChatID):
|
def isEnd(cur, trueChatID):
|
||||||
# cur.execute(f"SELECT ChatID FROM Chats WHERE TrueChatID = '{trueChatID}'")
|
# cur.execute(f"SELECT ChatID FROM Chats WHERE TrueChatID = '{trueChatID}'")
|
||||||
# row = cur.fetchall()
|
# row = cur.fetchall()
|
||||||
@@ -24,3 +27,14 @@ def isEnd(cur, trueChatID):
|
|||||||
return "mafia"
|
return "mafia"
|
||||||
|
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
|
||||||
|
def role_cnt(user_count):
|
||||||
|
ls = [0, 0, 1, 1, 0]
|
||||||
|
ls[4] = user_count//4
|
||||||
|
ls[1] = user_count - ls[4]
|
||||||
|
return ls
|
||||||
|
|
||||||
|
|
||||||
|
def role_distribution(userIDs, count_r):
|
||||||
|
pass
|
||||||
|
|||||||
@@ -57,5 +57,6 @@ def start(): # Команда принимает на вход
|
|||||||
db.query_ins_user(id, curs)
|
db.query_ins_user(id, curs)
|
||||||
db.close()
|
db.close()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app.run()
|
app.run()
|
||||||
|
|||||||
Reference in New Issue
Block a user