3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 12:25:02 +00:00

Add tAllowedMentions

Mirrors AllowedMentions type from Eris
This commit is contained in:
Dragory 2021-04-29 00:48:37 +03:00
parent 7e40308a8a
commit f2cf46e734
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
2 changed files with 21 additions and 1 deletions

View file

@ -282,6 +282,16 @@ export const tStrictMessageContent = t.type({
export const tMessageContent = t.union([t.string, tStrictMessageContent]);
/**
* Mirrors AllowedMentions from Eris
*/
export const tAllowedMentions = t.type({
everyone: tNormalizedNullOptional(t.boolean),
users: tNormalizedNullOptional(t.union([t.boolean, t.array(t.string)])),
roles: tNormalizedNullOptional(t.union([t.boolean, t.array(t.string)])),
repliedUser: tNormalizedNullOptional(t.boolean),
});
export function dropPropertiesByName(obj, propName) {
if (obj.hasOwnProperty(propName)) delete obj[propName];
for (const value of Object.values(obj)) {