[英]Discord.py input convert to int()
如何在 discord 上將輸入轉換為 int()?
例子:
input = await bot.wait_for("message")
我試着像int(answer)
那樣轉換
謝謝。
編輯:獲取錯誤TypeError: int() argument must be a string, a bytes-like object or a real number, not 'Message'
這是將其轉換為 int 的方法 -
# Convert the input to an integer
result = int(input.content)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.