Example #1
0
 def listToken(cls):
     '''
     Return hasilparsing = (markup, teks)
     '''
     db = Database()
     db.connection()
     hasilquery = db.getOwner()
     print(f'ini hasil query {hasilquery}\n masuk messageformat')
     hasilparsing = messageformat.parsingGetOwner(hasilquery)
     print(hasilparsing)
     return hasilparsing
Example #2
0
 def registerToken(self,
                   chat_id: int,
                   chat_name: str,
                   username: str,
                   setpin: int,
                   team_name,
                   token=None,
                   sdtid=None):
     db = Database()
     db.connection()
     #check if this user already have token imported
     if db.getOwner(chat_id=chat_id):
         return False
     self.importToken(username, setpin, sdtid, token)
     db.insertOwner(chat_id, chat_name, team_name, username)
     return
Example #3
0
    def __init__(self, chat_id):
        db = Database()
        db.connection()
        isadmin = db.getAdmin(chat_id)
        isowner = db.getOwner(chat_id=chat_id)

        if isadmin:
            self.currentRole = Admin()
            print("jadi admin")

        elif isowner:
            self.currentRole = Owner()
            print("jadi owner")

        else:
            self.currentRole = User()
            print("jadi user")