mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-19 12:48:16 +00:00
fourth chunk
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import type { CreateGuild } from "../../types/guilds/create_guild.ts";
|
||||
import type { Guild } from "../../types/guilds/guild.ts";
|
||||
import type { Bot } from "../../bot.ts";
|
||||
|
||||
/** Create a new guild. Returns a guild object on success. Fires a Guild Create Gateway event. This endpoint can be used only by bots in less than 10 guilds. */
|
||||
export async function createGuild(bot: Bot, options: CreateGuild) {
|
||||
const result = await bot.rest.runMethod<Guild>(bot.rest, "post", bot.constants.endpoints.GUILDS, {
|
||||
name: options.name,
|
||||
afk_channel_id: options.afkChannelId,
|
||||
afk_timeout: options.afkTimeout,
|
||||
channels: options.channels,
|
||||
default_message_notifications: options.defaultMessageNotifications,
|
||||
explicit_content_filter: options.explicitContentFilter,
|
||||
icon: options.icon,
|
||||
roles: options.roles,
|
||||
system_channel_flags: options.systemChannelFlags,
|
||||
system_channel_id: options.systemChannelId,
|
||||
verification_level: options.verificationLevel,
|
||||
});
|
||||
|
||||
return bot.transformers.guild(bot, { guild: result, shardId: 0 });
|
||||
}
|
||||
Reference in New Issue
Block a user