mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-03 01:10:07 +00:00
f
This commit is contained in:
@@ -9,7 +9,7 @@ export async function deleteChannel(
|
||||
guildId: string,
|
||||
channelId: string,
|
||||
reason?: string,
|
||||
) {
|
||||
): Promise<undefined> {
|
||||
await requireBotGuildPermissions(guildId, ["MANAGE_CHANNELS"]);
|
||||
|
||||
const guild = await cacheHandlers.get("guilds", guildId);
|
||||
|
||||
@@ -7,7 +7,7 @@ export async function deleteChannelOverwrite(
|
||||
guildId: string,
|
||||
channelId: string,
|
||||
overwriteId: string,
|
||||
) {
|
||||
): Promise<undefined> {
|
||||
await requireBotGuildPermissions(guildId, ["MANAGE_ROLES"]);
|
||||
|
||||
const result = await rest.runMethod(
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { rest } from "../../rest/rest.ts";
|
||||
import { ModifyChannel } from "../../types/channels/modify_channel.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
import {
|
||||
calculateBits,
|
||||
@@ -8,7 +9,7 @@ import {
|
||||
/** Update a channel's settings. Requires the `MANAGE_CHANNELS` permission for the guild. */
|
||||
export async function editChannel(
|
||||
channelId: string,
|
||||
options: ChannelEditOptions,
|
||||
options: ModifyChannel,
|
||||
reason?: string,
|
||||
) {
|
||||
await requireBotChannelPermissions(channelId, ["MANAGE_CHANNELS"]);
|
||||
@@ -47,7 +48,7 @@ export async function editChannel(
|
||||
// deno-lint-ignore camelcase
|
||||
user_limit: options.userLimit,
|
||||
// deno-lint-ignore camelcase
|
||||
permission_overwrites: options.overwrites?.map((overwrite) => {
|
||||
permission_overwrites: options.permissionOverwrites?.map((overwrite) => {
|
||||
return {
|
||||
...overwrite,
|
||||
allow: calculateBits(overwrite.allow),
|
||||
|
||||
@@ -12,7 +12,7 @@ export async function editChannelOverwrite(
|
||||
channelId: string,
|
||||
overwriteId: string,
|
||||
options: Omit<Overwrite, "id">,
|
||||
) {
|
||||
): Promise<undefined> {
|
||||
await requireBotGuildPermissions(guildId, ["MANAGE_ROLES"]);
|
||||
|
||||
const result = await rest.runMethod(
|
||||
|
||||
@@ -10,7 +10,7 @@ import { botHasChannelPermissions } from "../../util/permissions.ts";
|
||||
* However, if a bot is responding to a command and expects the computation to take a few seconds,
|
||||
* this endpoint may be called to let the user know that the bot is processing their message.
|
||||
*/
|
||||
export async function startTyping(channelId: string) {
|
||||
export async function startTyping(channelId: string): Promise<undefined> {
|
||||
const channel = await cacheHandlers.get("channels", channelId);
|
||||
// If the channel is cached, we can do extra checks/safety
|
||||
if (channel) {
|
||||
|
||||
@@ -6,7 +6,7 @@ import { endpoints } from "../../util/constants.ts";
|
||||
export async function swapChannels(
|
||||
guildId: string,
|
||||
channelPositions: ModifyGuildChannelPositions[],
|
||||
) {
|
||||
): Promise<undefined> {
|
||||
if (channelPositions.length < 2) {
|
||||
throw "You must provide at least two channels to be swapped.";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user