K
K
kelly1232021-07-24 17:37:10
Python
kelly123, 2021-07-24 17:37:10

Where is this code located in the discord.py documentation? Can you please send a link?

Tell me where in this documentation https://discordpy.readthedocs.io/en/latest/index.html is this code?

@bot.command()
async def test3(ctx):
    r = requests.get('https://api.vimeworld.ru/online')
    json_data = r.json()
    online = json_data['total']
    await ctx.send(online)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
soremix, 2021-07-24
@SoreMix

I doubt that the developer of the discord library decided to insert some kind of parser into the documentation. Why does this code even have to be there?

Y
Yanis07, 2021-10-07
@Yanis07

The code you specified is waiting for a command

test3
code examples
then the third-party requests library makes an API request
receives a response from the server in the form of json and await ctx.send(online)
sends a message to the same discord channel where this command was

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question