Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async def tour_join(self, battle_format, team):
- while True:
- msg = await self.receive_message()
- split_msg = msg.split('|')
- print(msg)
- if msg.startswith("|tournament|create|"):
- message = ["/tour join"]
- await self.send_message(self.room, message)
- format = split_msg[3]
- message = ["nouveau tournois en " + format]
- logger.debug(message)
- await self.send_message(self.room, message)
- await self.update_team(team)
- if msg.startswith("|tournament|update|"):
- if "challenged" in msg:
- oppo = json.loads(split_msg[3])
- username = str(oppo["challenged"])
- message = ["/tournament acceptchallenge " + username]
- await self.send_message(self.room, message)
- if "challenges" in msg:
- oppo = json.loads(split_msg[3])
- username = str(oppo["challenges"])
- message = ["/tour challenge " + username]
- await self.send_message(self.room, message)
- if "challengeBys" in msg:
- oppo = json.loads(split_msg[3])
- username = str(oppo["challengeBys"])
- message = ["/tournament challenge " + username]
- await self.send_message(self.room, message)
- message = ["/tournament acceptchallenge " + username]
- await self.send_message(self.room, message)
- if msg.startswith("|updatesearch|") and "battle" in msg:
- break
Advertisement
Add Comment
Please, Sign In to add comment