added help cmd, and helper function to misc
This commit is contained in:
parent
a530b4ae8e
commit
102c3f097b
2 changed files with 37 additions and 4 deletions
|
@ -20,6 +20,8 @@ const optionalReplace = (token) => {
|
|||
return token === undefined || token === "" ? "" : (token === "true" || token === "false" ? token : "<redacted>");
|
||||
};
|
||||
|
||||
|
||||
|
||||
// clean(text) to clean message of any private info or mentions
|
||||
export function clean(text) {
|
||||
if (typeof text !== "string")
|
||||
|
@ -63,6 +65,17 @@ export async function activityChanger(bot) {
|
|||
setTimeout(() => activityChanger(bot), 900000);
|
||||
}
|
||||
|
||||
export function htmlescape (s) {
|
||||
let lookup = {
|
||||
'&': "&",
|
||||
'"': """,
|
||||
'\'': "'",
|
||||
'<': "<",
|
||||
'>': ">"
|
||||
};
|
||||
return s.replace( /[&"'<>]/g, c => lookup[c] );
|
||||
}
|
||||
|
||||
export async function checkBroadcast(bot) {
|
||||
if (!db) {
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue