mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
feat(handlers): add getGuildPreview() (#408)
* add(handlers): getGuildPreview * update comment * check if guild is discoverable * remove checking since getGuild does not work on unjoined guilds
This commit is contained in:
@@ -689,6 +689,11 @@ export async function unban(guildID: string, id: string) {
|
|||||||
return RequestManager.delete(endpoints.GUILD_BAN(guildID, id));
|
return RequestManager.delete(endpoints.GUILD_BAN(guildID, id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Returns the guild preview object for the given id. If the bot is not in the guild, then the guild must be Discoverable. */
|
||||||
|
export function getGuildPreview(guildID: string) {
|
||||||
|
return RequestManager.get(endpoints.GUILD_PREVIEW(guildID));
|
||||||
|
}
|
||||||
|
|
||||||
/** Modify a guilds settings. Requires the MANAGE_GUILD permission. */
|
/** Modify a guilds settings. Requires the MANAGE_GUILD permission. */
|
||||||
export async function editGuild(guildID: string, options: GuildEditOptions) {
|
export async function editGuild(guildID: string, options: GuildEditOptions) {
|
||||||
const hasPerm = await botHasPermission(guildID, ["MANAGE_GUILD"]);
|
const hasPerm = await botHasPermission(guildID, ["MANAGE_GUILD"]);
|
||||||
|
|||||||
@@ -42,4 +42,5 @@ export enum Errors {
|
|||||||
RULES_CHANNEL_CANNOT_BE_DELETED = "RULES_CHANNEL_CANNOT_BE_DELETED",
|
RULES_CHANNEL_CANNOT_BE_DELETED = "RULES_CHANNEL_CANNOT_BE_DELETED",
|
||||||
UPDATES_CHANNEL_CANNOT_BE_DELETED = "UPDATES_CHANNEL_CANNOT_BE_DELETED",
|
UPDATES_CHANNEL_CANNOT_BE_DELETED = "UPDATES_CHANNEL_CANNOT_BE_DELETED",
|
||||||
GUILD_NOT_FOUND = "GUILD_NOT_FOUND",
|
GUILD_NOT_FOUND = "GUILD_NOT_FOUND",
|
||||||
|
GUILD_NOT_DISCOVERABLE = "GUILD_NOT_DISCOVERABLE",
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user