mirror of
https://github.com/IgorL123/mafia_api.git
synced 2026-09-23 23:20:19 +00:00
add start_game
This commit is contained in:
@@ -24,7 +24,7 @@ def action(): # put application's code here
|
|||||||
|
|
||||||
if killedUserID != healedUserID:
|
if killedUserID != healedUserID:
|
||||||
cur.execute(f"Select UserID from chats join userschats uc on uc.chatid = chats.chatid join "
|
cur.execute(f"Select UserID from chats join userschats uc on uc.chatid = chats.chatid join "
|
||||||
f"users on users.userid = uc.userid where truechatid = '{trueChatID}' and TrueUserID = '{killedUserID}'")
|
f"users on users.userid = uc.userid where truechatid = '{trueChatID}' and TrueUserID = '{killedUserID}'")
|
||||||
id = cur.fetchall()[0]
|
id = cur.fetchall()[0]
|
||||||
cur.execute(f"UPDATE Users SET isAlive = false WHERE UserID = '{id}'")
|
cur.execute(f"UPDATE Users SET isAlive = false WHERE UserID = '{id}'")
|
||||||
response["killedUserId"] = killedUserID
|
response["killedUserId"] = killedUserID
|
||||||
@@ -48,15 +48,14 @@ def create():
|
|||||||
db.close(cursor)
|
db.close(cursor)
|
||||||
|
|
||||||
|
|
||||||
@app.route('/start_game')
|
@app.route('/start_game', methods = ["POST"])
|
||||||
def start(): # Команда принимает на вход
|
def start(): # Команда принимает на вход
|
||||||
pass
|
TCI = request.json['chatID']
|
||||||
|
userlist = request.json['usderIDs']
|
||||||
|
cursor = db.connection.cursor()
|
||||||
@app.route('/action')
|
for id in userlist:
|
||||||
def action():
|
db.query_ins_user(id, curs)
|
||||||
pass
|
db.close()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app.run()
|
app.run()
|
||||||
|
|||||||
Reference in New Issue
Block a user