Skip to content
Advertisement

How to get/request the api: https://ev.io/stats-by-un/(username)

I want to show in game stats when the player puts in $stats (username)

JavaScript

Advertisement

Answer

First, you need to request the api which you need the requests module.

JavaScript

Next, you need to know how to get the data from the requested api.

JavaScript

I wouldn’t suggest using requests within asynchronous code since it’s blocking. discord.py uses aiohttp, so it should already be installed.

Here’s an example code using aiohttp and discord.py:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement