This commit is contained in:
ITOH
2021-04-06 22:07:15 +02:00
parent 484e995140
commit 707b096360
6 changed files with 8 additions and 7 deletions

View File

@@ -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);

View File

@@ -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(

View File

@@ -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),

View File

@@ -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(

View File

@@ -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) {

View File

@@ -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.";
}