<legend id='8NQcQ'><style id='8NQcQ'><dir id='8NQcQ'><q id='8NQcQ'></q></dir></style></legend>
      1. <small id='8NQcQ'></small><noframes id='8NQcQ'>

      2. <tfoot id='8NQcQ'></tfoot>

          <bdo id='8NQcQ'></bdo><ul id='8NQcQ'></ul>
        <i id='8NQcQ'><tr id='8NQcQ'><dt id='8NQcQ'><q id='8NQcQ'><span id='8NQcQ'><b id='8NQcQ'><form id='8NQcQ'><ins id='8NQcQ'></ins><ul id='8NQcQ'></ul><sub id='8NQcQ'></sub></form><legend id='8NQcQ'></legend><bdo id='8NQcQ'><pre id='8NQcQ'><center id='8NQcQ'></center></pre></bdo></b><th id='8NQcQ'></th></span></q></dt></tr></i><div id='8NQcQ'><tfoot id='8NQcQ'></tfoot><dl id='8NQcQ'><fieldset id='8NQcQ'></fieldset></dl></div>

      3. Discord.py:NameError:未定义名称“意图"

        时间:2023-10-10
        • <bdo id='f11KH'></bdo><ul id='f11KH'></ul>

          • <legend id='f11KH'><style id='f11KH'><dir id='f11KH'><q id='f11KH'></q></dir></style></legend>
            • <tfoot id='f11KH'></tfoot>
              1. <i id='f11KH'><tr id='f11KH'><dt id='f11KH'><q id='f11KH'><span id='f11KH'><b id='f11KH'><form id='f11KH'><ins id='f11KH'></ins><ul id='f11KH'></ul><sub id='f11KH'></sub></form><legend id='f11KH'></legend><bdo id='f11KH'><pre id='f11KH'><center id='f11KH'></center></pre></bdo></b><th id='f11KH'></th></span></q></dt></tr></i><div id='f11KH'><tfoot id='f11KH'></tfoot><dl id='f11KH'><fieldset id='f11KH'></fieldset></dl></div>
              2. <small id='f11KH'></small><noframes id='f11KH'>

                  <tbody id='f11KH'></tbody>

                  本文介绍了Discord.py:NameError:未定义名称“意图"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在尝试在我的机器人中使用意图,但在运行以下代码时:

                  I'm trying to use intents in my bot but when running the following code:

                  import discord
                  from discord.ext import commands
                  
                  intents = discord.Intents.default()
                  intents.members = True
                  bot = commands.Bot(command_prefix=prefix, intent=intents)
                  

                  我得到错误:

                    File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discor
                  Traceback (most recent call last):
                    File "main.py", line 3, in <module>
                      intents = discord.Intents.default()
                  AttributeError: module 'discord' has no attribute 'Intents'
                  

                  我正在运行 Python 3.8.2,但我不知道为什么会这样.任何帮助都将不胜感激(:

                  I am running Python 3.8.2, and I don't know why this is happening. Any help would be appriceated (:

                  推荐答案

                  你很可能没有真正使用 discord.py 1.5.1,你可以在导入后打印 discord.__version__ 仔细检查.最佳做法是对包使用 Python venv像这样.此外,为了确保您始终访问正确的 pip,您可以使用 python -m pip.这意味着您始终将 pip 用于稍后将调用脚本的同一版本.

                  You are most likely not actually using discord.py 1.5.1, you can print discord.__version__ after importing it to double check. Best practise is to use Python venv for packages like this. Additionally, to make sure you are always accessing the correct pip, you can use python -m pip. This means you are always using pip for the same version you will invoke the script with later.

                  这篇关于Discord.py:NameError:未定义名称“意图"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:更改用户的昵称——Discord.py 下一篇:无法获得窗口,中止

                  相关文章

                  最新文章

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

                    1. <tfoot id='In5Lg'></tfoot>
                    2. <legend id='In5Lg'><style id='In5Lg'><dir id='In5Lg'><q id='In5Lg'></q></dir></style></legend>

                      <i id='In5Lg'><tr id='In5Lg'><dt id='In5Lg'><q id='In5Lg'><span id='In5Lg'><b id='In5Lg'><form id='In5Lg'><ins id='In5Lg'></ins><ul id='In5Lg'></ul><sub id='In5Lg'></sub></form><legend id='In5Lg'></legend><bdo id='In5Lg'><pre id='In5Lg'><center id='In5Lg'></center></pre></bdo></b><th id='In5Lg'></th></span></q></dt></tr></i><div id='In5Lg'><tfoot id='In5Lg'></tfoot><dl id='In5Lg'><fieldset id='In5Lg'></fieldset></dl></div>
                      • <bdo id='In5Lg'></bdo><ul id='In5Lg'></ul>