簡體   English   中英

誰能告訴我我的代碼中缺少什么,我不能使用 discord 用戶名

[英]can any one tell me what is missing in my code please, i cant use the discord user name

我希望用戶從 40 分開始,但如果他已經開始,只需發送他有多少分。

我目前得到的錯誤是:消息是缺少的必需參數。 但我不知道缺少什么。

async def money(self, ctx, message):
    user = message.author
    read = open(user, 'a').close()

    if os.stat(user).st_size == 0:
        moneyfile=open(user, 'w')
        moneyfile.write('40')
        moneyfile.close()
    else:
        readfile = open(user, 'r').read()
        points=readfile
        int(points)
        await ctx.send(points)

錯誤會自行讀取,您正在執行命令但未輸入消息參數。 要解決此問題,請刪除消息參數並將第二行中的用戶設置為 ctx.author。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

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