generator-discord 1.2.1 → 1.2.2
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/package.json +8 -9
- package/templates/python/bot.py +13 -14
- package/test/generator.test.ts +13 -14
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "generator-discord",
|
|
3
3
|
"displayName": "Generator-Discord",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.2",
|
|
5
5
|
"main": "./app/index.js",
|
|
6
6
|
"description": "Yeoman generator for Discord.js",
|
|
7
7
|
"keywords": [
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"build": "tsc",
|
|
15
15
|
"watch": "tsc -w",
|
|
16
16
|
"test": "vitest run",
|
|
17
|
-
"debug": "npx --node-arg=--inspect yo discord"
|
|
17
|
+
"debug": "npx --node-arg=--inspect yo discord",
|
|
18
|
+
"clean": "npx rimraf app && npx rimraf node_modules"
|
|
18
19
|
},
|
|
19
20
|
"files": [
|
|
20
21
|
"app",
|
|
@@ -34,14 +35,12 @@
|
|
|
34
35
|
},
|
|
35
36
|
"homepage": "https://github.com/emilkrebs/Generator-Discord",
|
|
36
37
|
"dependencies": {
|
|
37
|
-
"typescript": "^
|
|
38
|
-
"yeoman-generator": "^5.
|
|
38
|
+
"typescript": "^5.1.6",
|
|
39
|
+
"yeoman-generator": "^5.9.0"
|
|
39
40
|
},
|
|
40
41
|
"devDependencies": {
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"yeoman-test": "
|
|
44
|
-
"dotenv": "^16.0.3",
|
|
45
|
-
"vitest": "^0.29.2"
|
|
42
|
+
"dotenv": "^16.3.1",
|
|
43
|
+
"vitest": "^0.34.1",
|
|
44
|
+
"yeoman-test": "^7.4.0"
|
|
46
45
|
}
|
|
47
46
|
}
|
package/templates/python/bot.py
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import discord
|
|
2
|
-
from discord.ext import commands
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
bot = commands.Bot(command_prefix=bot_prefix)
|
|
3
|
+
intents = discord.Intents.default()
|
|
4
|
+
intents.message_content = True
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
client = discord.Client(intents=intents)
|
|
7
|
+
|
|
8
|
+
@client.event
|
|
10
9
|
async def on_ready():
|
|
11
|
-
print(f
|
|
10
|
+
print(f'Bot is logged in as {client.user}')
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
@client.event
|
|
13
|
+
async def on_message(message):
|
|
14
|
+
if message.author == client.user:
|
|
15
|
+
return
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
if message.content.startswith('!ping'):
|
|
18
|
+
await message.channel.send('Pong!')
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
client.run('<%= bot-token %>')
|
package/test/generator.test.ts
CHANGED
|
@@ -57,23 +57,22 @@ const CONFIG_JSON_EXPECTED = normilizeEOL(`{
|
|
|
57
57
|
}`);
|
|
58
58
|
|
|
59
59
|
const BOT_PY_EXPECTED = normilizeEOL(`import discord
|
|
60
|
-
from discord.ext import commands
|
|
61
60
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
bot = commands.Bot(command_prefix=bot_prefix)
|
|
61
|
+
intents = discord.Intents.default()
|
|
62
|
+
intents.message_content = True
|
|
65
63
|
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
client = discord.Client(intents=intents)
|
|
65
|
+
|
|
66
|
+
@client.event
|
|
68
67
|
async def on_ready():
|
|
69
|
-
print(f
|
|
68
|
+
print(f'Bot is logged in as {client.user}')
|
|
70
69
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
@client.event
|
|
71
|
+
async def on_message(message):
|
|
72
|
+
if message.author == client.user:
|
|
73
|
+
return
|
|
75
74
|
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
if message.content.startswith('!ping'):
|
|
76
|
+
await message.channel.send('Pong!')
|
|
78
77
|
|
|
79
|
-
|
|
78
|
+
client.run('xxxx')`);
|