Home > OS >  Discord.py input convert to int()
Discord.py input convert to int()

Time:12-13

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)

Thanks.

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

CodePudding user response:

Here's how you can convert it to int -

# Convert the input to an integer
result = int(input.content)
  • Related