簡體   English   中英

Discord.py 輸入轉換為 int()

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM