fix avatar none & change beta expansions
This commit is contained in:
parent
5fb53a7be6
commit
473cb2a207
@ -47,7 +47,7 @@ class PendingAction(IntEnum):
|
|||||||
class Player:
|
class Player:
|
||||||
|
|
||||||
def is_admin(self):
|
def is_admin(self):
|
||||||
return self.discord_id in {'244893980960096266'}
|
return self.discord_id in {'244893980960096266', '539795574019457034'}
|
||||||
|
|
||||||
def get_avatar(self):
|
def get_avatar(self):
|
||||||
import requests
|
import requests
|
||||||
@ -57,7 +57,11 @@ class Player:
|
|||||||
r = requests.get('https://discordapp.com/api/users/@me', headers=headers)
|
r = requests.get('https://discordapp.com/api/users/@me', headers=headers)
|
||||||
if r.status_code == 200:
|
if r.status_code == 200:
|
||||||
res = r.json()
|
res = r.json()
|
||||||
self.avatar = f'https://cdn.discordapp.com/avatars/{res["id"]}/{res["avatar"]}.png'
|
print(res)
|
||||||
|
if res["avatar"] == None:
|
||||||
|
self.avatar = robot_pictures[randrange(len(robot_pictures))]
|
||||||
|
else:
|
||||||
|
self.avatar = f'https://cdn.discordapp.com/avatars/{res["id"]}/{res["avatar"]}.png'
|
||||||
if self.game:
|
if self.game:
|
||||||
self.sio.emit('chat_message', room=self.game.name, data=f'_change_username|{self.name}|{res["username"]}')
|
self.sio.emit('chat_message', room=self.game.name, data=f'_change_username|{self.name}|{res["username"]}')
|
||||||
self.name = res['username']
|
self.name = res['username']
|
||||||
|
@ -136,7 +136,7 @@ export default {
|
|||||||
password: '',
|
password: '',
|
||||||
togglable_expansions: [],
|
togglable_expansions: [],
|
||||||
expansions: [],
|
expansions: [],
|
||||||
beta_expansions: ['gold_rush'],
|
beta_expansions: ['the_valley_of_shadows'],
|
||||||
hasToSetUsername: false,
|
hasToSetUsername: false,
|
||||||
is_competitive: false,
|
is_competitive: false,
|
||||||
disconnect_bot: false,
|
disconnect_bot: false,
|
||||||
|
Loading…
Reference in New Issue
Block a user