Compare, and bugfix stats

!compare <player, player>, weapon

player doesnt exist bug fixed in !stats
This commit is contained in:
2023-04-28 16:07:43 +02:00
parent b9f95524ce
commit a355b5c8fa
2 changed files with 109 additions and 17 deletions
+3 -2
View File
@@ -18,7 +18,7 @@ class Stats(commands.Cog):
if(message2 != "any weapon"):
message = message[:-1]
weaponid = self.getweaponid(message2)
playerid = ""
playerid = self.getplayerid(message);
if (playerid != ""):
payload = {'player': playerid, 'weapon': weaponid}
@@ -47,7 +47,8 @@ class Stats(commands.Cog):
playerid = ""
payload = str("username=") + playername
response = requests.get('https://northstar.tf/accounts/lookup_uid', params=payload).json()
playerid = response['matches'][0]
if (response['matches'] != None):
playerid = response['matches'][0]
return str(playerid)
def getweaponid(self, weaponname):