From b67f8f5f3dc0eac055113f84a2644d077fbc96da Mon Sep 17 00:00:00 2001 From: ayntee Date: Sun, 27 Dec 2020 11:18:47 +0400 Subject: [PATCH 1/8] fix: update import paths --- tests/mod.test.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/mod.test.ts b/tests/mod.test.ts index 68a1b7a1d..da6e032d2 100644 --- a/tests/mod.test.ts +++ b/tests/mod.test.ts @@ -1,14 +1,17 @@ -import { assert, assertEquals, delay } from "../deps.ts"; import { botID, cache, + channelOverwriteHasPermission, createGuildChannel, createGuildRole, createServer, + delay, deleteChannel, deleteRole, deleteServer, + editChannel, editRole, + getChannel, getMessage, Guild, Intents, @@ -17,11 +20,7 @@ import { sendMessage, startBot, } from "../mod.ts"; -import { - channelOverwriteHasPermission, - editChannel, -} from "../src/handlers/channel.ts"; -import { getChannel } from "../src/handlers/guild.ts"; +import { assert, assertEquals } from "./deps.ts"; const token = Deno.env.get("DISCORD_TOKEN"); if (!token) throw "Token is not provided"; From b35bcf821e6c61f1711ad04b6c008dbe11256b5a Mon Sep 17 00:00:00 2001 From: ayntee Date: Sun, 27 Dec 2020 11:20:51 +0400 Subject: [PATCH 2/8] style: format api/structures/channel.ts --- src/api/structures/channel.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/structures/channel.ts b/src/api/structures/channel.ts index 749723eda..20e5f9e86 100644 --- a/src/api/structures/channel.ts +++ b/src/api/structures/channel.ts @@ -24,7 +24,7 @@ const baseChannel: Partial = { }, send(content) { return sendMessage(this.id!, content); - } + }, }; export async function createChannel( From 2dbe51925f287b5ded129f75d7038aeace0fa5be Mon Sep 17 00:00:00 2001 From: ayntee Date: Sun, 27 Dec 2020 11:28:17 +0400 Subject: [PATCH 3/8] chore: ignore .vscode/ --- .gitignore | 3 +++ .vscode/settings.json | 8 -------- 2 files changed, 3 insertions(+), 8 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore index 45eeac2c0..7fda0a74a 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,6 @@ public/ # IntelliJ IDEA .idea/ + +# Visual Studio Code +.vscode/ \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 8b3b2fa17..000000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "deno.enable": true, - "editor.defaultFormatter": "denoland.vscode-deno", - "editor.formatOnSave": true, - "editor.codeActionsOnSave": { - "source.organizeImports": true - } -} \ No newline at end of file From 9d451a395daba3e1291bc96ff6c3e97cf00fd2be Mon Sep 17 00:00:00 2001 From: ayntee Date: Sun, 27 Dec 2020 11:51:05 +0400 Subject: [PATCH 4/8] docs: dark theme by default --- docs/package.json | 2 +- docs/src/.vuepress/config.js | 66 +++++------------------------------ docs/src/.vuepress/navbar.js | 15 ++++++++ docs/src/.vuepress/sidebar.js | 39 +++++++++++++++++++++ 4 files changed, 64 insertions(+), 58 deletions(-) create mode 100644 docs/src/.vuepress/navbar.js create mode 100644 docs/src/.vuepress/sidebar.js diff --git a/docs/package.json b/docs/package.json index 6ed60d45d..856009482 100755 --- a/docs/package.json +++ b/docs/package.json @@ -1,5 +1,6 @@ { "name": "discordeno", + "private": true, "version": "0.0.1", "description": "Docs for Discordeno", "repository": "https://github.com/discordeno/discordeno", @@ -7,7 +8,6 @@ "docs:dev": "vuepress dev src --host localhost", "docs:build": "vuepress build src" }, - "license": "MIT", "devDependencies": { "vuepress": "^1.7.1", "vuepress-theme-yuu": "^2.3.0", diff --git a/docs/src/.vuepress/config.js b/docs/src/.vuepress/config.js index 4a53e7d11..c72624f54 100755 --- a/docs/src/.vuepress/config.js +++ b/docs/src/.vuepress/config.js @@ -1,7 +1,8 @@ -const { name, description, repository } = require("../../package"); +const { name, description, repository: repo } = require("../../package"); +const nav = require("./navbar"); +const sidebar = require("./sidebar"); const title = name[0].toUpperCase() + name.slice(1); -const discordLink = "https://discord.com/invite/5vBgXk3UcZ"; module.exports = { base: `/`, @@ -29,65 +30,16 @@ module.exports = { ], theme: "yuu", themeConfig: { - repo: repository, + repo, docsDir: "docs/src", editLinks: true, lastUpdated: true, sidebarDepth: 0, - nav: [ - { - text: "Home", - link: "/", - }, - { - text: "Docs", - link: "https://doc.deno.land/https/deno.land/x/discordeno/mod.ts", - }, - { - text: "Discord", - link: discordLink, - target: "_blank", - }, - ], - sidebar: { - "/": [ - { - title: "Home", - children: [ - "/", - "faq", - "gettingstarted", - "djs", - ], - }, - { - title: "Step By Step Guide", - children: [ - "/stepbystep/", - "/stepbystep/createbot", - "/stepbystep/createcommand", - "/stepbystep/createevent", - "/stepbystep/createlanguage", - "/stepbystep/createmonitor", - "/stepbystep/createinhibitor", - "/stepbystep/createtask", - "/stepbystep/hostingbot", - ], - }, - { - title: "Advanced Guide", - children: [ - "/advanced/", - "/advanced/arguments", - "/advanced/customizations", - "/advanced/dockerhosting", - "/advanced/dynamiccommands", - "/advanced/permlevels", - "/advanced/subcommands", - ], - }, - ], - }, + nav, + sidebar, + yuu: { + defaultDarkTheme: true + } }, plugins: [ "@vuepress/plugin-back-to-top", diff --git a/docs/src/.vuepress/navbar.js b/docs/src/.vuepress/navbar.js new file mode 100644 index 000000000..adca5b258 --- /dev/null +++ b/docs/src/.vuepress/navbar.js @@ -0,0 +1,15 @@ +module.exports = [ + { + text: "Home", + link: "/", + }, + { + text: "Docs", + link: "https://doc.deno.land/https/deno.land/x/discordeno/mod.ts", + }, + { + text: "Discord", + link: "https://discord.gg/5vBgXk3UcZ", + target: "_blank", + }, +] \ No newline at end of file diff --git a/docs/src/.vuepress/sidebar.js b/docs/src/.vuepress/sidebar.js new file mode 100644 index 000000000..d62addfe9 --- /dev/null +++ b/docs/src/.vuepress/sidebar.js @@ -0,0 +1,39 @@ +module.exports = { + "/": [ + { + title: "Home", + children: [ + "/", + "faq", + "gettingstarted", + "djs", + ], + }, + { + title: "Step By Step Guide", + children: [ + "/stepbystep/", + "/stepbystep/createbot", + "/stepbystep/createcommand", + "/stepbystep/createevent", + "/stepbystep/createlanguage", + "/stepbystep/createmonitor", + "/stepbystep/createinhibitor", + "/stepbystep/createtask", + "/stepbystep/hostingbot", + ], + }, + { + title: "Advanced Guide", + children: [ + "/advanced/", + "/advanced/arguments", + "/advanced/customizations", + "/advanced/dockerhosting", + "/advanced/dynamiccommands", + "/advanced/permlevels", + "/advanced/subcommands", + ], + }, + ], +} \ No newline at end of file From d5c19e50f085eaa3af894fbe05d39dff19420542 Mon Sep 17 00:00:00 2001 From: TriForMine Date: Sun, 27 Dec 2020 11:33:37 +0100 Subject: [PATCH 5/8] fix: remove extra slash from IMAGE_BASE_URL (#274) Removed the extra slash at the end since the usage of this variable always add the slash after the constant. --- src/util/constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/constants.ts b/src/util/constants.ts index 697780293..8a86a20e9 100644 --- a/src/util/constants.ts +++ b/src/util/constants.ts @@ -12,7 +12,7 @@ export const USER_AGENT = "DiscordBot (https://github.com/discordeno/discordeno, v10)"; /** https://discord.com/developers/docs/reference#image-formatting-image-base-url */ -export const IMAGE_BASE_URL = "https://cdn.discordapp.com/"; +export const IMAGE_BASE_URL = "https://cdn.discordapp.com"; // This can be modified by big brain bots and use a proxy export const baseEndpoints = { From a27349d2eccb5e0b980c5b775d19229be464ccbb Mon Sep 17 00:00:00 2001 From: ayntee Date: Sun, 27 Dec 2020 14:49:16 +0400 Subject: [PATCH 6/8] deps: use unpkg instead of esm.sh --- src/interactions/deps.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/interactions/deps.ts b/src/interactions/deps.ts index e2f90fc92..921102596 100644 --- a/src/interactions/deps.ts +++ b/src/interactions/deps.ts @@ -1,2 +1,2 @@ export { serve } from "https://deno.land/std@0.81.0/http/server.ts"; -export { verify } from "https://esm.sh/@evan/wasm@0.0.18/target/ed25519/deno.js"; +export { verify } from "https://unpkg.com/@evan/wasm@0.0.25/target/ed25519/deno.js"; From 3ca78030cb171d008379aa62c81b790f8f1a708a Mon Sep 17 00:00:00 2001 From: ayntee Date: Sun, 27 Dec 2020 16:51:18 +0400 Subject: [PATCH 7/8] docs: improve wording --- src/interactions/README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/interactions/README.md b/src/interactions/README.md index 55a654b68..8d08dea91 100644 --- a/src/interactions/README.md +++ b/src/interactions/README.md @@ -1,9 +1,8 @@ # Discordeno Interactions -This subpackage serves as a standalone interactions package that supports the webhooks(https server) side of Discords new Interactions API! +`interactions` is a standalone submodule that supports the webhooks through HTTP server side of Discord's new Interactions API. +This is a barebones interface that will create and handle requests from Discord 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. +- First-class TypeScript Support +- Minimalistic From 59599876394ba38180d0f1568def405aea9efe54 Mon Sep 17 00:00:00 2001 From: Ayyan Date: Sun, 27 Dec 2020 16:59:58 +0400 Subject: [PATCH 8/8] Update README.md --- src/interactions/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/interactions/README.md b/src/interactions/README.md index 8d08dea91..fd559ff4e 100644 --- a/src/interactions/README.md +++ b/src/interactions/README.md @@ -1,6 +1,6 @@ # Discordeno Interactions -`interactions` is a standalone submodule that supports the webhooks through HTTP server side of Discord's new Interactions API. +`interactions` is a standalone submodule that supports the webhooks through HTTP server to add support for Discord's interactions feature. This is a barebones interface that will create and handle requests from Discord API. - Complete and extremely fast security and verification checks