You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bugfix: don't mistake any embed for a status embed
When changing the channel status, the bot will update a previous embed
if it's in the bottom 5 messages, rather than sending a new message.
However, we were detecting *any* embed from the bot, rather than only
status messages, so it would also replace playground links, for example.
This detects status embeds by comparing their titles. In order to do
that, it adds a title to the dormant embed. This isn't *necessary*; the
following code would work instead:
const isStatusEmbed = (embed: MessageEmbed) => (
embed.title === this.AVAILABLE_EMBED.title ||
embed.title === this.OCCUPIED_EMBED_BASE.title ||
embed.description === this.DORMANT_EMBED.description
);
However, this way is both cleaner code-wise, and I think it's nice for
all the status embeds to have the same format.
0 commit comments