mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 03:18:17 +00:00
fix some errors
This commit is contained in:
@@ -2,16 +2,11 @@ import { eventHandlers } from "../../bot.ts";
|
||||
import { cacheHandlers } from "../../cache.ts";
|
||||
import { structures } from "../../structures/mod.ts";
|
||||
import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
import {
|
||||
DiscordVoiceState,
|
||||
VoiceState,
|
||||
} from "../../types/voice/voice_state.ts";
|
||||
import { snakeKeysToCamelCase } from "../../util/utils.ts";
|
||||
import { VoiceState } from "../../types/voice/voice_state.ts";
|
||||
|
||||
export async function handleVoiceStateUpdate(data: DiscordGatewayPayload) {
|
||||
const payload = snakeKeysToCamelCase<VoiceState>(
|
||||
data.d as DiscordVoiceState,
|
||||
);
|
||||
const payload = data.d as VoiceState;
|
||||
|
||||
if (!payload.guildId) return;
|
||||
|
||||
const guild = await cacheHandlers.get("guilds", payload.guildId);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { rest } from "../../rest/rest.ts";
|
||||
import { DiscordValidateDiscoverySearchTerm } from "../../types/discovery/validate_discovery_search_term.ts";
|
||||
import { ValidateDiscoverySearchTerm } from "../../types/discovery/validate_discovery_search_term.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
|
||||
export async function validDiscoveryTerm(term: string) {
|
||||
const result = await rest.runMethod<DiscordValidateDiscoverySearchTerm>(
|
||||
const result = await rest.runMethod<ValidateDiscoverySearchTerm>(
|
||||
"get",
|
||||
endpoints.DISCOVERY_VALID_TERM,
|
||||
{ term },
|
||||
|
||||
@@ -4,7 +4,7 @@ import { structures } from "../../structures/mod.ts";
|
||||
import { DiscordChannelTypes } from "../../types/channels/channel_types.ts";
|
||||
import { DiscordAllowedMentionsTypes } from "../../types/messages/allowed_mentions_types.ts";
|
||||
import { CreateMessage } from "../../types/messages/create_message.ts";
|
||||
import { DiscordMessage, Message } from "../../types/messages/message.ts";
|
||||
import { Message } from "../../types/messages/message.ts";
|
||||
import { Errors } from "../../types/misc/errors.ts";
|
||||
import { PermissionStrings } from "../../types/permissions/permission_strings.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
@@ -96,7 +96,7 @@ export async function sendMessage(
|
||||
const result = await rest.runMethod<Message>(
|
||||
"post",
|
||||
endpoints.CHANNEL_MESSAGES(channelId),
|
||||
camelKeysToSnakeCase<DiscordMessage>({
|
||||
camelKeysToSnakeCase({
|
||||
...content,
|
||||
...(content.messageReference?.messageId
|
||||
? {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// TODO: add docs link
|
||||
export interface ValidateDiscoverySearchTerm {
|
||||
/** Whether the provided term is valid */
|
||||
valid: boolean;
|
||||
}
|
||||
|
||||
export type DiscordValidateDiscoverySearchTerm = ValidateDiscoverySearchTerm;
|
||||
|
||||
Reference in New Issue
Block a user