ctcp wrapper function
This commit is contained in:
parent
d11a983319
commit
02d221ff4c
@ -129,6 +129,15 @@ export const applyTextFormat = (
|
||||
? str
|
||||
: `${IRC_FMT_FORMAT_MAP[format]}${str}${IRC_FMT_RESET}`;
|
||||
|
||||
/**
|
||||
* Apply CTCP control characters with a command.
|
||||
* @param message Message
|
||||
* @param command CTCP command, e.g. `ACTION`
|
||||
* @returns Text with control characters
|
||||
*/
|
||||
export const applyCTCP = (message: string, command = 'ACTION') =>
|
||||
`\x01${command.toUpperCase()} ${message}\x01`;
|
||||
|
||||
const styleCheckRe = /[\x00-\x1F]/;
|
||||
const backRe = /^(\d{1,2})(,(\d{1,2}))?/;
|
||||
const colourKey = '\x03';
|
||||
|
Loading…
Reference in New Issue
Block a user