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
@@ -10,10 +10,10 @@ import { requireBotGuildPermissions } from "../../util/permissions.ts";
* @param description description for the template (0-120 characters
*/
export async function createGuildTemplate(
guildID: string,
guildId: string,
data: CreateGuildTemplate,
) {
await requireBotGuildPermissions(guildID, ["MANAGE_GUILD"]);
await requireBotGuildPermissions(guildId, ["MANAGE_GUILD"]);
if (data.name.length < 1 || data.name.length > 100) {
throw new Error("The name can only be in between 1-100 characters.");
@@ -24,7 +24,7 @@ export async function createGuildTemplate(
}
const template = (await RequestManager.post(
endpoints.GUILD_TEMPLATES(guildID),
endpoints.GUILD_TEMPLATES(guildId),
data,
)) as GuildTemplate;
@@ -8,13 +8,13 @@ import { requireBotGuildPermissions } from "../../util/permissions.ts";
* Requires the `MANAGE_GUILD` permission.
*/
export async function deleteGuildTemplate(
guildID: string,
guildId: string,
templateCode: string,
) {
await requireBotGuildPermissions(guildID, ["MANAGE_GUILD"]);
await requireBotGuildPermissions(guildId, ["MANAGE_GUILD"]);
const deletedTemplate = (await RequestManager.delete(
`${endpoints.GUILD_TEMPLATES(guildID)}/${templateCode}`,
`${endpoints.GUILD_TEMPLATES(guildId)}/${templateCode}`,
)) as GuildTemplate;
return structures.createTemplateStruct(deletedTemplate);
+3 -3
View File
@@ -8,11 +8,11 @@ import { requireBotGuildPermissions } from "../../util/permissions.ts";
* Requires the `MANAGE_GUILD` permission.
*/
export async function editGuildTemplate(
guildID: string,
guildId: string,
templateCode: string,
data: EditGuildTemplate,
) {
await requireBotGuildPermissions(guildID, ["MANAGE_GUILD"]);
await requireBotGuildPermissions(guildId, ["MANAGE_GUILD"]);
if (data.name?.length && (data.name.length < 1 || data.name.length > 100)) {
throw new Error("The name can only be in between 1-100 characters.");
@@ -23,7 +23,7 @@ export async function editGuildTemplate(
}
const template = (await RequestManager.patch(
`${endpoints.GUILD_TEMPLATES(guildID)}/${templateCode}`,
`${endpoints.GUILD_TEMPLATES(guildId)}/${templateCode}`,
data,
)) as GuildTemplate;
+3 -3
View File
@@ -7,11 +7,11 @@ import { requireBotGuildPermissions } from "../../util/permissions.ts";
* Returns an array of templates.
* Requires the `MANAGE_GUILD` permission.
*/
export async function getGuildTemplates(guildID: string) {
await requireBotGuildPermissions(guildID, ["MANAGE_GUILD"]);
export async function getGuildTemplates(guildId: string) {
await requireBotGuildPermissions(guildId, ["MANAGE_GUILD"]);
const templates = (await RequestManager.get(
endpoints.GUILD_TEMPLATES(guildID),
endpoints.GUILD_TEMPLATES(guildId),
)) as GuildTemplate[];
return templates.map((template) => structures.createTemplateStruct(template));
+3 -3
View File
@@ -7,11 +7,11 @@ import { requireBotGuildPermissions } from "../../util/permissions.ts";
* Syncs the template to the guild's current state.
* Requires the `MANAGE_GUILD` permission.
*/
export async function syncGuildTemplate(guildID: string, templateCode: string) {
await requireBotGuildPermissions(guildID, ["MANAGE_GUILD"]);
export async function syncGuildTemplate(guildId: string, templateCode: string) {
await requireBotGuildPermissions(guildId, ["MANAGE_GUILD"]);
const template = (await RequestManager.put(
`${endpoints.GUILD_TEMPLATES(guildID)}/${templateCode}`,
`${endpoints.GUILD_TEMPLATES(guildId)}/${templateCode}`,
)) as GuildTemplate;
return structures.createTemplateStruct(template);