mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
refactor(handlers/guild): rename guild widget functions (#386)
* Update guild.ts * Update guild.ts * this should be named getWidgetSettings * update mod imports
This commit is contained in:
@@ -694,8 +694,8 @@ export async function getAuditLogs(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns the guild embed object. Requires the MANAGE_GUILD permission. */
|
/** Returns the guild widget object. Requires the MANAGE_GUILD permission. */
|
||||||
export async function getEmbed(guildID: string) {
|
export async function getWidgetSettings(guildID: string) {
|
||||||
const hasPerm = await botHasPermission(guildID, ["MANAGE_GUILD"]);
|
const hasPerm = await botHasPermission(guildID, ["MANAGE_GUILD"]);
|
||||||
if (!hasPerm) {
|
if (!hasPerm) {
|
||||||
throw new Error(Errors.MISSING_MANAGE_GUILD);
|
throw new Error(Errors.MISSING_MANAGE_GUILD);
|
||||||
@@ -706,8 +706,8 @@ export async function getEmbed(guildID: string) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Modify a guild embed object for the guild. Requires the MANAGE_GUILD permission. */
|
/** Modify a guild widget object for the guild. Requires the MANAGE_GUILD permission. */
|
||||||
export async function editEmbed(
|
export async function editWidget(
|
||||||
guildID: string,
|
guildID: string,
|
||||||
enabled: boolean,
|
enabled: boolean,
|
||||||
channelID?: string | null,
|
channelID?: string | null,
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ import {
|
|||||||
editGuildTemplate,
|
editGuildTemplate,
|
||||||
editIntegration,
|
editIntegration,
|
||||||
editRole,
|
editRole,
|
||||||
|
editWidget,
|
||||||
emojiURL,
|
emojiURL,
|
||||||
fetchMembers,
|
fetchMembers,
|
||||||
getAuditLogs,
|
getAuditLogs,
|
||||||
@@ -66,6 +67,7 @@ import {
|
|||||||
getVanityURL,
|
getVanityURL,
|
||||||
getVoiceRegions,
|
getVoiceRegions,
|
||||||
getWebhooks,
|
getWebhooks,
|
||||||
|
getWidgetSettings,
|
||||||
guildBannerURL,
|
guildBannerURL,
|
||||||
guildIconURL,
|
guildIconURL,
|
||||||
guildSplashURL,
|
guildSplashURL,
|
||||||
@@ -160,7 +162,7 @@ export let handlers = {
|
|||||||
deleteIntegration,
|
deleteIntegration,
|
||||||
deleteRole,
|
deleteRole,
|
||||||
deleteServer,
|
deleteServer,
|
||||||
editEmbed,
|
editWidget,
|
||||||
editEmoji,
|
editEmoji,
|
||||||
editGuild,
|
editGuild,
|
||||||
editGuildTemplate,
|
editGuildTemplate,
|
||||||
@@ -173,6 +175,7 @@ export let handlers = {
|
|||||||
getBans,
|
getBans,
|
||||||
getChannel,
|
getChannel,
|
||||||
getChannels,
|
getChannels,
|
||||||
|
getWidgetSettings,
|
||||||
getEmbed,
|
getEmbed,
|
||||||
getEmoji,
|
getEmoji,
|
||||||
getEmojis,
|
getEmojis,
|
||||||
|
|||||||
Reference in New Issue
Block a user