From b1001b0af53e279d63397cdc6df4a23205167b44 Mon Sep 17 00:00:00 2001 From: Skillz Date: Thu, 29 Oct 2020 18:58:09 -0400 Subject: [PATCH 01/12] test fix for test 14 --- tests/mod.test.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/mod.test.ts b/tests/mod.test.ts index fb745596e..ae21564fe 100644 --- a/tests/mod.test.ts +++ b/tests/mod.test.ts @@ -144,8 +144,8 @@ Deno.test({ Deno.test({ name: "edit a channel in a guild", async fn() { - const channel = await editChannel(data.channelID, { - name: "edited channel", + await editChannel(data.channelID, { + name: "edited-channel", overwrites: [ { id: data.roleID, @@ -154,11 +154,12 @@ Deno.test({ deny: ["USE_EXTERNAL_EMOJIS"], }, ], - }) as Channel; + }); + // Wait 5 seconds for it to update + await delay(5000); const editedChannel = await getChannel(data.channelID); - assert(channel); - assertEquals(editedChannel.name, "edited channel"); + assertEquals(editedChannel.name, "edited-channel"); }, }); From 3e1d9258e1143bab2bddb9f1849dcb97cec25263 Mon Sep 17 00:00:00 2001 From: Skillz Date: Thu, 29 Oct 2020 19:01:51 -0400 Subject: [PATCH 02/12] fix test exiting --- tests/mod.test.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/mod.test.ts b/tests/mod.test.ts index ae21564fe..93828808a 100644 --- a/tests/mod.test.ts +++ b/tests/mod.test.ts @@ -2,7 +2,6 @@ import { assert, assertEquals, delay } from "../deps.ts"; import { botID, cache, - Channel, createClient, createGuildChannel, createGuildRole, @@ -144,7 +143,7 @@ Deno.test({ Deno.test({ name: "edit a channel in a guild", async fn() { - await editChannel(data.channelID, { + await editChannel(data.channelID, { name: "edited-channel", overwrites: [ { @@ -181,8 +180,8 @@ Deno.test({ data.guildID, data.roleID, channel.permission_overwrites, - [Permissions.USE_EXTERNAL_EMOJIS] - ) + [Permissions.USE_EXTERNAL_EMOJIS], + ); assertEquals(hasPerm, true); assertEquals(missingPerm, false); @@ -248,7 +247,7 @@ Deno.test({ Deno.test({ name: "exit the process forcefully after all the tests are done", async fn() { - Deno.exit(1); + Deno.exit(0); }, ...testOptions, }); From 8ea1c8c51f387550d8e419385f621b20cd01d771 Mon Sep 17 00:00:00 2001 From: Skillz Date: Thu, 29 Oct 2020 19:02:37 -0400 Subject: [PATCH 03/12] 0 be default --- tests/mod.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/mod.test.ts b/tests/mod.test.ts index 93828808a..263519312 100644 --- a/tests/mod.test.ts +++ b/tests/mod.test.ts @@ -247,7 +247,7 @@ Deno.test({ Deno.test({ name: "exit the process forcefully after all the tests are done", async fn() { - Deno.exit(0); + Deno.exit(); }, ...testOptions, }); From 98b335fa635f20673ad28f6f20f223ea64eb4de7 Mon Sep 17 00:00:00 2001 From: ayyanm Date: Fri, 30 Oct 2020 03:19:15 -0700 Subject: [PATCH 04/12] Update dependencies in deps.ts --- deps.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deps.ts b/deps.ts index ddc71fbf2..e2fe08a38 100644 --- a/deps.ts +++ b/deps.ts @@ -1,5 +1,3 @@ -export { delay } from "https://deno.land/std@0.67.0/async/delay.ts"; -export { encode } from "https://deno.land/std@0.67.0/encoding/base64.ts"; export { connectWebSocket, isWebSocketCloseEvent, @@ -7,9 +5,11 @@ export { isWebSocketPongEvent, } from "https://deno.land/std@0.67.0/ws/mod.ts"; export type { WebSocket } from "https://deno.land/std@0.67.0/ws/mod.ts"; +export { delay } from "https://deno.land/std@0.75.0/async/delay.ts"; +export { encode } from "https://deno.land/std@0.75.0/encoding/base64.ts"; export { assert, assertArrayIncludes, assertEquals, } from "https://deno.land/std@0.75.0/testing/asserts.ts"; -export { decompress_with as inflate } from "https://unpkg.com/@evan/wasm@0.0.11/target/zlib/deno.js"; +export { decompress_with as inflate } from "https://unpkg.com/@evan/wasm@0.0.12/target/zlib/deno.js"; From f32f1dec1497656e44233c7f07960afd95080d46 Mon Sep 17 00:00:00 2001 From: ayntee Date: Mon, 2 Nov 2020 09:25:12 -0800 Subject: [PATCH 05/12] Add moveMember function to member handler Closes #164 --- src/handlers/member.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/handlers/member.ts b/src/handlers/member.ts index 8b0faf83e..803a83cec 100644 --- a/src/handlers/member.ts +++ b/src/handlers/member.ts @@ -183,3 +183,17 @@ export function editMember( options, ); } + +/** + * Move a member from a voice channel to another. + * @param guildID the id of the guild which the channel exists in + * @param memberID the id of the member to move. + * @param channelID id of channel to move user to (if they are connected to voice) + */ +export function moveMember( + guildID: string, + memberID: string, + channelID: string, +) { + return editMember(guildID, memberID, { channel_id: channelID }); +} From 7537ed6065278357d511f01896efb06a9b5f4d2a Mon Sep 17 00:00:00 2001 From: Jonathan <54381371+jz3r01@users.noreply.github.com> Date: Tue, 3 Nov 2020 15:29:12 -0500 Subject: [PATCH 06/12] Update to reflect new way of running mod.ts --- docs/content/stepbystep/createbot.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/stepbystep/createbot.md b/docs/content/stepbystep/createbot.md index 6a38c32b0..de7179eb2 100644 --- a/docs/content/stepbystep/createbot.md +++ b/docs/content/stepbystep/createbot.md @@ -113,7 +113,7 @@ Oh my god! You now have a bot with a bunch of features already! You don't believ 3. Run the script below: ```shell -deno run --allow-net --allow-read mod.ts +deno run --allow-net --allow-read --no-check --config tsconfig.json mod.ts ``` The first time you run it, you may see a lot of files being loaded. This is preparing all the magic behind the scene. Once it is ready, you will see something like this: From 121f307ad172c26ca6e1a596893a06521b16b569 Mon Sep 17 00:00:00 2001 From: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com> Date: Tue, 3 Nov 2020 15:38:10 -0500 Subject: [PATCH 07/12] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index bd5888489..d3f46b134 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,9 @@ [![Discord](https://img.shields.io/discord/223909216866402304?color=7289da&logo=discord&logoColor=dark)](https://discord.gg/J4NqJ72) ![Testing/Linting](https://github.com/Skillz4Killz/Discordeno/workflows/Testing/Linting/badge.svg) +![Test](https://github.com/Skillz4Killz/Discordeno/workflows/Test/badge.svg) [![nest badge](https://nest.land/badge.svg)](https://nest.land/package/Discordeno) -[WIP] ![Test](https://github.com/Skillz4Killz/Discordeno/workflows/Test/badge.svg) - ## Why Discordeno? ### Beginner Developers From 08af964a52bb219d264edd014d5772bb1c4f0f3a Mon Sep 17 00:00:00 2001 From: Jonathan <54381371+jz3r01@users.noreply.github.com> Date: Tue, 3 Nov 2020 17:29:11 -0500 Subject: [PATCH 08/12] Update createcommand.md --- docs/content/stepbystep/createcommand.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/stepbystep/createcommand.md b/docs/content/stepbystep/createcommand.md index c89fdd706..2e6001cf4 100644 --- a/docs/content/stepbystep/createcommand.md +++ b/docs/content/stepbystep/createcommand.md @@ -66,7 +66,7 @@ Let's add a custom description to our invite command. 🎉 It's that simple. So let's restart the bot and see how it changed. Use **CTRL + C** to shut down the bot. Then run the command from earlier. ```shell -deno run --allow-net --allow-read mod.ts +deno run --allow-net --allow-read --no-check --config tsconfig.json mod.ts ``` To access this easily, most likely all you need to do is press the **UP ARROW** key. Feel free to copy paste this if it doesn't work. From 81acfed1ce84d53d3a5e9b15b49e9c2540958618 Mon Sep 17 00:00:00 2001 From: ayntee Date: Tue, 3 Nov 2020 21:30:06 -0800 Subject: [PATCH 09/12] Update README.md --- README.md | 38 ++++++-------------------------------- 1 file changed, 6 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index d3f46b134..77af7bf20 100644 --- a/README.md +++ b/README.md @@ -13,39 +13,13 @@ 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 wit pre-existing libraries, such as discord.js, and issues that I had when I first started out coding bots. -If you are a beginner developer, please use this official boilerplate: [GitHub](https://github.com/Skillz4Killz/Discordeno-bot-template) but there will be more listed on the website. It is a beautiful website indeed! Check it out! +If you are a beginner developer, you may check out these awesome official and unofficial boilerplates: -**Modular commands, arguments, events, inhibitors, monitors, tasks.** - -- Clean and powerful commands system - - Powerful argument handling including validating, parsing and modifications. - - Easily create custom arguments for your specific needs. - - Command aliases. - - Cooldowns and allowed uses before cooldown triggers. - - Author and bot permission checks in server AND in channel! -- Clean and powerful events system - - Simple functions that are called when an event occurs. - - Easily reloadable! - - No possible memory leaks due to incorrect EventEmitter usage! - - Useful events available to help debug! -- Clean and powerful inhibitors system - - Stops a command from running if a requirement fails. - - Easily add custom inhibitors! -- Clean and powerful monitors system. - - Runs a function on every message sent. Useful for stuff like auto-moderation or tags. - - Easily ignore bots, users, edits, dms. - - Powerful permission checks. -- Clean and powerful tasks system. - - Runs a function at a certain interval. Useful for things like unmute and updating bot lists etc. - - Can be used for cache sweeping to keep your cache optimized for exactly what you want. - - Botlists code already made for most botlists. Just add your api tokens for each site and magic! -- Clean and powerful languages system. - - Built in multi-lingual support. - - Uses i18next, one of the best localization tools available. - - Supports nested folders to keep cleaner translation files - -- **Hot Reloadable**: Easily update your code without having to restart the bot everytime. -- **Step By Step Guide**: There is a step by step walkthrough to learn how to create Discord bots with Discordeno on our website! +- 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 From 1cc8ac12c6b160ec2673a722d10779c2e5fdb9eb Mon Sep 17 00:00:00 2001 From: ayntee Date: Tue, 3 Nov 2020 21:33:26 -0800 Subject: [PATCH 10/12] Revert "Update README.md" This reverts commit 81acfed1ce84d53d3a5e9b15b49e9c2540958618. --- README.md | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 77af7bf20..d3f46b134 100644 --- a/README.md +++ b/README.md @@ -13,13 +13,39 @@ 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 wit pre-existing libraries, such as discord.js, 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: +If you are a beginner developer, please use this official boilerplate: [GitHub](https://github.com/Skillz4Killz/Discordeno-bot-template) but there will be more listed on the website. It is a beautiful website indeed! Check it out! -- 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. +**Modular commands, arguments, events, inhibitors, monitors, tasks.** + +- Clean and powerful commands system + - Powerful argument handling including validating, parsing and modifications. + - Easily create custom arguments for your specific needs. + - Command aliases. + - Cooldowns and allowed uses before cooldown triggers. + - Author and bot permission checks in server AND in channel! +- Clean and powerful events system + - Simple functions that are called when an event occurs. + - Easily reloadable! + - No possible memory leaks due to incorrect EventEmitter usage! + - Useful events available to help debug! +- Clean and powerful inhibitors system + - Stops a command from running if a requirement fails. + - Easily add custom inhibitors! +- Clean and powerful monitors system. + - Runs a function on every message sent. Useful for stuff like auto-moderation or tags. + - Easily ignore bots, users, edits, dms. + - Powerful permission checks. +- Clean and powerful tasks system. + - Runs a function at a certain interval. Useful for things like unmute and updating bot lists etc. + - Can be used for cache sweeping to keep your cache optimized for exactly what you want. + - Botlists code already made for most botlists. Just add your api tokens for each site and magic! +- Clean and powerful languages system. + - Built in multi-lingual support. + - Uses i18next, one of the best localization tools available. + - Supports nested folders to keep cleaner translation files + +- **Hot Reloadable**: Easily update your code without having to restart the bot everytime. +- **Step By Step Guide**: There is a step by step walkthrough to learn how to create Discord bots with Discordeno on our website! ### Advanced Developers From dec6b1fa9c64cfe113323b5a15ff3052ce2fb6b0 Mon Sep 17 00:00:00 2001 From: ayntee Date: Tue, 3 Nov 2020 21:37:31 -0800 Subject: [PATCH 11/12] Remove unnecessary clutter and features --- README.md | 37 +++++-------------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index d3f46b134..6573060f0 100644 --- a/README.md +++ b/README.md @@ -12,40 +12,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 wit pre-existing libraries, such as discord.js, 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: -If you are a beginner developer, please use this official boilerplate: [GitHub](https://github.com/Skillz4Killz/Discordeno-bot-template) but there will be more listed on the website. It is a beautiful website indeed! Check it out! +- Official Discordeno Boilerplate + - [GitHub](https://github.com/Skillz4Killz/Discordeno-bot-template) + - [Features](https://github.com/Skillz4Killz/Discordeno-bot-template#features) -**Modular commands, arguments, events, inhibitors, monitors, tasks.** - -- Clean and powerful commands system - - Powerful argument handling including validating, parsing and modifications. - - Easily create custom arguments for your specific needs. - - Command aliases. - - Cooldowns and allowed uses before cooldown triggers. - - Author and bot permission checks in server AND in channel! -- Clean and powerful events system - - Simple functions that are called when an event occurs. - - Easily reloadable! - - No possible memory leaks due to incorrect EventEmitter usage! - - Useful events available to help debug! -- Clean and powerful inhibitors system - - Stops a command from running if a requirement fails. - - Easily add custom inhibitors! -- Clean and powerful monitors system. - - Runs a function on every message sent. Useful for stuff like auto-moderation or tags. - - Easily ignore bots, users, edits, dms. - - Powerful permission checks. -- Clean and powerful tasks system. - - Runs a function at a certain interval. Useful for things like unmute and updating bot lists etc. - - Can be used for cache sweeping to keep your cache optimized for exactly what you want. - - Botlists code already made for most botlists. Just add your api tokens for each site and magic! -- Clean and powerful languages system. - - Built in multi-lingual support. - - Uses i18next, one of the best localization tools available. - - Supports nested folders to keep cleaner translation files - -- **Hot Reloadable**: Easily update your code without having to restart the bot everytime. -- **Step By Step Guide**: There is a step by step walkthrough to learn how to create Discord bots with Discordeno on our website! +If you do not wish to use a boilerplate, you may continue reading. ### Advanced Developers From b2a9db2b91b480ae05d6d8ef0ddf181003a21f8d Mon Sep 17 00:00:00 2001 From: ayntee Date: Wed, 4 Nov 2020 07:07:28 -0800 Subject: [PATCH 12/12] Update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6573060f0..98f27eb16 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ ### 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 wit pre-existing libraries, such as discord.js, 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