Ephemeral messages always True on Pycord?

86 views Asked by At

This is related to a Discord bot using Pycord 2.4.1 on Python 3.9. Starting these days, it started to respond to button interactions with ephemeral messages, but it is not supposed to. Default behavior is 'ephemeral=False', and I even tried to explicitly declare that on code. It was working just fine for long, and no changes were made on my side, it just started to behave like that. Does anyone have any idea why is that?

Sample code:

 @discord.ui.button(label='Accept', emoji='', style=discord.ButtonStyle.primary, custom_id='Accept')
    async def accept_callback(self, button, inter):
        async with lock:
            srv = srv_switch(inter)
            loc = 'en' if inter.guild.preferred_locale.lower() != 'pt-br' else 'br'
            king = self.bot.get_guild(inter.guild.id).get_role(classes[srv]['contests'].get_king_role_id())
            chal = self.bot.get_guild(inter.guild.id).get_role(classes[srv]['contests'].get_chal_role_id())
            if king in inter.user.roles:
                if chal.members:
                    await inter.response.send_message(strings.text_chal_accept[loc].format(chal.members[0].mention),
                                                      view=Victory(self.bot))
                else:
                    await inter.response.send_message(strings.text_chal_issue[loc])
            else:
                await inter.response.send_message(strings.text_aint_king[loc].format(inter.user.display_name))
                pass

After clicking the "Accept" button, the response comes as ephemeral.

I tried explicitly declaring "ephemeral=False" on send_message function, to no avail.

1

There are 1 answers

3
Lico On

It took a while, but it started to work as it should without any changes on my side. I don't know why, but it seems to be solved.