pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

        <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="ftldgtz" 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="qxh3nmh" 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 類將具有顯示誰邀請他們的屬性,但事實并非如此.我對獲取邀請的用戶的可能方法有一個非常模糊的想法,那就是獲取服務器中的所有邀請,然后獲取使用次數,當有人加入服務器時,它會檢查是否有增加的邀請一種用途.但我不知道這是否是最有效的方法,或者至少是使用過的方法.

                  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 文件,內容為

                  Make a config.json file with the content of

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

                  然后保存.

                  創建一個名為 invites 的頻道,然后填寫 config.json 文件.然后創建一個名為 bot.py 的文件并將內容放入:

                  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模板網!

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

                  相關文檔推薦

                  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="eisknxz" id='ZivP4'><tfoot id='ZivP4'></tfoot><dl id='ZivP4'><fieldset id='ZivP4'></fieldset></dl></div>
                            <tfoot id='ZivP4'></tfoot>
                            主站蜘蛛池模板: 巨野电机维修-水泵维修-巨野县飞宇机电维修有限公司 | 危废处理系统,水泥厂DCS集散控制系统,石灰窑设备自动化控制系统-淄博正展工控设备 | 高铝轻质保温砖_刚玉莫来石砖厂家_轻质耐火砖价格 | 安徽集装箱厂-合肥国彩钢结构板房工程有限公司 | 电磁流量计厂家_涡街流量计厂家_热式气体流量计-青天伟业仪器仪表有限公司 | 建筑资质代办_工程施工资质办理_资质代办公司_北京众聚企服 | 河北中仪伟创试验仪器有限公司是专业生产沥青,土工,水泥,混凝土等试验仪器的厂家,咨询电话:13373070969 | 永嘉县奥阳陶瓷阀门有限公司| 柴油机_柴油发电机_厂家_品牌-江苏卡得城仕发动机有限公司 | 金属切削液-脱水防锈油-电火花机油-抗磨液压油-深圳市雨辰宏业科技发展有限公司 | 金蝶帐无忧|云代账软件|智能财税软件|会计代账公司专用软件 | 东莞爱加真空科技有限公司-进口真空镀膜机|真空镀膜设备|Polycold维修厂家 | 手表腕表维修保养鉴定售后服务中心网点 - 名表维修保养 | 恒温油槽-恒温水槽-低温恒温槽厂家-宁波科麦仪器有限公司 | 玉米加工设备,玉米深加工机械,玉米糁加工设备.玉米脱皮制糁机 华豫万通粮机 | 许昌奥仕达自动化设备有限公司 | 成人纸尿裤,成人尿不湿,成人护理垫-山东康舜日用品有限公司 | 达利园物流科技集团-| 江苏全风,高压风机,全风环保风机,全风环形高压风机,防爆高压风机厂家-江苏全风环保科技有限公司(官网) | 钢绞线万能材料试验机-全自动恒应力两用机-混凝土恒应力压力试验机-北京科达京威科技发展有限公司 | 中视电广_短视频拍摄_短视频推广_短视频代运营_宣传片拍摄_影视广告制作_中视电广 | 深圳市宏康仪器科技有限公司-模拟高空低压试验箱-高温防爆试验箱-温控短路试验箱【官网】 | 月嫂_保姆_育婴_催乳_母婴护理_产后康复_养老护理-吉祥到家家政 硫酸亚铁-聚合硫酸铁-除氟除磷剂-复合碳源-污水处理药剂厂家—长隆科技 | TYPE-C厂家|TYPE-C接口|TYPE-C防水母座|TYPE-C贴片-深圳步步精 | 进口试验机价格-进口生物材料试验机-西安卡夫曼测控技术有限公司 | 沉降天平_沉降粒度仪_液体比重仪-上海方瑞仪器有限公司 | SRRC认证_电磁兼容_EMC测试整改_FCC认证_SDOC认证-深圳市环测威检测技术有限公司 | 定制异形重型钢格栅板/钢格板_定做踏步板/排水沟盖板_钢格栅板批发厂家-河北圣墨金属制品有限公司 | 磁力去毛刺机_去毛刺磁力抛光机_磁力光饰机_磁力滚抛机_精密金属零件去毛刺机厂家-冠古科技 | 袋式过滤器,自清洗过滤器,保安过滤器,篮式过滤器,气体过滤器,全自动过滤器,反冲洗过滤器,管道过滤器,无锡驰业环保科技有限公司 | 利浦顿蒸汽发生器厂家-电蒸汽发生器/燃气蒸汽发生器_湖北利浦顿热能科技有限公司官网 | 中高频感应加热设备|高频淬火设备|超音频感应加热电源|不锈钢管光亮退火机|真空管烤消设备 - 郑州蓝硕工业炉设备有限公司 | hc22_hc22价格_hc22哈氏合金—东锜特殊钢 | AGV无人叉车_激光叉车AGV_仓储AGV小车_AGV无人搬运车-南昌IKV机器人有限公司[官网] | 集菌仪_智能集菌仪_全封闭集菌仪_无菌检查集菌仪厂家-那艾 | 多物理场仿真软件_电磁仿真软件_EDA多物理场仿真软件 - 裕兴木兰 | 北京亦庄厂房出租_经开区产业园招商信息平台 | 上海单片机培训|重庆曙海培训分支机构—CortexM3+uC/OS培训班,北京linux培训,Windows驱动开发培训|上海IC版图设计,西安linux培训,北京汽车电子EMC培训,ARM培训,MTK培训,Android培训 | 大行程影像测量仪-探针型影像测量仪-增强型影像测量仪|首丰百科 大通天成企业资质代办_承装修试电力设施许可证_增值电信业务经营许可证_无人机运营合格证_广播电视节目制作许可证 | 安徽千住锡膏_安徽阿尔法锡膏锡条_安徽唯特偶锡膏_卡夫特胶水-芜湖荣亮电子科技有限公司 | 酶联免疫分析仪-多管旋涡混合仪|混合器-莱普特科学仪器(北京)有限公司 |