Skip to content

Commit

Permalink
fix(commons): fix incorrect object to get discord attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
sogehige committed Nov 9, 2021
1 parent bfe965a commit 070a567
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/commons.ts
Expand Up @@ -16,7 +16,7 @@ class Commons {
@timer()
async messageToSend(senderObject: any, response: string | Promise<string>, opts: ParserOptions | { isParserOptions?: boolean, id: string, discord: CommandOptions['discord']; sender: CommandOptions['sender']; attr?: CommandOptions['attr'] }): Promise<string> {
const sender = opts.discord
? { ...senderObject, discord: { author: senderObject.discord.author, channel: senderObject.discord.channel } } : senderObject;
? { ...senderObject, discord: { author: opts.discord.author, channel: opts.discord.channel } } : senderObject;
if (isParserOpts(opts) ? opts.skip : opts.attr?.skip) {
return prepare(await response as string, { ...opts, sender, forceWithoutAt: typeof opts.discord !== 'undefined' }, false);
} else {
Expand Down

0 comments on commit 070a567

Please sign in to comment.