This commit is contained in:
ayntee
2020-11-04 07:17:01 -08:00
6 changed files with 33 additions and 47 deletions
+7 -35
View File
@@ -4,49 +4,21 @@
[![Discord](https://img.shields.io/discord/223909216866402304?color=7289da&logo=discord&logoColor=dark)](https://discord.gg/J4NqJ72) [![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) ![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) [![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? ## Why Discordeno?
### Beginner Developers ### 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.** If you do not wish to use a boilerplate, you may continue reading.
- 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 ### Advanced Developers
+3 -3
View File
@@ -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 { export {
connectWebSocket, connectWebSocket,
isWebSocketCloseEvent, isWebSocketCloseEvent,
@@ -7,9 +5,11 @@ export {
isWebSocketPongEvent, isWebSocketPongEvent,
} from "https://deno.land/std@0.67.0/ws/mod.ts"; } 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 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 { export {
assert, assert,
assertArrayIncludes, assertArrayIncludes,
assertEquals, assertEquals,
} from "https://deno.land/std@0.75.0/testing/asserts.ts"; } 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";
+1 -1
View File
@@ -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: 3. Run the script below:
```shell ```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: 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:
+1 -1
View File
@@ -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. 🎉 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 ```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. 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.
+14
View File
@@ -183,3 +183,17 @@ export function editMember(
options, 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 });
}
+7 -7
View File
@@ -2,7 +2,6 @@ import { assert, assertEquals, delay } from "../deps.ts";
import { import {
botID, botID,
cache, cache,
Channel,
createClient, createClient,
createGuildChannel, createGuildChannel,
createGuildRole, createGuildRole,
@@ -144,8 +143,8 @@ Deno.test({
Deno.test({ Deno.test({
name: "edit a channel in a guild", name: "edit a channel in a guild",
async fn() { async fn() {
const channel = await editChannel(data.channelID, { await editChannel(data.channelID, {
name: "edited channel", name: "edited-channel",
overwrites: [ overwrites: [
{ {
id: data.roleID, id: data.roleID,
@@ -154,11 +153,12 @@ Deno.test({
deny: ["USE_EXTERNAL_EMOJIS"], deny: ["USE_EXTERNAL_EMOJIS"],
}, },
], ],
}) as Channel; });
// Wait 5 seconds for it to update
await delay(5000);
const editedChannel = await getChannel(data.channelID); 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({ Deno.test({
name: "exit the process forcefully after all the tests are done", name: "exit the process forcefully after all the tests are done",
async fn() { async fn() {
Deno.exit(1); Deno.exit();
}, },
...testOptions, ...testOptions,
}); });