generator-discord 1.1.4 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -21
- package/README.md +45 -45
- package/app/index.d.ts +10 -9
- package/app/index.js +128 -117
- package/app/index.js.map +1 -1
- package/package.json +48 -47
- package/src/index.ts +158 -147
- package/templates/javascript/config.json +2 -2
- package/templates/javascript/package.json +13 -13
- package/templates/javascript/src/index.js +42 -26
- package/templates/python/bot.py +20 -20
- package/templates/typescript/config.json +2 -2
- package/templates/typescript/package.json +16 -16
- package/templates/typescript/src/index.ts +42 -27
- package/templates/typescript/tsconfig.json +24 -24
- package/test/generator.test.ts +78 -78
package/src/index.ts
CHANGED
|
@@ -1,147 +1,158 @@
|
|
|
1
|
-
import Generator from 'yeoman-generator';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const TEMPLATE_DIR = '../templates/';
|
|
6
|
-
const USER_DIR = '.';
|
|
7
|
-
|
|
8
|
-
const OPEN = '<%= ';
|
|
9
|
-
const CLOSE = ' %>';
|
|
10
|
-
|
|
11
|
-
const BOT_NAME = 'bot-name';
|
|
12
|
-
const BOT_TOKEN = 'bot-token';
|
|
13
|
-
|
|
14
|
-
interface Answers {
|
|
15
|
-
botName: string;
|
|
16
|
-
botType: string;
|
|
17
|
-
botToken: string;
|
|
18
|
-
openWithCode: boolean;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export default class DiscordGenerator extends Generator {
|
|
23
|
-
private answers: Answers;
|
|
24
|
-
|
|
25
|
-
constructor(args: string | string[], options: Generator.GeneratorOptions) {
|
|
26
|
-
super(args, options);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
async prompting(): Promise<void> {
|
|
30
|
-
this.logo();
|
|
31
|
-
this.answers = await this.prompt([
|
|
32
|
-
{
|
|
33
|
-
type: 'input',
|
|
34
|
-
name: 'botName',
|
|
35
|
-
message: 'Your Discord Bot name:',
|
|
36
|
-
default: 'my-bot',
|
|
37
|
-
validate: (input: string): boolean | string =>
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
this.log("
|
|
74
|
-
this.log(" \x1b[36m| __
|
|
75
|
-
this.log(" \x1b[36m| | | |
|
|
76
|
-
this.log(" \x1b[36m| |
|
|
77
|
-
this.log(" \x1b[36m|
|
|
78
|
-
this.log("
|
|
79
|
-
this.log("
|
|
80
|
-
this.log("
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
[
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
this.
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
this.
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
1
|
+
import Generator from 'yeoman-generator';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
const TEMPLATE_DIR = '../templates/';
|
|
6
|
+
const USER_DIR = '.';
|
|
7
|
+
|
|
8
|
+
const OPEN = '<%= ';
|
|
9
|
+
const CLOSE = ' %>';
|
|
10
|
+
|
|
11
|
+
const BOT_NAME = 'bot-name';
|
|
12
|
+
const BOT_TOKEN = 'bot-token';
|
|
13
|
+
|
|
14
|
+
interface Answers {
|
|
15
|
+
botName: string;
|
|
16
|
+
botType: string;
|
|
17
|
+
botToken: string;
|
|
18
|
+
openWithCode: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
export default class DiscordGenerator extends Generator {
|
|
23
|
+
private answers: Answers;
|
|
24
|
+
|
|
25
|
+
constructor(args: string | string[], options: Generator.GeneratorOptions) {
|
|
26
|
+
super(args, options);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async prompting(): Promise<void> {
|
|
30
|
+
this.logo();
|
|
31
|
+
this.answers = await this.prompt([
|
|
32
|
+
{
|
|
33
|
+
type: 'input',
|
|
34
|
+
name: 'botName',
|
|
35
|
+
message: 'Your Discord Bot name:',
|
|
36
|
+
default: 'my-bot',
|
|
37
|
+
validate: (input: string): boolean | string =>
|
|
38
|
+
new RegExp("^(?:@[a-z0-9-*~][a-z0-9-*._~]*/)?[a-z0-9-~][a-z0-9-._~]*$").test(input)
|
|
39
|
+
? true
|
|
40
|
+
: 'Invalid bot name. Please use only lowercase letters, numbers, and hyphens. Must start with a letter.'
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
type: 'list',
|
|
44
|
+
name: 'botType',
|
|
45
|
+
message: 'The type of Discord Bot you want to create.',
|
|
46
|
+
choices: [
|
|
47
|
+
{
|
|
48
|
+
name: 'New Discord Bot (TypeScript)',
|
|
49
|
+
value: 'typescript'
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'New Discord Bot (JavaScript)',
|
|
53
|
+
value: 'javascript'
|
|
54
|
+
}
|
|
55
|
+
,
|
|
56
|
+
{
|
|
57
|
+
name: 'New Discord Bot (Python)',
|
|
58
|
+
value: 'python'
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
type: 'input',
|
|
64
|
+
name: 'botToken',
|
|
65
|
+
message: 'Your Discord Bot Token. (Enter to leave blank)',
|
|
66
|
+
default: 'your-bot-token'
|
|
67
|
+
}
|
|
68
|
+
]);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
logo(): void {
|
|
72
|
+
this.log(" \x1b[36m_____ _ _ \x1b[31m_ ");
|
|
73
|
+
this.log(" \x1b[36m| __ \\(_) | | \x1b[31m(_) ");
|
|
74
|
+
this.log(" \x1b[36m| | | |_ ___ ___ ___ _ __ __| | \x1b[33m_ ___ ");
|
|
75
|
+
this.log(" \x1b[36m| | | | / __|/ __/ _ \\| '__/ _` | \x1b[33m| / __|");
|
|
76
|
+
this.log(" \x1b[36m| |__| | \\__ \\ (_| (_) | | | (_| |\x1b[37m_\x1b[32m| \\__ \\");
|
|
77
|
+
this.log(" \x1b[36m|_____/|_|___/\\___\\___/|_| \\__,_\x1b[37m(_) \x1b[32m|___/");
|
|
78
|
+
this.log(" \x1b[34m_/ | ");
|
|
79
|
+
this.log(" \x1b[35m|__/ ");
|
|
80
|
+
this.log("\x1b[0m");
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
writing(): void {
|
|
84
|
+
this.sourceRoot(path.join(__dirname, TEMPLATE_DIR + this.answers.botType));
|
|
85
|
+
['.'].forEach(
|
|
86
|
+
(path: string) => {
|
|
87
|
+
const replaceWords = (
|
|
88
|
+
answers: Answers,
|
|
89
|
+
content: Buffer
|
|
90
|
+
): string =>
|
|
91
|
+
[
|
|
92
|
+
[BOT_NAME, this.answers.botName],
|
|
93
|
+
[BOT_TOKEN, this.answers.botToken]
|
|
94
|
+
].reduce(
|
|
95
|
+
(acc: string, [templateWord, userAnswer]) =>
|
|
96
|
+
acc.replace(
|
|
97
|
+
new RegExp(
|
|
98
|
+
`${OPEN}${templateWord}${CLOSE}`,
|
|
99
|
+
'g'
|
|
100
|
+
),
|
|
101
|
+
userAnswer
|
|
102
|
+
),
|
|
103
|
+
content.toString()
|
|
104
|
+
);
|
|
105
|
+
this.fs.copy(
|
|
106
|
+
this.templatePath(path),
|
|
107
|
+
this.destinationPath(
|
|
108
|
+
USER_DIR,
|
|
109
|
+
this.answers.botName,
|
|
110
|
+
path
|
|
111
|
+
),
|
|
112
|
+
{
|
|
113
|
+
process: (content: Buffer) =>
|
|
114
|
+
replaceWords(this.answers, content)
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
async install(): Promise<void> {
|
|
121
|
+
this.log('');
|
|
122
|
+
if (this.answers.botType === 'typescript' || this.answers.botType === 'javascript') {
|
|
123
|
+
const options = { cwd: this.destinationPath(USER_DIR, this.answers.botName) };
|
|
124
|
+
this.spawnCommandSync('npm', ['install'], options);
|
|
125
|
+
if(this.answers.botType === 'typescript') {
|
|
126
|
+
this.spawnCommandSync('npm', ['run', 'build'], options);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
this.log('Your Discord Bot ' + this.answers.botName + ' has been created!');
|
|
131
|
+
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
async end(): Promise<void> {
|
|
135
|
+
const answer = await this.prompt({
|
|
136
|
+
type: 'list',
|
|
137
|
+
name: 'openWithCode',
|
|
138
|
+
message: 'Do you want to open your Discord Bot with Visual Studio Code?',
|
|
139
|
+
choices: [
|
|
140
|
+
{
|
|
141
|
+
name: 'open with `code`',
|
|
142
|
+
value: true
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: 'skip',
|
|
146
|
+
value: false
|
|
147
|
+
}
|
|
148
|
+
]
|
|
149
|
+
});
|
|
150
|
+
this.log('');
|
|
151
|
+
if (answer && answer.openWithCode) {
|
|
152
|
+
this.spawnCommand('code', [this.destinationPath(
|
|
153
|
+
USER_DIR,
|
|
154
|
+
this.answers.botName
|
|
155
|
+
)]);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"token":"<%= bot-token %>"
|
|
1
|
+
{
|
|
2
|
+
"token":"<%= bot-token %>"
|
|
3
3
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "<%= bot-name %>",
|
|
3
|
-
"displayName": "<%= bot-name %>",
|
|
4
|
-
"description": "Please enter a brief description here",
|
|
5
|
-
"version": "1.0.0",
|
|
6
|
-
"main": "./src/index.js",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"start": "node ./src/index.js"
|
|
9
|
-
},
|
|
10
|
-
"dependencies": {
|
|
11
|
-
"discord.js": "^13.13.1"
|
|
12
|
-
}
|
|
13
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "<%= bot-name %>",
|
|
3
|
+
"displayName": "<%= bot-name %>",
|
|
4
|
+
"description": "Please enter a brief description here",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"main": "./src/index.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"start": "node ./src/index.js"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"discord.js": "^13.13.1"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -1,26 +1,42 @@
|
|
|
1
|
-
const { Client, Intents } = require('discord.js');
|
|
2
|
-
const { token } = require('../config.json');
|
|
3
|
-
|
|
4
|
-
// Create a new client instance with Intents that specify which privileged intents your bot requires
|
|
5
|
-
const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
// Run this code when the client is ready. This event will only trigger one time after logging in
|
|
9
|
-
client.once('ready', () => {
|
|
10
|
-
console.log(`Bot is logged in as ${client.user.tag}.`);
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
//
|
|
17
|
-
if (content
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
//
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
const { Client, Intents } = require('discord.js');
|
|
2
|
+
const { token } = require('../config.json');
|
|
3
|
+
|
|
4
|
+
// Create a new client instance with Intents that specify which privileged intents your bot requires
|
|
5
|
+
const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] });
|
|
6
|
+
const prefix = '!';
|
|
7
|
+
|
|
8
|
+
// Run this code when the client is ready. This event will only trigger one time after logging in
|
|
9
|
+
client.once('ready', () => {
|
|
10
|
+
console.log(`Bot is logged in as ${client.user.tag}.`);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
// Listen for messages
|
|
15
|
+
client.on('messageCreate', async message => {
|
|
16
|
+
// Ignore messages that don't start with the prefix or are from a bot
|
|
17
|
+
if (!message.content.startsWith(prefix) || message.author.bot) return;
|
|
18
|
+
|
|
19
|
+
// Split the message into command and arguments
|
|
20
|
+
const args = message.content.slice(prefix.length).trim().split(/ +/);
|
|
21
|
+
const command = args.shift()?.toLowerCase();
|
|
22
|
+
|
|
23
|
+
// ping - bot will reply with Pong!
|
|
24
|
+
if (command === 'ping') {
|
|
25
|
+
await message.reply('Pong!');
|
|
26
|
+
}
|
|
27
|
+
// say <message> - bot will send the message
|
|
28
|
+
else if (command === 'say') {
|
|
29
|
+
if (!args.length) {
|
|
30
|
+
await message.channel.send(`You didn't provide any arguments, ${message.author}!`);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
await message.channel.send(args.join(' '));
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
// Login to Discord with your app's token
|
|
40
|
+
client.login(token);
|
|
41
|
+
|
|
42
|
+
// For more information about the Discord.js library, visit https://discord.js.org/#/docs/main/stable/general/welcome∏
|
package/templates/python/bot.py
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import discord
|
|
2
|
-
from discord.ext import commands
|
|
3
|
-
|
|
4
|
-
# Define bot prefix and create bot instance
|
|
5
|
-
bot_prefix = "!"
|
|
6
|
-
bot = commands.Bot(command_prefix=bot_prefix)
|
|
7
|
-
|
|
8
|
-
# Define bot events
|
|
9
|
-
@bot.event
|
|
10
|
-
async def on_ready():
|
|
11
|
-
print(f"Logged in as {bot.user.name} ({bot.user.id})")
|
|
12
|
-
|
|
13
|
-
# Define bot commands
|
|
14
|
-
@bot.command()
|
|
15
|
-
async def ping(ctx):
|
|
16
|
-
await ctx.send("Pong!")
|
|
17
|
-
|
|
18
|
-
# Run bot with bot token
|
|
19
|
-
bot.run("<%= bot-token %>")
|
|
20
|
-
|
|
1
|
+
import discord
|
|
2
|
+
from discord.ext import commands
|
|
3
|
+
|
|
4
|
+
# Define bot prefix and create bot instance
|
|
5
|
+
bot_prefix = "!"
|
|
6
|
+
bot = commands.Bot(command_prefix=bot_prefix)
|
|
7
|
+
|
|
8
|
+
# Define bot events
|
|
9
|
+
@bot.event
|
|
10
|
+
async def on_ready():
|
|
11
|
+
print(f"Logged in as {bot.user.name} ({bot.user.id})")
|
|
12
|
+
|
|
13
|
+
# Define bot commands
|
|
14
|
+
@bot.command()
|
|
15
|
+
async def ping(ctx):
|
|
16
|
+
await ctx.send("Pong!")
|
|
17
|
+
|
|
18
|
+
# Run bot with bot token
|
|
19
|
+
bot.run("<%= bot-token %>")
|
|
20
|
+
|
|
21
21
|
# For more information on how to use discord.py, visit https://discordpy.readthedocs.io/en/latest/
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"token":"<%= bot-token %>"
|
|
1
|
+
{
|
|
2
|
+
"token":"<%= bot-token %>"
|
|
3
3
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "<%= bot-name %>",
|
|
3
|
-
"displayName": "<%= bot-name %>",
|
|
4
|
-
"description": "Please enter a brief description here",
|
|
5
|
-
"version": "1.0.0",
|
|
6
|
-
"main": "./src/index.ts",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"start": "tsc && node ./dist/src/index.js",
|
|
9
|
-
"watch": "tsc -w",
|
|
10
|
-
"build": "tsc"
|
|
11
|
-
},
|
|
12
|
-
"dependencies": {
|
|
13
|
-
"discord.js": "^13.13.1",
|
|
14
|
-
"typescript": "^4.9.5"
|
|
15
|
-
}
|
|
16
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "<%= bot-name %>",
|
|
3
|
+
"displayName": "<%= bot-name %>",
|
|
4
|
+
"description": "Please enter a brief description here",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"main": "./src/index.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"start": "tsc && node ./dist/src/index.js",
|
|
9
|
+
"watch": "tsc -w",
|
|
10
|
+
"build": "tsc"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"discord.js": "^13.13.1",
|
|
14
|
+
"typescript": "^4.9.5"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -1,27 +1,42 @@
|
|
|
1
|
-
import { Client, Intents } from 'discord.js';
|
|
2
|
-
import { token } from '../config.json';
|
|
3
|
-
|
|
4
|
-
// Create a new client instance with Intents that specify which privileged intents your bot requires
|
|
5
|
-
const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
client.
|
|
9
|
-
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
//
|
|
17
|
-
if
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
//
|
|
1
|
+
import { Client, Intents } from 'discord.js';
|
|
2
|
+
import { token } from '../config.json';
|
|
3
|
+
|
|
4
|
+
// Create a new client instance with Intents that specify which privileged intents your bot requires
|
|
5
|
+
const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] });
|
|
6
|
+
const prefix = '!';
|
|
7
|
+
|
|
8
|
+
// Run this code when the client is ready. This event will only trigger one time after logging in
|
|
9
|
+
client.once('ready', () => {
|
|
10
|
+
console.log(`Bot is logged in as ${client.user.tag}.`);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
// Listen for messages
|
|
15
|
+
client.on('messageCreate', async message => {
|
|
16
|
+
// Ignore messages that don't start with the prefix or are from a bot
|
|
17
|
+
if(!message.content.startsWith(prefix) || message.author.bot) return;
|
|
18
|
+
|
|
19
|
+
// Split the message into command and arguments
|
|
20
|
+
const args = message.content.slice(prefix.length).trim().split(/ +/);
|
|
21
|
+
const command = args.shift()?.toLowerCase();
|
|
22
|
+
|
|
23
|
+
// ping - bot will reply with Pong!
|
|
24
|
+
if(command === 'ping') {
|
|
25
|
+
await message.reply('Pong!');
|
|
26
|
+
}
|
|
27
|
+
// say <message> - bot will send the message
|
|
28
|
+
else if(command === 'say') {
|
|
29
|
+
if(!args.length) {
|
|
30
|
+
await message.channel.send(`You didn't provide any arguments, ${message.author}!`);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
await message.channel.send(args.join(' '));
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
// Login to Discord with your app's token
|
|
40
|
+
client.login(token);
|
|
41
|
+
|
|
42
|
+
// For more information about the Discord.js library, visit https://discord.js.org/#/docs/main/stable/general/welcome∏
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES6",
|
|
4
|
-
"module": "commonjs",
|
|
5
|
-
"lib": ["ESNext"],
|
|
6
|
-
"sourceMap": true,
|
|
7
|
-
"outDir": "dist",
|
|
8
|
-
"strict": false,
|
|
9
|
-
"noUnusedLocals": true,
|
|
10
|
-
"noImplicitReturns": true,
|
|
11
|
-
"moduleResolution": "node",
|
|
12
|
-
"esModuleInterop": true,
|
|
13
|
-
"skipLibCheck": true,
|
|
14
|
-
"resolveJsonModule": true,
|
|
15
|
-
"forceConsistentCasingInFileNames": true
|
|
16
|
-
},
|
|
17
|
-
"include": [
|
|
18
|
-
"src/**/*.ts",
|
|
19
|
-
],
|
|
20
|
-
"exclude": [
|
|
21
|
-
"dist",
|
|
22
|
-
"node_modules"
|
|
23
|
-
]
|
|
24
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES6",
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"lib": ["ESNext"],
|
|
6
|
+
"sourceMap": true,
|
|
7
|
+
"outDir": "dist",
|
|
8
|
+
"strict": false,
|
|
9
|
+
"noUnusedLocals": true,
|
|
10
|
+
"noImplicitReturns": true,
|
|
11
|
+
"moduleResolution": "node",
|
|
12
|
+
"esModuleInterop": true,
|
|
13
|
+
"skipLibCheck": true,
|
|
14
|
+
"resolveJsonModule": true,
|
|
15
|
+
"forceConsistentCasingInFileNames": true
|
|
16
|
+
},
|
|
17
|
+
"include": [
|
|
18
|
+
"src/**/*.ts",
|
|
19
|
+
],
|
|
20
|
+
"exclude": [
|
|
21
|
+
"dist",
|
|
22
|
+
"node_modules"
|
|
23
|
+
]
|
|
24
|
+
}
|