Skip to content

Commit

Permalink
fix: Added missing data WPP.status.sendTextStatus
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Jun 26, 2022
1 parent c69389c commit 521c6f2
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/status/functions/sendTextStatus.ts
Expand Up @@ -44,8 +44,9 @@ export async function sendTextStatus(
...options,
};

let backgroundColor: number | undefined;
let textColor: number | undefined;
let backgroundColor = assertColor('#000000');
let textColor = assertColor('#FFFFFF');
let font = 0;

if (['number', 'string'].includes(typeof options.backgroundColor)) {
backgroundColor = assertColor(options.backgroundColor);
Expand All @@ -54,14 +55,17 @@ export async function sendTextStatus(
textColor = assertColor(options.textColor);
}

if (options.font && options.font >= 0 && options.font <= 5) {
font = options.font;
}

const message: Chat.RawMessage = {
body: content,
type: 'chat',
subtype: null,
urlText: null,
urlNumber: null,
ctwaContext: {}, //Force to send font and color
font: options.font,
richPreviewType: 0,
inviteGrpType: 0,
font,
backgroundColor,
textColor,
};
Expand Down

0 comments on commit 521c6f2

Please sign in to comment.