class MoveTracker(): def __init__(self, message, bot): self.bot = bot self.message = message self.channel = message.channel self.rp_categories = [ 705086857666625556, 705087129230901308, 705087219592986735, 705089353990275183, 705089462576873622, 705090448385114132, 705090522401865769, 708006905741574168 ] self.player = ExistProfil(self.message.author.id) def hasMove(self): self.oldchan = self.player.location self.newchan = self.channel return self.oldchan != self.newchan.id async def move(self): self.player.update_location(self.newchan.id) await on_move(self.oldchan, self.newchan) return await self.log() async def log(self): await self.message.guild.get_channel(705079279100362912).send( f"{self.message.author.display_name} s'est déplacé de <#{self.oldchan}> vers <#{self.newchan.id}>" ) return 'logged'
def __init__(self, message, bot): self.bot = bot self.message = message self.channel = message.channel self.rp_categories = [ 705086857666625556, 705087129230901308, 705087219592986735, 705089353990275183, 705089462576873622, 705090448385114132, 705090522401865769, 708006905741574168 ] self.player = ExistProfil(self.message.author.id)
def update_syno(self): service = Querry("SELECT * FROM service") for data in service: i, uid, name, starttime, cta = data player = ExistProfil(uid) if not cta: self.syno[player.hierarchie - 1] += 1 if cta: self.syno[5] += 1 return self
async def expired_pager_manager(): try: datas = Querry("SELECT * FROM bip") for data in datas: bip = ExistBip(wh[1]) if bip.has_expired() and not bip.has_low_battery: bip.set_lowbattery() bip.set_time_before_down() elif bip.has_expired and bip.has_low_battery: ExistProfil(bip.id_owner).end_service() bip.drop() except: pass
def __init__(self, id_owner): data = Querry(f"SELECT * FROM `tph` WHERE `id_owner`='{id_owner}'") id, self.id_owner, self.expiration, self.frequency = data[0] self.channel = ExistProfil(self.id_owner).location
def searchTph(self): tphs = Querry( f"SELECT id_owner FROM tph WHERE `Frequency`='{self.frequency}'") for tph in tphs: self.channels.append(ExistProfil(tph[0]).location) return self