diff --git a/README.md b/README.md index bd5888489..98f27eb16 100644 --- a/README.md +++ b/README.md @@ -4,49 +4,21 @@ [![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 -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: -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 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"; 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: 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. 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 }); +} diff --git a/tests/mod.test.ts b/tests/mod.test.ts index 849b13df8..498ae37ad 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,8 +143,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 +153,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"); }, }); @@ -247,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(); }, ...testOptions, });