<small id='7FnU8'></small><noframes id='7FnU8'>

    <legend id='7FnU8'><style id='7FnU8'><dir id='7FnU8'><q id='7FnU8'></q></dir></style></legend><tfoot id='7FnU8'></tfoot>

        <bdo id='7FnU8'></bdo><ul id='7FnU8'></ul>

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

        在 discord.py 中访问成员的横幅

        Accessing a member#39;s banner in discord.py(在 discord.py 中访问成员的横幅)
          <i id='PYgnL'><tr id='PYgnL'><dt id='PYgnL'><q id='PYgnL'><span id='PYgnL'><b id='PYgnL'><form id='PYgnL'><ins id='PYgnL'></ins><ul id='PYgnL'></ul><sub id='PYgnL'></sub></form><legend id='PYgnL'></legend><bdo id='PYgnL'><pre id='PYgnL'><center id='PYgnL'></center></pre></bdo></b><th id='PYgnL'></th></span></q></dt></tr></i><div id='PYgnL'><tfoot id='PYgnL'></tfoot><dl id='PYgnL'><fieldset id='PYgnL'></fieldset></dl></div>

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

              <tbody id='PYgnL'></tbody>

            <tfoot id='PYgnL'></tfoot>
                • <bdo id='PYgnL'></bdo><ul id='PYgnL'></ul>
                  <legend id='PYgnL'><style id='PYgnL'><dir id='PYgnL'><q id='PYgnL'></q></dir></style></legend>
                • 本文介绍了在 discord.py 中访问成员的横幅的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在制作图像配置文件命令.我想为此访问会员的横幅.有什么方法可以在 discord.py 中做到这一点?

                  I am making an image profile command. I would like to access the member's banner for this. Is there any way we can do that in discord.py?

                  如果不清楚我所说的横幅是什么意思,那么带有蓝色背景的图像就是横幅.我想访问它.

                  If it is not clear what i mean by banner then, the image with the blue background is the banner. I would like to access that.

                  推荐答案

                  discord.py v2.0可以使用

                  In discord.py v2.0 you can use

                  # You may have to re-fetch the user for the banner to work properly
                  user = await bot.fetch_user(user.id)
                  banner_url = user.banner.url # The URL of the banner
                  

                  在v2.0之前,有一种hacky方式可以直接使用API​​获取banner

                  Before v2.0, there is a hacky way to get the banner by directly using the API

                  req = await bot.http.request(discord.http.Route("GET", "/users/{uid}", uid=user.id))
                  banner_id = req["banner"]
                  if banner_id:
                      banner_url = f"https://cdn.discordapp.com/banners/{user.id}/{banner_id}?size=1024"
                  else:
                      # The user doesn't have a banner, do what you want
                      # In many forks, User.accent_color exists so you
                      # may want to check if your library supports that first
                      pass
                  

                  要安装 discord.py v2.0,您应该运行

                  To install discord.py v2.0 you should run

                  pip install -U git+https://github.com/Rapptz/discord.py
                  

                  这篇关于在 discord.py 中访问成员的横幅的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持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 - 自动更改角色颜色)

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

                  • <bdo id='KqhvX'></bdo><ul id='KqhvX'></ul>

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

                            <tfoot id='KqhvX'></tfoot>