Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Discord.py input convert to int()

how can i convert input to int() on discord ?

Example:

input = await bot.wait_for("message")

i was try to did convert like int(answer)

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Thanks.

Edit: Getting error TypeError: int() argument must be a string, a bytes-like object or a real number, not 'Message'

>Solution :

Here’s how you can convert it to int –

# Convert the input to an integer
result = int(input.content)
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading