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:
parent
7e40308a8a
commit
f2cf46e734
2 changed files with 21 additions and 1 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue