diff --git a/src/bot.ts b/src/bot.ts index f4c6b32a543ef400a7b5f915bfa05f893ebe785f..deed4d7e4a38bd2d9b5a68eb405405d8e67935b9 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -267,7 +267,7 @@ export class DiscordBot { msg = await hook.send(embed.description, { username: embed.author.name, avatarURL: embed.author.icon_url, - file: opts.file, + files: opts.file ? [opts.file] : undefined, embeds: embedSet.replyEmbed ? [embedSet.replyEmbed] : undefined, } as any); } else { diff --git a/src/matrixeventprocessor.ts b/src/matrixeventprocessor.ts index 5ffd4ca5aecf113a75b69279a55964b8d940fc20..93db39566c3f7a91b6f5039cd1c9fa65fb61330a 100644 --- a/src/matrixeventprocessor.ts +++ b/src/matrixeventprocessor.ts @@ -239,6 +239,7 @@ export class MatrixEventProcessor { sourceEvent.sender, ); } catch (ex) { + log.warn("Failed to handle reply, showing a unknown embed:", ex); // For some reason we failed to get the event, so using fallback. embed.setDescription("Reply with unknown content"); embed.setAuthor("Unknown"); @@ -254,7 +255,7 @@ export class MatrixEventProcessor { // Are they a discord user. if (this.bridge.getBot().isRemoteUser(sender)) { const localpart = new MatrixUser(sender.replace("@", "")).localpart; - const userOrMember = await this.discord.GetDiscordUserOrMember(localpart.substring("_discord_".length)); + const userOrMember = await this.discord.GetDiscordUserOrMember(localpart.substring("_discord".length)); if (userOrMember instanceof Discord.User) { embed.setAuthor( userOrMember.username,