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

    1. <legend id='TaJA5'><style id='TaJA5'><dir id='TaJA5'><q id='TaJA5'></q></dir></style></legend>
      <tfoot id='TaJA5'></tfoot>
        • <bdo id='TaJA5'></bdo><ul id='TaJA5'></ul>

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

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

        如何使用 discord.py 事件處理程序 on_voice_state_upd

        How to use discord.py event handler on_voice_state_update to run only when a user joins a voice channel(如何使用 discord.py 事件處理程序 on_voice_state_update 僅在用戶加入語音頻道時運行) - IT屋-程序員軟件開發(fā)技術(shù)
        <i id='rd1n8'><tr id='rd1n8'><dt id='rd1n8'><q id='rd1n8'><span id='rd1n8'><b id='rd1n8'><form id='rd1n8'><ins id='rd1n8'></ins><ul id='rd1n8'></ul><sub id='rd1n8'></sub></form><legend id='rd1n8'></legend><bdo id='rd1n8'><pre id='rd1n8'><center id='rd1n8'></center></pre></bdo></b><th id='rd1n8'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='rd1n8'><tfoot id='rd1n8'></tfoot><dl id='rd1n8'><fieldset id='rd1n8'></fieldset></dl></div>

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

                <tbody id='rd1n8'></tbody>
                  <bdo id='rd1n8'></bdo><ul id='rd1n8'></ul>

                  <legend id='rd1n8'><style id='rd1n8'><dir id='rd1n8'><q id='rd1n8'></q></dir></style></legend>
                • <tfoot id='rd1n8'></tfoot>
                  本文介紹了如何使用 discord.py 事件處理程序 on_voice_state_update 僅在用戶加入語音頻道時運行的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我正在嘗試學(xué)習(xí)如何通過 discord.py 制作一個不和諧的機(jī)器人,并希望添加一個功能,即每當(dāng)另一個用戶加入機(jī)器人的語音頻道時,都會從機(jī)器人發(fā)送消息目前在.我不知道如何使用事件處理程序本身,也沒有充分了解他們的文檔來使用它.

                  I am trying to learn how to make a discord bot through discord.py and wanted to add a feature where a message would be sent from the bot whenever another user joined the voice channel that the bot is currently in. I do not know how to use the event handler itself and didn't understand their documentation enough to utilize it.

                  from discord.ext.commands import Bot 
                  client = Bot(command_prefix="!")
                  
                  @client.event
                  async def on_voice_state_update(before, after):
                      await client.say("Howdy")
                  

                  根據(jù)我對文檔的有限理解,只要用戶靜音、耳聾、離開或加入頻道,就應(yīng)該使用事件處理程序.

                  From my limited understanding of the documentation, the event handler should be used whenever a user is muted, deafened, leaves, or joins a channel.

                  但是,即使我試圖讓它識別這些操作,它也會給我一個錯誤消息:

                  However, even when I tried to get it to recognize those actions it gave me an error message of:

                  Ignoring exception in on_voice_state_update
                  Traceback (most recent call last):
                    File "C:UsersSamPycharmProjectsFunBotProjectvenvlibsite-packagesdiscordclient.py", line 307, in _run_event
                      yield from getattr(self, event)(*args, **kwargs)
                    File "C:/Users/Sam/PycharmProjects/FunBotProject/my_bot2.py", line 63, in on_voice_state_update
                      await client.say("Xd ")
                    File "C:UsersSamPycharmProjectsFunBotProjectvenvlibsite-packagesdiscordextcommandsot.py", line 309, in _augmented_msg
                      msg = yield from coro
                    File "C:UsersSamPycharmProjectsFunBotProjectvenvlibsite-packagesdiscordclient.py", line 1145, in send_message
                      channel_id, guild_id = yield from self._resolve_destination(destination)
                    File "C:UsersSamPycharmProjectsFunBotProjectvenvlibsite-packagesdiscordclient.py", line 289, in _resolve_destination
                      raise InvalidArgument(fmt.format(destination))
                  discord.errors.InvalidArgument: Destination must be Channel, PrivateChannel, User, or Object. Received NoneType
                  

                  推薦答案

                  2020 年版本.請注意,我的代碼在發(fā)送的消息方面表現(xiàn)不同.

                  A version working in 2020. Please not that my code behaves different in terms of the sent message.

                  from discord.ext.commands import Bot 
                  bot = commands.Bot(command_prefix='!')
                  
                  @bot.event
                  async def on_voice_state_update(member, before, after):
                      if before.channel is None and after.channel is not None:
                          if after.channel.id == [YOUR_CHANNEL_ID]:
                              await member.guild.system_channel.send("Alarm!")
                  

                  這篇關(guān)于如何使用 discord.py 事件處理程序 on_voice_state_update 僅在用戶加入語音頻道時運行的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 - 自動更改角色顏色)

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

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

                            <bdo id='mImEA'></bdo><ul id='mImEA'></ul>
                          • <tfoot id='mImEA'></tfoot>

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

                          • 主站蜘蛛池模板: 欧美二区在线 | 欧美αv | 国产乱码高清区二区三区在线 | 亚洲精品免费看 | 欧美男人天堂 | 久久亚洲一区二区 | 久久只有精品 | 中文字幕在线精品 | 久久综合九九 | 91一区二区在线观看 | 懂色中文一区二区在线播放 | 看片国产| 成人av在线播放 | 亚洲综合久久久 | 国产精品1区 | 在线第一页 | 碰碰视频| 日批免费在线观看 | 国产综合精品一区二区三区 | 欧美高清一区 | 97超碰人人| 成人性视频在线 | 久久亚洲91| 一区二区高清 | 亚洲精品久久久久久首妖 | 久久久久国产精品 | 日本精品一区二区 | 日本不卡一区二区三区在线观看 | 国产黄色av电影 | 成人激情视频在线播放 | 欧美在线成人影院 | 成人av激情 | 久久美国| 国产精品免费一区二区三区四区 | 久久99精品国产自在现线小黄鸭 | 日本精品久久久一区二区三区 | 在线观看免费国产 | 精品久久久久久久久久久久久久 | 欧美日韩专区 | 色久电影| 亚洲精品亚洲人成人网 |