Rapptz / discord.py

An API wrapper for Discord written in Python.
http://discordpy.rtfd.org/en/latest
MIT License
14.7k stars 3.74k forks source link

get input from user? #2042

Closed JBB0 closed 5 years ago

JBB0 commented 5 years ago

I want to get input from a user, but I do not know how.

I am making a command called !setup, where the bot asks you to specify the name of your server, and you are supposed to type in the name of your server. Then that string the user entered is now assigned to the variable 'name'.

Phxntxm commented 5 years ago

https://discordpy.readthedocs.io/en/latest/api.html#discord.Client.wait_for_message

This is what you want. As a side-note, github issues are typically for issues with the library, not for questions about how to use it. For future questions like this, it's typically best to join the discord server and ask in there.

Harmon758 commented 5 years ago

Note, on the rewrite branch, passing "message" to Client.wait_for is the equivalent.