Files
discordeno/src/api/structures/mod.ts
T
ITOH 2c3692810d refactor(structures): rename create* functions (#395)
* structures: rename structure create functions

* fix: errors occured because of structure rename

* fix(controllers): errors occured because of structure rename

* fix

* fix createServer to createGuild rename

* rename create*structure to create*Struct

* update docs

* Phew

* rename createguildrole

* fix that

* fmt?

* idk

* why

* fixxess

* Update member.ts

* Update member.ts

* ahh found it

* revert this

* Update mod.ts

Co-authored-by: ayntee <ayyantee@gmail.com>
2021-03-08 20:37:06 +04:00

33 lines
1.1 KiB
TypeScript

import { Channel, createChannelStruct } from "./channel.ts";
import { createGuildStruct, Guild } from "./guild.ts";
import { createMemberStruct, Member } from "./member.ts";
import { createMessageStruct, Message } from "./message.ts";
import { createRoleStruct, Role } from "./role.ts";
import { createTemplateStruct, Template } from "./template.ts";
/** This is the placeholder where the structure creation functions are kept. */
export let structures = {
createChannelStruct,
createGuildStruct,
createMemberStruct,
createMessageStruct,
createRoleStruct,
createTemplateStruct,
};
export type { Channel, Guild, Member, Message, Role, Template };
export type Structures = typeof structures;
/** This function is used to update/reload/customize the internal structures of Discordeno.
*
* ⚠️ **ADVANCED USE ONLY: If you customize this incorrectly, you could potentially create many new errors/bugs.
* Please take caution when using this.**
*/
export function updateStructures(newStructures: Structures) {
structures = {
...structures,
...newStructures,
};
}