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>
This commit is contained in:
ITOH
2021-03-08 17:37:06 +01:00
committed by GitHub
parent 45a3246370
commit 2c3692810d
23 changed files with 111 additions and 106 deletions
+9 -3
View File
@@ -107,7 +107,10 @@ const baseGuild: Partial<Guild> = {
},
};
export async function createGuild(data: CreateGuildPayload, shardID: number) {
export async function createGuildStruct(
data: CreateGuildPayload,
shardID: number,
) {
const {
disovery_splash: discoverySplash,
default_message_notifications: defaultMessageNotifications,
@@ -143,11 +146,14 @@ export async function createGuild(data: CreateGuildPayload, shardID: number) {
} = data;
const roles = await Promise.all(
data.roles.map((role) => structures.createRole(role)),
data.roles.map((role) => structures.createRoleStruct(role)),
);
await Promise.all(channels.map(async (channel) => {
const channelStruct = await structures.createChannel(channel, rest.id);
const channelStruct = await structures.createChannelStruct(
channel,
rest.id,
);
return cacheHandlers.set("channels", channelStruct.id, channelStruct);
}));