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

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

    2. <small id='3H9rL'></small><noframes id='3H9rL'>

        <bdo id='3H9rL'></bdo><ul id='3H9rL'></ul>

      Discord.py-Rewrite 獲取列入黑名單的術(shù)語列表并檢查

      Discord.py-Rewrite Taking a list of blacklisted terms and checks if arguments after command contains one of the blacklisted terms(Discord.py-Rewrite 獲取列入黑名單的術(shù)語列表并檢查命令后的參數(shù)是否包含列入黑名單的術(shù)

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

      <tfoot id='WUe68'></tfoot>

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

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

              • <bdo id='WUe68'></bdo><ul id='WUe68'></ul>
                本文介紹了Discord.py-Rewrite 獲取列入黑名單的術(shù)語列表并檢查命令后的參數(shù)是否包含列入黑名單的術(shù)語之一的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我正在開發(fā)一個類似于Discord Delivers"的不和諧機器人;和比薩餅".我正在嘗試獲取術(shù)語/關(guān)鍵字列表并檢查命令后的參數(shù)(命令的代碼在這篇文章的末尾);因此,如果他們執(zhí)行 >order BadWord 則它會檢查它是否包含先前指定的列入黑名單的術(shù)語之一,如果是,則像 await ctx.send("Due to your order contains被列入黑名單的條款之一,您的訂單將不會被放置.") 或類似的東西.我很抱歉沒有說出我所嘗試的,正如我所能想到的那樣,正在做諸如 if args in blacklist: 之類的事情,或者為每個單詞做類似的事情.

                I am working on a discord bot similar to "Discord Delivers" and "Pizza Byte". And I am trying to take a list of terms/keywords and check if the arguments after the command (The code for the command is at the end of this post); So if they do >order BadWord then it checks if it contains one of the previously specified blacklisted terms, and if so, does like await ctx.send("Due to your order containing one of the blacklisted terms, your order will not be placed.") Or something like that. I am sorry for not saying what i have tried, as all i can think of, is doing things like if args in blacklist: or something like that for each word.

                @bot.command(pass_context=True)
                async def order(ctx, *, orderItem):
                    channel = bot.get_channel(CHANNEL ID OF THE CHANNEL)
                    link = await ctx.channel.create_invite(max_age = 300)
                    global baseNumberID
                    baseNumberID += 1
                    global orderIDdf
                    global df
                    df[str(baseNumberID)] = ctx.author.name
                    embed=discord.Embed(title="New order", color=0xfc57ff)
                    embed.add_field(name="Who and Where", value="{} in {} in the {} channel".format(ctx.message.author, ctx.message.guild.name, ctx.message.channel.mention), inline=False)
                    embed.add_field(name="What", value="{}".format(orderItem), inline=False)
                    embed.add_field(name="Invite", value="{}".format(link), inline=False)
                    embed.add_field(name="Order ID", value="Order ID is {}".format(baseNumberID), inline=False)
                    embed.add_field(name="Time", value="{} GM time".format(strftime("%Y-%m-%d %H:%M:%S", gmtime())), inline=True)
                    embed.set_footer(text="End of this Order")
                    #Second embed that will be used later.
                    deliverIDInfo = str(baseNumberID)
                    deliverInfoEmbed=discord.Embed(title="Order Info")
                    deliverInfoEmbed.add_field(name="Who and Where", value="{} in {} in the {} channel".format(ctx.message.author, ctx.message.guild.name, ctx.message.channel.mention), inline=False)
                    deliverInfoEmbed.add_field(name="What", value="{}".format(orderItem), inline=False)
                    deliverInfoEmbed.add_field(name="Invite", value="{}".format(link), inline=False)
                    deliverInfoEmbed.add_field(name="Order ID", value="Order ID is {}".format(baseNumberID), inline=False)
                    deliverInfoEmbed.add_field(name="Time", value="{} GMT time".format(strftime("%Y-%m-%d %H:%M:%S", gmtime())), inline=True)
                    deliverInfoEmbed.set_footer(text="End of this Order")
                    orderIDdf[deliverIDInfo] = deliverInfoEmbed
                    await ctx.author.send("Your order has been placed!")
                    await ctx.author.send(embed=embed)
                    await channel.send(embed=embed)
                

                額外

                如果可能的話,列入黑名單的術(shù)語可以是 json 文件還是文本文件?謝謝.

                EXTRA

                And if possible, could the blacklisted terms be in like either a json file or a text file? Thanks.

                我想我應該澄清一下,我確實定義了所使用的變量.一切正常.

                I thought i should clarify that I do in fact define the variables that are used. Everything works properly.

                推薦答案

                • 沒有 json 庫:
                • blacklist = ['test', 'yolo'] #Your blacklisted words here
                  @bot.command(pass_context=True)
                  async def order(ctx, *, orderItem):
                      if orderItem.lower() in blacklist:
                          await ctx.send("Due to your order containing one of the blacklisted terms, your order will not be placed.")
                      else:
                          #Your code here
                  

                  • 使用 json 庫:
                  • json 文件(將包含所有列入黑名單的單詞)

                    The json file (which will contain every blacklisted words)

                    ['test', 'yolo']
                    

                    from json import loads
                    
                    @bot.command(pass_context=True)
                    async def order(ctx, *, orderItem):
                        with open('blacklist.txt', 'r') as file:
                            blacklist = loads(file.read())
                        if orderItem.lower() in blacklist:
                            await ctx.send("Due to your order containing one of the blacklisted terms, your order will not be placed.")
                        else:
                            #Your code here
                    

                    這篇關(guān)于Discord.py-Rewrite 獲取列入黑名單的術(shù)語列表并檢查命令后的參數(shù)是否包含列入黑名單的術(shù)語之一的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                相關(guā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)(你能得到“關(guān)于我嗎?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='3avxR'><style id='3avxR'><dir id='3avxR'><q id='3avxR'></q></dir></style></legend>
                  • <bdo id='3avxR'></bdo><ul id='3avxR'></ul>

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

                          <small id='3avxR'></small><noframes id='3avxR'>

                          主站蜘蛛池模板: 日韩成人免费视频 | 精品国产欧美一区二区三区成人 | 91 在线| 久久这里有精品 | 国产精品亚洲视频 | 国产一级片在线观看视频 | 亚洲视频二| 久久精品久久久 | 欧美亚洲国产日韩 | www久久99 | 久草免费在线视频 | 成人久久久| 久久99精品久久久久久 | 亚洲喷水| 中文字幕一区在线观看视频 | 国产 日韩 欧美 在线 | 成人性生交大片免费看r链接 | 欧美在线一区二区三区 | 日本不卡一区二区三区在线观看 | 九九久久这里只有精品 | 中文在线一区二区 | 国产香蕉视频 | 青青草免费在线视频 | 91免费观看 | 一级a爱片久久毛片 | 精品久久99| 成人在线国产 | 真人女人一级毛片免费播放 | 一区二区三区精品在线视频 | 中文字幕国产高清 | 国产精品国产a级 | 在线视频 亚洲 | 亚洲成人高清 | 99视频在线看 | 成人黄视频在线观看 | 国产成人免费视频网站高清观看视频 | 羞羞午夜 | 久久久久久中文字幕 | 国产成人99久久亚洲综合精品 | 在线观看精品视频网站 | 中文在线a在线 |