From ef938ca4ed76b705623bfba13eb95926409c76d4 Mon Sep 17 00:00:00 2001 From: Skillz Date: Sat, 26 Dec 2020 20:16:11 -0500 Subject: [PATCH] fixes --- README.md | 5 +++-- mod.ts | 14 +------------- src/api/controllers/misc.ts | 4 ++-- src/api/structures/message.ts | 2 +- src/interactions/README.md | 9 +++++++++ 5 files changed, 16 insertions(+), 18 deletions(-) create mode 100644 src/interactions/README.md diff --git a/README.md b/README.md index 5926e5af7..6642506aa 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,13 @@ ### Beginner Developers -Don't worry a lot of developers start out coding their first projects as a Discord bot (I did 😉) and it is not so easy to do so. Discordeno is built considering all the issues with pre-existing libraries and issues that I had when I first started out coding bots. +Don't worry a lot of developers start out coding their first projects as a Discord bot (I did 😉) and it is not so easy to do so. Discordeno is built considering all the issues with pre-existing libraries and issues that I had when I first started out coding bots. If you are a beginner developer, you may check out these awesome official and unofficial boilerplates: - Official Discordeno Boilerplate - [GitHub](https://github.com/Skillz4Killz/Discordeno-bot-template) - [Features](https://github.com/Skillz4Killz/Discordeno-bot-template#features) - + If you do not wish to use a boilerplate, you may continue reading. ### Advanced Developers @@ -43,6 +43,7 @@ startBot({ }, messageCreate(message) { if (message.content === "ping") { + sendMessage(message.channelID, "Pong using Discordeno!"); } }, diff --git a/mod.ts b/mod.ts index 544dac3bb..21f07a0c4 100644 --- a/mod.ts +++ b/mod.ts @@ -21,19 +21,7 @@ export * from "./src/api/structures/mod.ts"; export * from "./src/api/structures/role.ts"; export * from "./src/bot.ts"; export * from "./src/rest/mod.ts"; -export * from "./src/types/activity.ts"; -export * from "./src/types/cdn.ts"; -export * from "./src/types/channel.ts"; -export * from "./src/types/discord.ts"; -export * from "./src/types/errors.ts"; -export * from "./src/types/fetch.ts"; -export * from "./src/types/guild.ts"; -export * from "./src/types/member.ts"; -export * from "./src/types/message.ts"; -export * from "./src/types/options.ts"; -export * from "./src/types/permission.ts"; -export * from "./src/types/presence.ts"; -export * from "./src/types/role.ts"; +export * from "./src/types/mod.ts"; export * from "./src/util/cache.ts"; export * from "./src/util/collection.ts"; export * from "./src/util/permissions.ts"; diff --git a/src/api/controllers/misc.ts b/src/api/controllers/misc.ts index a59c021f0..d9d8bb48e 100644 --- a/src/api/controllers/misc.ts +++ b/src/api/controllers/misc.ts @@ -97,12 +97,12 @@ export async function handleInternalVoiceStateUpdate(data: DiscordPayload) { guild.voiceStates.set(payload.user_id, { ...payload, guildID: payload.guild_id, - channelID: payload.channel_id, + channelID: payload.channel_id || "", userID: payload.user_id, sessionID: payload.session_id, selfDeaf: payload.self_deaf, selfMute: payload.self_mute, - selfStream: payload.self_stream, + selfStream: payload.self_stream || false, }); if (cachedState?.channelID !== payload.channel_id) { diff --git a/src/api/structures/message.ts b/src/api/structures/message.ts index 633ba46e1..ab9575abc 100644 --- a/src/api/structures/message.ts +++ b/src/api/structures/message.ts @@ -167,7 +167,7 @@ export interface Message { /** When this message was sent */ timestamp: string; /** When this message was edited (if it was not edited, null) */ - editedTimestamp?: string; + editedTimestamp?: number; /** Whether this was a TextToSpeech message. */ tts: boolean; /** Whether this message mentions everyone */ diff --git a/src/interactions/README.md b/src/interactions/README.md new file mode 100644 index 000000000..55a654b68 --- /dev/null +++ b/src/interactions/README.md @@ -0,0 +1,9 @@ +# Discordeno Interactions + +This subpackage serves as a standalone interactions package that supports the webhooks(https server) side of Discords new Interactions API! + +- Complete and extremely fast security and verification checks +- First Class TypeScript Experience! +- Minimalistic! + +This is a barebones interface that will create and handle requests.