Skip to content

Commit

Permalink
fix: Issue with message.content being undefined.
Browse files Browse the repository at this point in the history
  • Loading branch information
vxern committed Jul 6, 2024
1 parent 5f1a97f commit bb1cc29
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions source/library/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ class DiscordConnection {
#transformMessage(_: Discord.Bot, payload: Parameters<Discord.Transformers["message"]>[1]): Discord.Message {
const result = Discord.transformMessage(this.bot, payload);

// REMINDER(vxern): Remove this at some point.
if (result.content === undefined) {
result.content = "";
}

const previousMessage = this.cache.messages.latest.get(result.id);
if (previousMessage !== undefined) {
this.cache.messages.previous.set(result.id, previousMessage);
Expand Down

0 comments on commit bb1cc29

Please sign in to comment.