mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
Update edit_welcome_screen.ts
This commit is contained in:
@@ -2,20 +2,15 @@ import { rest } from "../../rest/rest.ts";
|
|||||||
import { ModifyGuildWelcomeScreen } from "../../types/guilds/modify_guild_welcome_screen.ts";
|
import { ModifyGuildWelcomeScreen } from "../../types/guilds/modify_guild_welcome_screen.ts";
|
||||||
import { WelcomeScreen } from "../../types/mod.ts";
|
import { WelcomeScreen } from "../../types/mod.ts";
|
||||||
import { endpoints } from "../../util/constants.ts";
|
import { endpoints } from "../../util/constants.ts";
|
||||||
import {
|
import { camelKeysToSnakeCase } from "../../util/utils.ts";
|
||||||
camelKeysToSnakeCase,
|
|
||||||
snakeKeysToCamelCase,
|
|
||||||
} from "../../util/utils.ts";
|
|
||||||
|
|
||||||
export async function editWelcomeScreen(
|
export async function editWelcomeScreen(
|
||||||
guildId: string,
|
guildId: string,
|
||||||
options: ModifyGuildWelcomeScreen,
|
options: ModifyGuildWelcomeScreen,
|
||||||
) {
|
) {
|
||||||
const result = await rest.runMethod(
|
return await rest.runMethod<WelcomeScreen>(
|
||||||
"patch",
|
"patch",
|
||||||
endpoints.GUILD_WELCOME_SCREEN(guildId),
|
endpoints.GUILD_WELCOME_SCREEN(guildId),
|
||||||
camelKeysToSnakeCase(options),
|
camelKeysToSnakeCase(options),
|
||||||
);
|
);
|
||||||
|
|
||||||
return snakeKeysToCamelCase<WelcomeScreen>(result);
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user