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

        <bdo id='Rhs43'></bdo><ul id='Rhs43'></ul>
      <legend id='Rhs43'><style id='Rhs43'><dir id='Rhs43'><q id='Rhs43'></q></dir></style></legend>

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

      2. <small id='Rhs43'></small><noframes id='Rhs43'>

      3. Discord.py 顯示誰邀請了用戶

        Discord.py show who invited a user(Discord.py 顯示誰邀請了用戶)
            <tbody id='xfYES'></tbody>

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

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

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

                  本文介紹了Discord.py 顯示誰邀請了用戶的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我目前正在嘗試找出一種方法來了解誰邀請了用戶.從官方文檔中,我認為 member 類將具有顯示誰邀請他們的屬性,但事實并非如此.我對獲取邀請的用戶的可能方法有一個非常模糊的想法,那就是獲取服務器中的所有邀請,然后獲取使用次數(shù),當有人加入服務器時,它會檢查是否有增加的邀請一種用途.但我不知道這是否是最有效的方法,或者至少是使用過的方法.

                  I am currently trying to figure out a way to know who invited a user. From the official docs, I would think that the member class would have an attribute showing who invited them, but it doesn't. I have a very faint idea of a possible method to get the user who invited and that would be to get all invites in the server then get the number of uses, when someone joins the server, it checks to see the invite that has gone up a use. But I don't know if this is the most efficient method or at least the used method.

                  推薦答案

                  制作一個 config.json 文件,內(nèi)容為

                  Make a config.json file with the content of

                  {
                      "token": "Bot token here",
                      "server-id": "server id here",
                      "logs-channel-id": "invite channel here"
                  }
                  

                  然后保存.

                  創(chuàng)建一個名為 invites 的頻道,然后填寫 config.json 文件.然后創(chuàng)建一個名為 bot.py 的文件并將內(nèi)容放入:

                  Make a channel called invites then fill in the config.json file. And then create a file called bot.py and put the contents of:

                  import asyncio
                  import datetime
                  import json
                  import os
                  import commands
                  
                  client = discord.Client()
                  cfg = open("config.json", "r")
                  tmpconfig = cfg.read()
                  cfg.close()
                  config = json.loads(tmpconfig)
                  
                  token = config["token"]
                  guild_id = config["server-id"]
                  logs_channel = config["logs-channel-id"]
                  
                  
                  invites = {}
                  last = ""
                  
                  async def fetch():
                   global last
                   global invites
                   await client.wait_until_ready()
                   gld = client.get_guild(int(guild_id))
                   logs = client.get_channel(int(logs_channel))
                   while True:
                    invs = await gld.invites()
                    tmp = []
                    for i in invs:
                     for s in invites:
                      if s[0] == i.code:
                       if int(i.uses) > s[1]:
                        usr = gld.get_member(int(last))
                        testh = f"{usr.name} **joined**; Invited by **{i.inviter.name}** (**{str(i.uses)}** invites)"
                        await logs.send(testh)
                     tmp.append(tuple((i.code, i.uses)))
                    invites = tmp
                    await asyncio.sleep(4)
                  
                  
                  @client.event
                  async def on_ready():
                   print("ready!")
                   await client.change_presence(activity = discord.Activity(name = "joins", type = 2))
                  
                  
                  @client.event
                  async def on_member_join(meme):
                   global last
                   last = str(meme.id)
                  
                  
                  
                  
                  client.loop.create_task(fetch())
                  client.run(token)
                  

                  然后打開終端運行python3 bot.py.如需更多幫助,請加入 this.

                  Then open the terminal and run python3 bot.py. And for more help join this.

                  這篇關于Discord.py 顯示誰邀請了用戶的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關文檔推薦

                  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='ZivP4'><style id='ZivP4'><dir id='ZivP4'><q id='ZivP4'></q></dir></style></legend>
                  • <bdo id='ZivP4'></bdo><ul id='ZivP4'></ul>

                          <tbody id='ZivP4'></tbody>

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

                        <i id='ZivP4'><tr id='ZivP4'><dt id='ZivP4'><q id='ZivP4'><span id='ZivP4'><b id='ZivP4'><form id='ZivP4'><ins id='ZivP4'></ins><ul id='ZivP4'></ul><sub id='ZivP4'></sub></form><legend id='ZivP4'></legend><bdo id='ZivP4'><pre id='ZivP4'><center id='ZivP4'></center></pre></bdo></b><th id='ZivP4'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ZivP4'><tfoot id='ZivP4'></tfoot><dl id='ZivP4'><fieldset id='ZivP4'></fieldset></dl></div>
                            <tfoot id='ZivP4'></tfoot>
                            主站蜘蛛池模板: 中文字幕一二三四区 | 日本加勒比在线观看 | 国产伦精品一区二区三区视频网站 | 久久综合五月天 | 五月激情网站 | 欧美黑人一区二区三区 | 情侣av| 又黄又爽又色视频 | 亚洲激情欧美激情 | 欧美在线小视频 | 免费看大片a | 午夜999 | 人人插人人射 | 日本免费在线观看 | 在线免费看毛片 | 美女国产精品 | 中文字幕在线观看亚洲 | 欧美激情综合网 | 国产成人在线播放 | 中文字幕在线观看一区二区 | 日本在线天堂 | 黄色影视在线观看 | 一区二区视频在线 | 国产午夜精品久久久久久久 | 免费看a级片 | 亚洲午夜久久 | 日韩精品三区 | 波多野结衣在线观看一区二区 | 色77777| 日本三级韩国三级美三级91 | 亚洲视频一区在线观看 | 精品久久网站 | 五月天激情综合网 | 亚洲综合视频在线观看 | 日韩精品影院 | 最新av在线| av不卡一区| 欧美在线一区二区 | 黄色一级片免费看 | 91福利区 | 可以免费看黄的网站 |