M
M
Marikgg2020-11-24 18:10:34
Python
Marikgg, 2020-11-24 18:10:34

Why is Groovy not responding to bot messages (discord.py. )?

Groovy does not react in any way to bot messages in text chat. Let's say the bot writes "-stop", Groovy does not put a reaction on the message and does not stop the music. Groovy responds to my messages.
The bot is in voice chat, as it should be.

Here is the function code. Here the bot should enter the same voice chat as me and write "-stop" in a special text chat.

@client.event
async def on_voice_state_update(member: discord.Member, before: discord.VoiceState, after: discord.VoiceState):
    global voice_client
    if str(member).split('#')[1] == MY_ID and before.channel.id != after.channel.id:
        try:
            voice_client = await after.channel.connect()
        except discord.ClientException:
            if voice_client is not None:
                await voice_client.disconnect()
                voice_client = await after.channel.connect()
        music_channel = client.get_channel(MUSIC_TEXT_CHANNEL_ID)
        await music_channel.send('-stop')

5fbd22414448a923976935.png
The bot enters the same voice chat as me, sends a message.
What could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
Wondermarin, 2020-11-24
@Marikgg

Most likely, Groovy, when executing the on message event , checks whether the author of the message is a bot, if so, then ignores it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question