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

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

<tfoot id='LWPlV'></tfoot>

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

      1. 有沒有辦法在我的論點中包含空格?

        Is there a way to include spaces in my argument?(有沒有辦法在我的論點中包含空格?)
          • <bdo id='6tVax'></bdo><ul id='6tVax'></ul>
          • <small id='6tVax'></small><noframes id='6tVax'>

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

                  <legend id='6tVax'><style id='6tVax'><dir id='6tVax'><q id='6tVax'></q></dir></style></legend>

                  <tfoot id='6tVax'></tfoot>
                  本文介紹了有沒有辦法在我的論點中包含空格?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  在我的 discord 機(jī)器人中,我有 2 個命令可以提供和創(chuàng)建角色.它們工作得很好,但如果角色名稱包含空格,我就有問題了.它將第二個單詞計入第二個參數(shù),使命令產(chǎn)生錯誤.

                  In my discord bot, I have 2 commands do give and create roles. They work perfectly fine, but if the role name includes a space, I have an issue. It counts the second word toward the second argument, making the command produce an error.

                  # Giverole
                  @client.command(name='giverole',
                                  aliases=['gr'],
                                  brief='Assgins role to a user',
                                  pass_ctx=True)
                  async def giverole(ctx, rname, *, member: discord.Member):
                      role = get(member.guild.roles, name=rname)
                      await member.add_roles(role)
                      await ctx.send(f'Role added to user {member.mention}')
                      print('Giverole command executed
                  - - -')
                  
                  # Createrole
                  
                  @client.command(name='createrole',
                                  brief='Creates a role',
                                  aliases=['cr','makerole'],
                                  pass_ctx=True)
                  async def createrole(ctx, rname: str, clr: discord.Colour):
                      if ctx.author.guild_permissions.manage_roles:
                          await ctx.guild.create_role(name=rname, colour=clr)
                          await ctx.send('Role created with name: ' + rname)
                          print('Createrole command executed
                  -  -  -')
                      else:
                          await ctx.send('You lack permission.')
                      print('Createrole command executed
                  -  -  -')
                  

                  理想情況下,我應(yīng)該能夠執(zhí)行 k!giverole Bot Tester @user 之類的操作,但我得到了無效用戶"錯誤.我有什么方法可以支持角色名稱中的空格嗎?提前致謝!

                  Ideally, I should be able to do something like k!giverole Bot Tester @user, but instead I get an "Invalid user" error. Is there any way for me to support spaces in the role name? Thanks in advance!

                  推薦答案

                  你有幾個選擇:

                  1. 使用角色轉(zhuǎn)換器并要求提及角色:

                  1. Use a role converter and require the role to be mentioned:

                  async def giverole(ctx, role: discord.Role, member: discord.Member):
                  

                1. 要求角色用引號括起來:

                2. Require the role to be wrapped in quotes:

                  k!giverole "Bot Tester" @user
                  

                3. 切換兩個參數(shù)的位置,以便轉(zhuǎn)換后的用戶排在第一位,并且可能有間隔的名稱作為僅關(guān)鍵字參數(shù)出現(xiàn).

                4. Switch the positions of the two arguments so that the converted user comes first, and the potentially spaced name comes as the keyword-only argument.

                  async def giverole(ctx, member: discord.Member, *, rname):
                  

                5. 我會推薦第一個選項,但您也可以嘗試其他選項,看看您更喜歡哪個.

                  I would recommend the first option, but you may want to try the others as well to see which one you prefer.

                  這篇關(guān)于有沒有辦法在我的論點中包含空格?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 中提供角色的不和諧機(jī)器人?)
                  Discord bot isn#39;t responding to commands(Discord 機(jī)器人沒有響應(yīng)命令)
                  Can you Get the quot;About mequot; feature on Discord bot#39;s? (Discord.py)(你能得到“關(guān)于我嗎?Discord 機(jī)器人的功能?(不和諧.py))
                  message.channel.id Discord PY(message.channel.id Discord PY)
                  How do I host my discord.py bot on heroku?(如何在 heroku 上托管我的 discord.py 機(jī)器人?)
                  discord.py - Automaticaly Change an Role Color(discord.py - 自動更改角色顏色)
                      <bdo id='FsdtQ'></bdo><ul id='FsdtQ'></ul>
                    • <small id='FsdtQ'></small><noframes id='FsdtQ'>

                    • <legend id='FsdtQ'><style id='FsdtQ'><dir id='FsdtQ'><q id='FsdtQ'></q></dir></style></legend>

                        <tbody id='FsdtQ'></tbody>

                        <tfoot id='FsdtQ'></tfoot>

                            <i id='FsdtQ'><tr id='FsdtQ'><dt id='FsdtQ'><q id='FsdtQ'><span id='FsdtQ'><b id='FsdtQ'><form id='FsdtQ'><ins id='FsdtQ'></ins><ul id='FsdtQ'></ul><sub id='FsdtQ'></sub></form><legend id='FsdtQ'></legend><bdo id='FsdtQ'><pre id='FsdtQ'><center id='FsdtQ'></center></pre></bdo></b><th id='FsdtQ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='FsdtQ'><tfoot id='FsdtQ'></tfoot><dl id='FsdtQ'><fieldset id='FsdtQ'></fieldset></dl></div>
                            主站蜘蛛池模板: 8x国产精品视频一区二区 | 日韩色图在线观看 | 91麻豆精品国产91久久久更新资源速度超快 | 亚洲 中文 欧美 日韩 在线观看 | 国产一区二区在线免费观看 | 中文字幕一区二区三区四区 | 亚洲精品区 | 国产毛片久久久久久久久春天 | 欧美亚洲在线 | 亚洲视频国产视频 | 午夜成人在线视频 | 男人天堂网站 | 视频在线一区二区 | 超碰97免费在线 | 91.xxx.高清在线 | a毛片| 亚洲精品www | 亚洲综合二区 | 午夜在线影院 | 精品国产一区二区国模嫣然 | 国产ts一区 | 亚洲精品丝袜日韩 | 久热免费 | 国产精品久久久久久238 | 先锋资源网 | 成人免费观看网站 | 91av免费观看 | 久久中文网 | 成人在线视频免费看 | 国产一区二区不卡 | 久久成人免费视频 | 99久久久无码国产精品 | 欧美色综合一区二区三区 | 成人日韩精品 | 黑人精品 | 亚洲人a | 超碰免费在线 | 久久久久国产一区二区三区 | 一级a毛片 | 一级黄a视频 | 久久精品一区二区三区四区 |