rtbyte icon indicating copy to clipboard operation
rtbyte copied to clipboard

Formatting of 'topic changed' for the channelUpdate event log is inconsistent

Open noragerdin opened this issue 4 years ago • 0 comments

Describe the bug The formatting of the 'topic changed' entry for the channelUpdate event log is inconsistent depending on what the topic is set to. When no topic exists and one is set, or when you unset the topic, it's formatted as if the string length exceeds 64 characters despite there effectively being 0 characters.

To Reproduce Steps to reproduce the behavior:

  1. Set or unset the topic for a channel while having the channelUpdate event log enabled for the guild.

Expected behavior If either the old or new topic string length exceeds 64 characters, the entry should be formatted for long strings (i.e. the Events.Guilds.Logs.ChangeLongText language string). If both the old or new topic string lengths are under 64 characters (including if they are unset, meaning 0 characters), the entry should be formatted for short strings (i.e. the Events.Guilds.Logs.ChangeShortText language string).

Screenshots Long string formatting applied correctly. image

Short string formatting applied correctly. image

Long string formatting incorrectly applied when topic length is 0 characters long. image

Additional context Relevant code snippet. https://github.com/RTByte/rtbyte/blob/3249f09ee160e069adbd036f104f3a6cab0ddda2/src/listeners/guilds/channels/channelUpdateLog.ts#L69-L78

noragerdin avatar Oct 13 '21 10:10 noragerdin