diff --git a/src/d2m/converters/message-to-event.js b/src/d2m/converters/message-to-event.js index 93e120e..9a975d2 100644 --- a/src/d2m/converters/message-to-event.js +++ b/src/d2m/converters/message-to-event.js @@ -531,6 +531,16 @@ async function messageToEvent(message, guild, options = {}, di) { message.content = "changed the channel name to **" + message.content + "**" } + // Handle message type 63, new emoji announcement + // @ts-expect-error - should be changed to a DiscordTypes reference once it has been documented + if (message.type === 63) { + const match = message.content.match(/^<(a?):([^:>]{1,64}):([0-9]+)>$/) + assert(match, `message type 63, which announces a new emoji, did not include an emoji. the actual content was: "${message.content}"`) + const name = match[2] + msgtype = "m.emote" + message.content = `added a new emoji, ${message.content} :${name}:` + } + // Forwarded content appears first if (message.message_reference?.type === DiscordTypes.MessageReferenceType.Forward && message.message_snapshots?.length) { // Forwarded notice diff --git a/src/matrix/matrix-command-handler.js b/src/matrix/matrix-command-handler.js index 93bc312..f712ece 100644 --- a/src/matrix/matrix-command-handler.js +++ b/src/matrix/matrix-command-handler.js @@ -177,7 +177,7 @@ const commands = [{ .addLine(`Ⓜ️ *If you were a Discord user, you wouldn't have permission to create emojis. ${matrixOnlyConclusion}`, `Ⓜ️ If you were a Discord user, you wouldn't have permission to create emojis. ${matrixOnlyConclusion}`, matrixOnlyReason === "CAPACITY") .addLine("[Preview not available in plain text.]", "Preview:") for (const e of toUpload) { - b.add("", `:${e.name}:`) + b.add("", `:${e.name}: :${e.name}:`) } b.addLine("Hit ✅ to add it.") const sent = await api.sendEvent(event.room_id, "m.room.message", {