久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <tfoot id='JNS9F'></tfoot>

    <small id='JNS9F'></small><noframes id='JNS9F'>

        • <bdo id='JNS9F'></bdo><ul id='JNS9F'></ul>
        <i id='JNS9F'><tr id='JNS9F'><dt id='JNS9F'><q id='JNS9F'><span id='JNS9F'><b id='JNS9F'><form id='JNS9F'><ins id='JNS9F'></ins><ul id='JNS9F'></ul><sub id='JNS9F'></sub></form><legend id='JNS9F'></legend><bdo id='JNS9F'><pre id='JNS9F'><center id='JNS9F'></center></pre></bdo></b><th id='JNS9F'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='JNS9F'><tfoot id='JNS9F'></tfoot><dl id='JNS9F'><fieldset id='JNS9F'></fieldset></dl></div>
      1. <legend id='JNS9F'><style id='JNS9F'><dir id='JNS9F'><q id='JNS9F'></q></dir></style></legend>

        Discord Bot - “屬性錯誤:‘NoneType’對象沒有屬性‘

        Discord Bot - quot;Attribute Error: #39;NoneType#39; object has no attribute #39;strip.#39;(Discord Bot - “屬性錯誤:‘NoneType’對象沒有屬性‘strip’.)
        <legend id='Mla8v'><style id='Mla8v'><dir id='Mla8v'><q id='Mla8v'></q></dir></style></legend>
            <tbody id='Mla8v'></tbody>
          <i id='Mla8v'><tr id='Mla8v'><dt id='Mla8v'><q id='Mla8v'><span id='Mla8v'><b id='Mla8v'><form id='Mla8v'><ins id='Mla8v'></ins><ul id='Mla8v'></ul><sub id='Mla8v'></sub></form><legend id='Mla8v'></legend><bdo id='Mla8v'><pre id='Mla8v'><center id='Mla8v'></center></pre></bdo></b><th id='Mla8v'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Mla8v'><tfoot id='Mla8v'></tfoot><dl id='Mla8v'><fieldset id='Mla8v'></fieldset></dl></div>

                <bdo id='Mla8v'></bdo><ul id='Mla8v'></ul>

              • <tfoot id='Mla8v'></tfoot>
                1. <small id='Mla8v'></small><noframes id='Mla8v'>

                  本文介紹了Discord Bot - “屬性錯誤:‘NoneType’對象沒有屬性‘strip’.的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我是一名新程序員,我一直在關注一個tutorial 關于如何使用下面的代碼創建一個不和諧的機器人,這些代碼實際上是直接從教程中復制出來的,我已經創建了一個 .env 文件來存儲我的 AuthToken.每次我運行代碼時,都會出現上述代碼下方的錯誤.有小費嗎?提前致謝!

                  I'm a new coder, and I've been following atutorial on how to create a discord bot with the code below having been virtually copied the code straight out from the tutorial, and I've create a .env file to store my AuthToken. Every time I run the code, I get error below aforementioned code. Any tips? Thanks in advance!

                  代碼:

                  import os 
                  
                  import discord
                  
                  from dotenv import load_dotenv
                  
                  load_dotenv()
                  TOKEN = os.getenv('DISCORD_TOKEN')
                  
                  client = discord.Client()
                  
                  @client.event
                  async def on_ready():
                      print(f'{client.user} has connected to Discord!')
                  client.run(TOKEN)
                  
                  

                  錯誤:

                  Traceback (most recent call last):   File "/Users/XXXXXXXXXXXX/scratch/discordbot/app.py", line 16, in <module>
                      client.run(TOKEN)   File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/client.py", line 640, in run
                      return future.result()   File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/client.py", line 621, in runner
                      await self.start(*args, **kwargs)   File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/client.py", line 584, in start
                      await self.login(*args, bot=bot)   File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/client.py", line 442, in login
                      await self.http.static_login(token.strip(), bot=bot) AttributeError: 'NoneType' object has no attribute 'strip' 
                  
                  

                  推薦答案

                  我按照同樣的教程,遇到了同樣的錯誤.對我來說,問題是我創建了.env".文件不正確.在教程中它說在與 bot.py 相同的目錄中創建一個名為 .env 的文件:"- 這是我的問題.如果您創建一個新的文本文檔,粘貼代碼,然后使用名稱.env"保存它,您將實際創建一個名為.env.txt"的文本文件;.

                  I was following the same tutorial and ran into the same error. Issue for me was that I had created the ".env" file incorrectly. In the tutorial it says "Create a file named .env in the same directory as bot.py:" - this was my issue. If you create a new text document, paste in the code, then save it with the name ".env", what you'll actaully be creating is a text file called ".env.txt".

                  要解決這個問題,請轉到保存 Python 腳本的目錄(對我來說,這是 C:ThonnyDiscordBots),然后右鍵單擊該文件夾并選擇新建".文本文檔".不要更改文件名,只需將其保留為新建文本文檔"即可.打開此文件(應在記事本中打開),然后粘貼教程中的代碼(另外,請記住將您的機器人的實際令牌替換為名為 {your-bot-token} 的占位符變量).現在,轉到文件"另存為"并在文件名字段中,輸入.env";就像教程說的那樣;在您點擊保存之前,還請單擊 另存為類型 下拉菜單(應該在 文件名 的正下方),而不是將其保留為默認類型(*.txt),將其更改為所有文件".

                  To get around this, go to the directory where you have the python script saved (for me this is C:ThonnyDiscordBots), then right-click in that folder and select "New > Text Document". Don't change the filename yet, just leave it as "New Text Document". Open this file (should open in Notepad), then paste in the code from the tutorial (also, remember to substitute your bot's actual token in for the placeholder variable called {your-bot-token}). Now, go to "File > Save As" and in the File Name field, type ".env" just like the tutorial says to; BEFORE you hit save, also click the Save as type dropdown (should be right below File Name) and instead of leaving it as the default type (*.txt), change this to "All Files".

                  如果您已正確完成此操作,您應該會看到您的.env".文件資源管理器中的文件,以及類型"列現在將顯示ENV 文件";而不是文本文檔".嘗試再次運行代碼.

                  If you've done this correctly, you should see your ".env" file in file explorer, and the "Type" column will now show "ENV File" instead of "text document". Try to run the code again.

                  這對我有幫助.我的理解是load_dotenv()";正在尋找 ENV type 的文件,而不僅僅是 any 名為.env"的文件;(任何類型).只要此文件與您正在運行的腳本位于同一目錄中,它就應該可以工作.

                  This is what helped me. My understanding is that "load_dotenv()" is looking for a file of the ENV type, not just any document called ".env" (of any type). As long as this file is placed in the same directory as the script you're running, it should work.

                  這篇關于Discord Bot - “屬性錯誤:‘NoneType’對象沒有屬性‘strip’.的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to make a discord bot that gives roles in Python?(如何制作一個在 Python 中提供角色的不和諧機器人?)
                  Discord bot isn#39;t responding to commands(Discord 機器人沒有響應命令)
                  Can you Get the quot;About mequot; feature on Discord bot#39;s? (Discord.py)(你能得到“關于我嗎?Discord 機器人的功能?(不和諧.py))
                  message.channel.id Discord PY(message.channel.id Discord PY)
                  How do I host my discord.py bot on heroku?(如何在 heroku 上托管我的 discord.py 機器人?)
                  discord.py - Automaticaly Change an Role Color(discord.py - 自動更改角色顏色)
                  <legend id='hYVFE'><style id='hYVFE'><dir id='hYVFE'><q id='hYVFE'></q></dir></style></legend>

                    <bdo id='hYVFE'></bdo><ul id='hYVFE'></ul>
                          <tbody id='hYVFE'></tbody>

                          1. <small id='hYVFE'></small><noframes id='hYVFE'>

                            <i id='hYVFE'><tr id='hYVFE'><dt id='hYVFE'><q id='hYVFE'><span id='hYVFE'><b id='hYVFE'><form id='hYVFE'><ins id='hYVFE'></ins><ul id='hYVFE'></ul><sub id='hYVFE'></sub></form><legend id='hYVFE'></legend><bdo id='hYVFE'><pre id='hYVFE'><center id='hYVFE'></center></pre></bdo></b><th id='hYVFE'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='hYVFE'><tfoot id='hYVFE'></tfoot><dl id='hYVFE'><fieldset id='hYVFE'></fieldset></dl></div>
                            <tfoot id='hYVFE'></tfoot>
                            主站蜘蛛池模板: 九九伦理电影 | 国产精品免费视频一区 | 中文字幕在线观看一区 | 91社区在线高清 | 亚洲毛片在线观看 | 久国产视频 | 亚洲福利精品 | 一区二区三区国产 | 特一级黄色毛片 | 国产激情在线观看 | 久久久久久久夜 | 欧美精品一区二区三区四区五区 | 亚洲午夜视频 | 国产精品国产精品 | 性高湖久久久久久久久3小时 | 99色综合 | 激情91 | 国产精品www | 国产亚洲网站 | 亚洲精品久久久久久久久久久久久 | 国产精品久久久精品 | 欧美一级欧美一级在线播放 | 久久午夜精品福利一区二区 | www国产成人免费观看视频,深夜成人网 | 成人免费大片黄在线播放 | 网黄在线 | 亚洲成人午夜在线 | 中文精品视频 | 91精品国产综合久久小仙女图片 | 久久小视频 | 99re在线视频| 狠狠视频 | 国产欧美一区二区精品久导航 | www.久久久久久久久 | 亚洲日韩第一页 | 中文成人在线 | 亚洲精品二区 | 中文字幕 国产精品 | 国产高清视频在线观看 | 国产精品久久久久久婷婷天堂 | 一区二区三区四区在线视频 |