Skip to content

Commit 5d541f8

Browse files
Replace fork to discord.js-docs (#8)
1 parent 9766bea commit 5d541f8

File tree

4 files changed

+22
-7
lines changed

4 files changed

+22
-7
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"dependencies": {
1313
"discord-akairo": "^8.1.0",
1414
"discord.js": "^12.5.1",
15-
"discord.js-docs": "BenjammingKirby/discord.js-docs#types",
15+
"discord.js-docs": "^0.1.2",
1616
"dotenv": "^8.2.0",
1717
"pm2": "^4.5.1"
1818
},
@@ -28,4 +28,4 @@
2828
"ts-node-dev": "^1.1.1",
2929
"typescript": "^4.1.3"
3030
}
31-
}
31+
}

src/commands/docs/djs.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { Message } from "discord.js";
22
import { Command } from "discord-akairo";
33
import Doc from "discord.js-docs";
4+
import sources = require("../../sources.json");
45
export default class DiscordCommand extends Command {
56
public constructor() {
67
super("djs-docs", {
@@ -36,7 +37,7 @@ export default class DiscordCommand extends Command {
3637
public async exec(message: Message, { query, branch }: { query: string; branch: string }): Promise<Message | Message[]> {
3738
const str = query.split(" ");
3839

39-
const source = branch ? "stable" : "main";
40+
const source = branch ? "stable" : sources["main"];
4041
const doc = await Doc.fetch(source, {force: true});
4142
const resultEmbed = doc.resolveEmbed(str.join("#"));
4243
if (!resultEmbed) return;

src/sources.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"stable": "https://raw.githubusercontent.com/discordjs/discord.js/docs/stable.json",
3+
"main": "https://raw.githubusercontent.com/discordjs/discord.js/docs/main.json",
4+
"commando": "https://raw.githubusercontent.com/discordjs/commando/docs/master.json",
5+
"rpc": "https://raw.githubusercontent.com/discordjs/rpc/docs/master.json",
6+
"akairo": "https://raw.githubusercontent.com/discord-akairo/discord-akairo/docs/8.1.0.json",
7+
"collection": "https://raw.githubusercontent.com/discordjs/collection/docs/stable.json",
8+
"collection-main": "https://raw.githubusercontent.com/discordjs/collection/docs/main.json",
9+
"builders":"https://raw.githubusercontent.com/discordjs/builders/docs/stable.json",
10+
"builders-main":"https://raw.githubusercontent.com/discordjs/builders/docs/main.json",
11+
"voice":"https://raw.githubusercontent.com/discordjs/voice/docs/stable.json",
12+
"voice-main":"https://raw.githubusercontent.com/discordjs/voice/docs/main.json"
13+
}

yarn.lock

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -742,12 +742,13 @@ discord-akairo@^8.1.0:
742742
resolved "https://registry.yarnpkg.com/discord-akairo/-/discord-akairo-8.1.0.tgz#9f3d910e12c197d40d3522a3a93679e2a746a6ca"
743743
integrity sha512-INWYmHo6NgyYx1ZKGSCmgznVfvkXpWGj4fGCGjO8IPkZ06Bidb9YKr4rXy2lwG0kprCjvqY0qbbhcw6N050abQ==
744744

745-
discord.js-docs@BenjammingKirby/discord.js-docs#types:
745+
discord.js-docs@^0.1.2:
746746
version "0.1.2"
747-
resolved "https://codeload.github.com/BenjammingKirby/discord.js-docs/tar.gz/f8a89e4f2ae9adff2104a79e501e59aadc8e9dbe"
747+
resolved "https://registry.yarnpkg.com/discord.js-docs/-/discord.js-docs-0.1.2.tgz#65941b3d037346cec220d1b5e0ec8e46aa62697e"
748+
integrity sha512-DrDOJD3odnmGJE8HyVaspAYiUN51LotzqIH/tNq9PydZva+wceVM5dijEBI+g/0hSl1/CQKTIgN3z0dIcMv0CQ==
748749
dependencies:
749750
common-tags "^1.8.0"
750-
fuse.js "^3.4.6"
751+
fuse.js "^3.2.1"
751752
node-fetch "^2.6.0"
752753

753754
discord.js@^12.5.1:
@@ -1110,7 +1111,7 @@ functional-red-black-tree@^1.0.1:
11101111
resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327"
11111112
integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=
11121113

1113-
fuse.js@^3.4.6:
1114+
fuse.js@^3.2.1:
11141115
version "3.6.1"
11151116
resolved "https://registry.yarnpkg.com/fuse.js/-/fuse.js-3.6.1.tgz#7de85fdd6e1b3377c23ce010892656385fd9b10c"
11161117
integrity sha512-hT9yh/tiinkmirKrlv4KWOjztdoZo1mx9Qh4KvWqC7isoXwdUY3PNWUxceF4/qO9R6riA2C29jdTOeQOIROjgw==

0 commit comments

Comments
 (0)