diff --git a/src/handlers/channel.ts b/src/handlers/channel.ts index 92b751d4f..25b60122c 100644 --- a/src/handlers/channel.ts +++ b/src/handlers/channel.ts @@ -211,10 +211,12 @@ export async function sendMessage( allowed_mentions: content.mentions ? { ...content.mentions, - replied_user: content.mentions.repliedUser === true, + replied_user: content.mentions.repliedUser !== false, } : undefined, - message_reference: content.replyMessageID, + message_reference: { + message_id: content.replyMessageID, + } }, ); diff --git a/src/module/requestManager.ts b/src/module/requestManager.ts index 1e9d6d7dc..80a53fb54 100644 --- a/src/module/requestManager.ts +++ b/src/module/requestManager.ts @@ -321,29 +321,36 @@ function handleStatusCode(response: Response, errorStack?: unknown) { switch (status) { case HttpResponseCode.BadRequest: - throw new Error( + console.error( "The request was improperly formatted, or the server couldn't understand it.", ); + throw errorStack; case HttpResponseCode.Unauthorized: - throw new Error("The Authorization header was missing or invalid."); + console.error("The Authorization header was missing or invalid."); + throw errorStack; case HttpResponseCode.Forbidden: - throw new Error( + console.error( "The Authorization token you passed did not have permission to the resource.", ); + throw errorStack; case HttpResponseCode.NotFound: - throw new Error("The resource at the location specified doesn't exist."); + console.error("The resource at the location specified doesn't exist."); + throw errorStack; case HttpResponseCode.MethodNotAllowed: - throw new Error( + console.error( "The HTTP method used is not valid for the location specified.", ); + throw errorStack; case HttpResponseCode.GatewayUnavailable: - throw new Error( + console.error( "There was not a gateway available to process your request. Wait a bit and retry.", ); + throw errorStack; + // left are all unknown + default: + console.error(Errors.REQUEST_UNKNOWN_ERROR); + throw errorStack; } - - // left are all unknown - throw new Error(Errors.REQUEST_UNKNOWN_ERROR); } function processHeaders(url: string, headers: Headers) { diff --git a/src/types/channel.ts b/src/types/channel.ts index a58f1d381..e3881bb8a 100644 --- a/src/types/channel.ts +++ b/src/types/channel.ts @@ -101,7 +101,7 @@ export interface MessageContent { roles?: string[]; /** Array of user_ids to mention (Max size of 100) */ users?: string[]; - /** Should the message author from the original message be mention. By default this is false. */ + /** Should the message author from the original message be mention. By default this is true. */ repliedUser?: boolean; }; /** The message contents, up to 2000 characters */