Python Telegram Minesweeper Bot https://github.com/isjerryxiao/tgmsbot
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
865 B

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
db = lambda _=None: None
setattr(db, 'close', lambda _=None: None)
pool = dict()
class Player():
def __init__(self, user_id, mines, death, wins,
restricted_until, immunity_cards, permission):
self.user_id = user_id
self.mines = mines
self.death = death
self.wins = wins
self.restricted_until = restricted_until
self.immunity_cards = immunity_cards
self.permission = permission
@staticmethod
def save():
pass
def get_player(user_id):
player = pool.get(user_id, None)
if player is None:
player = Player(user_id=user_id, mines=0, death=0, wins=0,
restricted_until=0, immunity_cards=0, permission=0)
pool[user_id] = player
return player
else:
return player