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

    <bdo id='9D1nb'></bdo><ul id='9D1nb'></ul>
  • <small id='9D1nb'></small><noframes id='9D1nb'>

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

    <tfoot id='9D1nb'></tfoot>

    <legend id='9D1nb'><style id='9D1nb'><dir id='9D1nb'><q id='9D1nb'></q></dir></style></legend>
      1. discord.py 重寫:TypeError:cogs 必須從 Cog 派生

        discord.py rewrite: TypeError: cogs must derive from Cog(discord.py 重寫:TypeError:cogs 必須從 Cog 派生)

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

          <bdo id='e4R7T'></bdo><ul id='e4R7T'></ul>
          <tfoot id='e4R7T'></tfoot>
                <tbody id='e4R7T'></tbody>
              <i id='e4R7T'><tr id='e4R7T'><dt id='e4R7T'><q id='e4R7T'><span id='e4R7T'><b id='e4R7T'><form id='e4R7T'><ins id='e4R7T'></ins><ul id='e4R7T'></ul><sub id='e4R7T'></sub></form><legend id='e4R7T'></legend><bdo id='e4R7T'><pre id='e4R7T'><center id='e4R7T'></center></pre></bdo></b><th id='e4R7T'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='e4R7T'><tfoot id='e4R7T'></tfoot><dl id='e4R7T'><fieldset id='e4R7T'></fieldset></dl></div>

              <legend id='e4R7T'><style id='e4R7T'><dir id='e4R7T'><q id='e4R7T'></q></dir></style></legend>

                  本文介紹了discord.py 重寫:TypeError:cogs 必須從 Cog 派生的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  隨著我的機器人越來越大,我正在嘗試實現 cogs,但是我遇到了一個問題.我已經設置并準備好了整個代碼,但由于某些奇怪的原因,我不斷收到此錯誤:

                  As my bot is getting bigger, I'm trying to implement cogs, however I have ran across a problem. I have my whole code set up and ready, but for some weird reason I keep getting this error:

                      Traceback (most recent call last):
                    File "C:UsersLaurasDesktopAkagi Botmain.py", line 107, in <module>
                      bot.add_cog("cogs.fun")
                    File "C:UsersLaurasAppDataLocalProgramsPythonPython36libsite-packagesdiscordextcommandsot.py", line 477, in add_cog
                      raise TypeError('cogs must derive from Cog')
                  TypeError: cogs must derive from Cog
                  

                  我在 main.py 上的代碼如下所示:

                  My code on main.py looks like this:

                     import discord
                      import asyncio
                      import typing
                      import random
                      import json
                      import oauth
                      from discord.ext import commands
                  
                  bot = commands.Bot(command_prefix='~')
                  
                  @bot.event
                  async def on_ready():
                      await bot.change_presence(activity=discord.Activity(name='with Kaga :3',type=0))
                      print (discord.__version__)
                      print(f"{bot.user.name} - {bot.user.id}")
                      print ('Akagi is ready to serve the Commander :3 !')
                  
                      bot.add_cog("cogs.fun")
                      bot.run(oauth.bot_token)
                  

                  有趣"的齒輪如下:

                  import discord
                  from discord.ext import commands
                  
                  bot = commands.Bot(command_prefix='~')
                  
                  class FunCog:
                      def __init__(self, bot):
                          self.bot = bot
                  
                      @commands.command()
                      async def hug(self, ctx):
                          await ctx.send('has been hugged by', file=discord.File('iloveyou.gif'))
                          pass
                  
                  
                  def setup(bot: commands.Bot):
                      bot.add_cog(FunCog(bot))
                  

                  可能是什么問題?我也在使用 discord.py 重寫.謝謝!

                  What could be the problem? I'm also using discord.py rewrite. Thanks !

                  推薦答案

                  我建議查看 https://discordpy.readthedocs.io/en/latest/ext/commands/cogs.html這將幫助您更好地了解 Cogs.

                  I recommend checking out https://discordpy.readthedocs.io/en/latest/ext/commands/cogs.html This will help you get a better understanding of Cogs.

                  首先,您需要將 bot.add_cog("cogs.fun") 更改為 bot.load_extension("cogs.fun")

                  Firstly, you need to change bot.add_cog("cogs.fun") to bot.load_extension("cogs.fun")

                  這不是必需的,但您不需要再次定義 bot.將 def setup(bot: commands.Bot): 更改為 def setup(bot):

                  This isn't necessary but you don't need to define bot again. Change def setup(bot: commands.Bot): to def setup(bot):

                  您還需要將 class FunCog: 更改為 class FunCog(commands.Cog):

                  You will also need to change class FunCog: to class FunCog(commands.Cog):

                  我建議在重寫版本的新更新發布時及時了解更改.以下是工作 cog 文件的示例..希望這有幫助!最大.

                  I recommend staying up to date with changes when new updates come out for the rewrite version. Here is a quick look into an example of a working cog file.. Hope this helped! Max.

                  這篇關于discord.py 重寫:TypeError:cogs 必須從 Cog 派生的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 - 自動更改角色顏色)
                  <i id='HTOhB'><tr id='HTOhB'><dt id='HTOhB'><q id='HTOhB'><span id='HTOhB'><b id='HTOhB'><form id='HTOhB'><ins id='HTOhB'></ins><ul id='HTOhB'></ul><sub id='HTOhB'></sub></form><legend id='HTOhB'></legend><bdo id='HTOhB'><pre id='HTOhB'><center id='HTOhB'></center></pre></bdo></b><th id='HTOhB'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='HTOhB'><tfoot id='HTOhB'></tfoot><dl id='HTOhB'><fieldset id='HTOhB'></fieldset></dl></div>
                      <tbody id='HTOhB'></tbody>

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

                    • <tfoot id='HTOhB'></tfoot>

                      <legend id='HTOhB'><style id='HTOhB'><dir id='HTOhB'><q id='HTOhB'></q></dir></style></legend>

                          • <bdo id='HTOhB'></bdo><ul id='HTOhB'></ul>
                            主站蜘蛛池模板: 九九免费视频 | 国产欧美日韩精品在线观看 | 久久在视频 | 精品视频一区二区 | 精品国产18久久久久久二百 | 国产视频一区二区 | 成人精品区 | 国产欧美一区二区在线观看 | 日韩在线视频一区二区三区 | 欧美日韩精品亚洲 | 91婷婷韩国欧美一区二区 | 国产精品视频久久 | 亚洲高清在线观看 | 亚洲国产精品一区二区久久 | 日韩欧美大片在线观看 | 欧美一区二区 | av片免费| 日韩免费视频一区二区 | 91性高湖久久久久久久久_久久99 | 手机在线不卡av | 国产一区二区在线播放 | 在线视频91 | 亚洲国产专区 | jlzzjlzz国产精品久久 | 国产粉嫩尤物极品99综合精品 | 91久久国产综合久久91精品网站 | 亚洲欧美精品在线观看 | 亚洲 成人 在线 | 亚洲精品电影在线观看 | 免费看日韩视频 | 国产亚洲一区二区精品 | www.男人天堂.com | 亚洲国产精品一区二区三区 | 久久人人国产 | 国产成人jvid在线播放 | 国产精品免费高清 | 日韩av成人在线观看 | 污污的网站在线观看 | 国产成人99久久亚洲综合精品 | 精品一区二区三区视频在线观看 | a级片网站 |