mirror of
https://github.com/danbulant/discord.js
synced 2026-06-19 22:51:32 +00:00
documentation v13
This commit is contained in:
parent
75b01e0a4a
commit
36435934c7
4 changed files with 19 additions and 3 deletions
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"GEN_VERSION": 12,
|
||||
"GEN_VERSION": 13,
|
||||
"COMPRESS": false
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
const DocumentedItem = require('./DocumentedItem');
|
||||
const DocumentedItemMeta = require('./DocumentedItemMeta');
|
||||
const DocumentedVarType = require('./DocumentedVarType');
|
||||
const DocumentedParam = require('./DocumentedParam');
|
||||
|
||||
/*
|
||||
{ id: 'StringResolvable',
|
||||
|
|
@ -19,17 +20,26 @@ const DocumentedVarType = require('./DocumentedVarType');
|
|||
|
||||
class DocumentedTypeDef extends DocumentedItem {
|
||||
|
||||
constructor(...args) {
|
||||
super(...args);
|
||||
}
|
||||
|
||||
registerMetaInfo(data) {
|
||||
super.registerMetaInfo(data);
|
||||
this.props = new Map();
|
||||
this.directData = data;
|
||||
this.directData.meta = new DocumentedItemMeta(this, data.meta);
|
||||
this.directData.type = new DocumentedVarType(this, data.type);
|
||||
data.properties = data.properties || [];
|
||||
for (const prop of data.properties) {
|
||||
this.props.set(prop.name, new DocumentedParam(this, prop));
|
||||
}
|
||||
}
|
||||
|
||||
serialize() {
|
||||
super.serialize();
|
||||
const { id, name, description, type, access, meta } = this.directData;
|
||||
return {
|
||||
const serialized = {
|
||||
id,
|
||||
name,
|
||||
description,
|
||||
|
|
@ -37,6 +47,8 @@ class DocumentedTypeDef extends DocumentedItem {
|
|||
access,
|
||||
meta: meta.serialize(),
|
||||
};
|
||||
serialized.properties = Array.from(this.props.values()).map(p => p.serialize());
|
||||
return serialized;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,10 @@ client.on('guildMemberAdd', (g, m) => {
|
|||
console.log(`${m.user.username} joined ${g.name}`);
|
||||
})
|
||||
|
||||
client.on('guildMemberUpdate', (g, o, n) => {
|
||||
console.log(o.nickname, n.nickname);
|
||||
});
|
||||
|
||||
client.on('debug', console.log);
|
||||
|
||||
client.on('message', message => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue