staciax / valorant-discord-bot

A discord bot with valorant api.
GNU General Public License v3.0
338 stars 201 forks source link

How can I get price of the skin & its rank? #74

Closed musnows closed 2 years ago

musnows commented 2 years ago

HELLO!

I'm new in Python,while using valorant-api, I found that the price of the skin and the rank of the skin (not the weapons/skinlevels includes in api,but like epic skin). How can I get the price of the skin and this rank?

image

url = f"https://valorant-api.com/v1/weapons/skinlevels/{skinuuid}"
headers = {'Connection': 'close'}
res = requests.get(url=url,headers=headers)
res1 = json.loads(res.text)

the res of this code is👇

{'status': 200, 'data': {'uuid': 'fc4c3dcb-4f6d-5e8e-3dc3-1695f55d24c2', 'displayName': '王牌戰隊 幻象', 'levelItem': None, 'displayIcon': 'https://media.valorant-api.com/weaponskinlevels/fc4c3dcb-4f6d-5e8e-3dc3-1695f55d24c2/displayicon.png', 'streamedVideo': None, 'assetPath': 'ShooterGame/Content/Equippables/Guns/Rifles/Carbine/Flush/Levels/Carbine_Flush_Lv1_PrimaryAsset'}}

PS: I use ValorantClientAPI to fetch my daily shop

staciax commented 2 years ago

image https://github.com/staciax/Valorant-DiscordBot/blob/25504c9a5d9e88dc27e940759c7f13ca2a197b1b/utils/valorant/cache.py#L35-L53

replace uuid

staciax commented 2 years ago

fetch price

https://github.com/staciax/Valorant-DiscordBot/blob/25504c9a5d9e88dc27e940759c7f13ca2a197b1b/utils/valorant/endpoint.py#L179-L185

staciax commented 2 years ago

Now I can't answer much. I'll try to forget my old way of coding.

I am currently coding an object oriented valorant client. ready to update v4.0.0

I'm not sure when I will finish coding. Because my homework is a lot 😢

musnows commented 2 years ago

Thanks a lot,I will check it out.

but most of my bot users are afraid of getting banded😂Only a few of them are willing to use

musnows commented 2 years ago

YES!I foud the api to fetch price and skin_level!

Because of the traslation issue(I'm not native En speaker),I ignore this api before