refactor: rename *ID to *Id (#710)

* refactor: rename *ID to *Id

* Update src/helpers/commands/delete_slash_command.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/commands/delete_slash_command.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/commands/delete_slash_response.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/commands/edit_slash_response.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/util/utils.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/util/utils.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/util/utils.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/util/utils.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/util/utils.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/commands/get_slash_command.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/commands/send_interaction_response.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/commands/upsert_slash_command.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/guilds/edit_widget.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/guilds/get_widget.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/guilds/get_widget.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/guilds/get_widget_image_url.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/guilds/get_widget_image_url.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/guilds/get_widget_settings.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update .gitignore

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update LICENSE

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/members/edit_bot_profile.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/members/edit_bot_profile.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/webhooks/create_webhook.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/webhooks/delete_webhook.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/util/constants.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/webhooks/edit_webhook.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/webhooks/execute_webhook.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/webhooks/get_webhook.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/rest/cache.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/rest/request.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/util/constants.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/helpers/commands/delete_slash_response.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/util/constants.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/util/constants.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/util/constants.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/util/constants.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/util/utils.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Update src/util/utils.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

* Revert docs file

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>
This commit is contained in:
ayntee
2021-03-29 21:03:46 +04:00
committed by GitHub
parent 618d30b65d
commit eaff54f90f
138 changed files with 895 additions and 908 deletions
+16 -19
View File
@@ -8,23 +8,20 @@ import { sendMessage } from "../helpers/messages/send_message.ts";
import { disconnectMember } from "../helpers/mod.ts";
import { Collection } from "../util/collection.ts";
import { createNewProp } from "../util/utils.ts";
import { CleanVoiceState, Guild } from "./guild.ts";
import { Member } from "./member.ts";
import { Message } from "./message.ts";
const baseChannel: Partial<Channel> = {
get guild() {
return cache.guilds.get(this.guildID!);
return cache.guilds.get(this.guildId!);
},
get messages() {
return cache.messages.filter((m) => m.channelID === this.id!);
return cache.messages.filter((m) => m.channelId === this.id!);
},
get mention() {
return `<#${this.id!}>`;
},
get voiceStates() {
return this.guild?.voiceStates.filter((voiceState) =>
voiceState.channelID === this.id
voiceState.channelId === this.id
);
},
get connectedMembers() {
@@ -38,21 +35,21 @@ const baseChannel: Partial<Channel> = {
send(content) {
return sendMessage(this.id!, content);
},
disconnect(memberID) {
return disconnectMember(this.guildID!, memberID);
disconnect(memberId) {
return disconnectMember(this.guildId!, memberId);
},
delete() {
return deleteChannel(this.guildID!, this.id!);
return deleteChannel(this.guildId!, this.id!);
},
editOverwrite(id, options) {
return editChannelOverwrite(this.guildID!, this.id!, id, options);
return editChannelOverwrite(this.guildId!, this.id!, id, options);
},
deleteOverwrite(id) {
return deleteChannelOverwrite(this.guildID!, this.id!, id);
return deleteChannelOverwrite(this.guildId!, this.id!, id);
},
hasPermission(overwrites, permissions) {
return channelOverwriteHasPermission(
this.guildID!,
this.guildId!,
this.id!,
overwrites,
permissions,
@@ -66,14 +63,14 @@ const baseChannel: Partial<Channel> = {
// deno-lint-ignore require-await
export async function createChannelStruct(
data: ChannelCreatePayload,
guildID?: string,
guildId?: string,
) {
const {
guild_id: rawGuildID = "",
last_message_id: lastMessageID,
guild_id: rawGuildId = "",
last_message_id: lastMessageId,
user_limit: userLimit,
rate_limit_per_user: rateLimitPerUser,
parent_id: parentID = undefined,
parent_id: parentId = undefined,
last_pin_timestamp: lastPinTimestamp,
permission_overwrites: permissionOverwrites = [],
nsfw = false,
@@ -88,11 +85,11 @@ export async function createChannelStruct(
const channel = Object.create(baseChannel, {
...restProps,
guildID: createNewProp(guildID || rawGuildID),
lastMessageID: createNewProp(lastMessageID),
guildId: createNewProp(guildId || rawGuildId),
lastMessageId: createNewProp(lastMessageId),
userLimit: createNewProp(userLimit),
rateLimitPerUser: createNewProp(rateLimitPerUser),
parentID: createNewProp(parentID),
parentId: createNewProp(parentId),
lastPinTimestamp: createNewProp(
lastPinTimestamp ? Date.parse(lastPinTimestamp) : undefined,
),