+1
-2
.env.template
+1
-2
.env.template
+7
.gitignore
+7
.gitignore
+7
Dockerfile
+7
Dockerfile
-15
README.md
-15
README.md
-80
bun.lock
-80
bun.lock
···
1
-
{
2
-
"lockfileVersion": 1,
3
-
"workspaces": {
4
-
"": {
5
-
"name": "discord",
6
-
"dependencies": {
7
-
"@types/mime": "^4.0.0",
8
-
"discord.js": "^14.18.0",
9
-
"mime": "^4.0.6",
10
-
},
11
-
"devDependencies": {
12
-
"@types/bun": "latest",
13
-
},
14
-
"peerDependencies": {
15
-
"typescript": "^5",
16
-
},
17
-
},
18
-
},
19
-
"packages": {
20
-
"@discordjs/builders": ["@discordjs/builders@1.10.1", "", { "dependencies": { "@discordjs/formatters": "^0.6.0", "@discordjs/util": "^1.1.1", "@sapphire/shapeshift": "^4.0.0", "discord-api-types": "^0.37.119", "fast-deep-equal": "^3.1.3", "ts-mixer": "^6.0.4", "tslib": "^2.6.3" } }, "sha512-OWo1fY4ztL1/M/DUyRPShB4d/EzVfuUvPTRRHRIt/YxBrUYSz0a+JicD5F5zHFoNs2oTuWavxCOVFV1UljHTng=="],
21
-
22
-
"@discordjs/collection": ["@discordjs/collection@1.5.3", "", {}, "sha512-SVb428OMd3WO1paV3rm6tSjM4wC+Kecaa1EUGX7vc6/fddvw/6lg90z4QtCqm21zvVe92vMMDt9+DkIvjXImQQ=="],
23
-
24
-
"@discordjs/formatters": ["@discordjs/formatters@0.6.0", "", { "dependencies": { "discord-api-types": "^0.37.114" } }, "sha512-YIruKw4UILt/ivO4uISmrGq2GdMY6EkoTtD0oS0GvkJFRZbTSdPhzYiUILbJ/QslsvC9H9nTgGgnarnIl4jMfw=="],
25
-
26
-
"@discordjs/rest": ["@discordjs/rest@2.4.3", "", { "dependencies": { "@discordjs/collection": "^2.1.1", "@discordjs/util": "^1.1.1", "@sapphire/async-queue": "^1.5.3", "@sapphire/snowflake": "^3.5.3", "@vladfrangu/async_event_emitter": "^2.4.6", "discord-api-types": "^0.37.119", "magic-bytes.js": "^1.10.0", "tslib": "^2.6.3", "undici": "6.21.1" } }, "sha512-+SO4RKvWsM+y8uFHgYQrcTl/3+cY02uQOH7/7bKbVZsTfrfpoE62o5p+mmV+s7FVhTX82/kQUGGbu4YlV60RtA=="],
27
-
28
-
"@discordjs/util": ["@discordjs/util@1.1.1", "", {}, "sha512-eddz6UnOBEB1oITPinyrB2Pttej49M9FZQY8NxgEvc3tq6ZICZ19m70RsmzRdDHk80O9NoYN/25AqJl8vPVf/g=="],
29
-
30
-
"@discordjs/ws": ["@discordjs/ws@1.2.1", "", { "dependencies": { "@discordjs/collection": "^2.1.0", "@discordjs/rest": "^2.4.3", "@discordjs/util": "^1.1.0", "@sapphire/async-queue": "^1.5.2", "@types/ws": "^8.5.10", "@vladfrangu/async_event_emitter": "^2.2.4", "discord-api-types": "^0.37.119", "tslib": "^2.6.2", "ws": "^8.17.0" } }, "sha512-PBvenhZG56a6tMWF/f4P6f4GxZKJTBG95n7aiGSPTnodmz4N5g60t79rSIAq7ywMbv8A4jFtexMruH+oe51aQQ=="],
31
-
32
-
"@sapphire/async-queue": ["@sapphire/async-queue@1.5.5", "", {}, "sha512-cvGzxbba6sav2zZkH8GPf2oGk9yYoD5qrNWdu9fRehifgnFZJMV+nuy2nON2roRO4yQQ+v7MK/Pktl/HgfsUXg=="],
33
-
34
-
"@sapphire/shapeshift": ["@sapphire/shapeshift@4.0.0", "", { "dependencies": { "fast-deep-equal": "^3.1.3", "lodash": "^4.17.21" } }, "sha512-d9dUmWVA7MMiKobL3VpLF8P2aeanRTu6ypG2OIaEv/ZHH/SUQ2iHOVyi5wAPjQ+HmnMuL0whK9ez8I/raWbtIg=="],
35
-
36
-
"@sapphire/snowflake": ["@sapphire/snowflake@3.5.3", "", {}, "sha512-jjmJywLAFoWeBi1W7994zZyiNWPIiqRRNAmSERxyg93xRGzNYvGjlZ0gR6x0F4gPRi2+0O6S71kOZYyr3cxaIQ=="],
37
-
38
-
"@types/bun": ["@types/bun@1.2.4", "", { "dependencies": { "bun-types": "1.2.4" } }, "sha512-QtuV5OMR8/rdKJs213iwXDpfVvnskPXY/S0ZiFbsTjQZycuqPbMW8Gf/XhLfwE5njW8sxI2WjISURXPlHypMFA=="],
39
-
40
-
"@types/mime": ["@types/mime@4.0.0", "", { "dependencies": { "mime": "*" } }, "sha512-5eEkJZ/BLvTE3vXGKkWlyTSUVZuzj23Wj8PoyOq2lt5I3CYbiLBOPb3XmCW6QcuOibIUE6emHXHt9E/F/rCa6w=="],
41
-
42
-
"@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="],
43
-
44
-
"@types/ws": ["@types/ws@8.5.14", "", { "dependencies": { "@types/node": "*" } }, "sha512-bd/YFLW+URhBzMXurx7lWByOu+xzU9+kb3RboOteXYDfW+tr+JZa99OyNmPINEGB/ahzKrEuc8rcv4gnpJmxTw=="],
45
-
46
-
"@vladfrangu/async_event_emitter": ["@vladfrangu/async_event_emitter@2.4.6", "", {}, "sha512-RaI5qZo6D2CVS6sTHFKg1v5Ohq/+Bo2LZ5gzUEwZ/WkHhwtGTCB/sVLw8ijOkAUxasZ+WshN/Rzj4ywsABJ5ZA=="],
47
-
48
-
"bun-types": ["bun-types@1.2.4", "", { "dependencies": { "@types/node": "*", "@types/ws": "~8.5.10" } }, "sha512-nDPymR207ZZEoWD4AavvEaa/KZe/qlrbMSchqpQwovPZCKc7pwMoENjEtHgMKaAjJhy+x6vfqSBA1QU3bJgs0Q=="],
49
-
50
-
"discord-api-types": ["discord-api-types@0.37.119", "", {}, "sha512-WasbGFXEB+VQWXlo6IpW3oUv73Yuau1Ig4AZF/m13tXcTKnMpc/mHjpztIlz4+BM9FG9BHQkEXiPto3bKduQUg=="],
51
-
52
-
"discord.js": ["discord.js@14.18.0", "", { "dependencies": { "@discordjs/builders": "^1.10.1", "@discordjs/collection": "1.5.3", "@discordjs/formatters": "^0.6.0", "@discordjs/rest": "^2.4.3", "@discordjs/util": "^1.1.1", "@discordjs/ws": "^1.2.1", "@sapphire/snowflake": "3.5.3", "discord-api-types": "^0.37.119", "fast-deep-equal": "3.1.3", "lodash.snakecase": "4.1.1", "tslib": "^2.6.3", "undici": "6.21.1" } }, "sha512-SvU5kVUvwunQhN2/+0t55QW/1EHfB1lp0TtLZUSXVHDmyHTrdOj5LRKdR0zLcybaA15F+NtdWuWmGOX9lE+CAw=="],
53
-
54
-
"fast-deep-equal": ["fast-deep-equal@3.1.3", "", {}, "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="],
55
-
56
-
"lodash": ["lodash@4.17.21", "", {}, "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="],
57
-
58
-
"lodash.snakecase": ["lodash.snakecase@4.1.1", "", {}, "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw=="],
59
-
60
-
"magic-bytes.js": ["magic-bytes.js@1.10.0", "", {}, "sha512-/k20Lg2q8LE5xiaaSkMXk4sfvI+9EGEykFS4b0CHHGWqDYU0bGUFSwchNOMA56D7TCs9GwVTkqe9als1/ns8UQ=="],
61
-
62
-
"mime": ["mime@4.0.6", "", { "bin": { "mime": "bin/cli.js" } }, "sha512-4rGt7rvQHBbaSOF9POGkk1ocRP16Md1x36Xma8sz8h8/vfCUI2OtEIeCqe4Ofes853x4xDoPiFLIT47J5fI/7A=="],
63
-
64
-
"ts-mixer": ["ts-mixer@6.0.4", "", {}, "sha512-ufKpbmrugz5Aou4wcr5Wc1UUFWOLhq+Fm6qa6P0w0K5Qw2yhaUoiWszhCVuNQyNwrlGiscHOmqYoAox1PtvgjA=="],
65
-
66
-
"tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
67
-
68
-
"typescript": ["typescript@5.8.2", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ=="],
69
-
70
-
"undici": ["undici@6.21.1", "", {}, "sha512-q/1rj5D0/zayJB2FraXdaWxbhWiNKDvu8naDT2dl1yTlvJp4BLtOcp2a5BvgGNQpYYJzau7tf1WgKv3b+7mqpQ=="],
71
-
72
-
"undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="],
73
-
74
-
"ws": ["ws@8.18.1", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-RKW2aJZMXeMxVpnZ6bck+RswznaxmzdULiBr6KY7XkTnW8uvt0iT9H5DkHUChXrc+uurzwa0rVI16n/Xzjdz1w=="],
75
-
76
-
"@discordjs/rest/@discordjs/collection": ["@discordjs/collection@2.1.1", "", {}, "sha512-LiSusze9Tc7qF03sLCujF5iZp7K+vRNEDBZ86FT9aQAv3vxMLihUvKvpsCWiQ2DJq1tVckopKm1rxomgNUc9hg=="],
77
-
78
-
"@discordjs/ws/@discordjs/collection": ["@discordjs/collection@2.1.1", "", {}, "sha512-LiSusze9Tc7qF03sLCujF5iZp7K+vRNEDBZ86FT9aQAv3vxMLihUvKvpsCWiQ2DJq1tVckopKm1rxomgNUc9hg=="],
79
-
}
80
-
}
+12
deno.json
+12
deno.json
···
1
+
{
2
+
"tasks": {
3
+
"dev": "deno run --watch --env-file --allow-env --allow-read=./ --allow-net=discord.com,gateway.discord.gg,cdn.discordapp.com src/index.ts",
4
+
"main": "deno run --env-file --allow-env --allow-read=./ --allow-net=discord.com,gateway.discord.gg,cdn.discordapp.com src/index.ts",
5
+
"sync": "deno run --env-file --allow-env --allow-read=./src --allow-net=discord.com src/sync.js"
6
+
},
7
+
"imports": {
8
+
"@std/assert": "jsr:@std/assert@1",
9
+
"discord.js": "npm:discord.js@^14.25.1",
10
+
"mime": "npm:mime@^4.1.0"
11
+
}
12
+
}
+167
deno.lock
+167
deno.lock
···
1
+
{
2
+
"version": "5",
3
+
"specifiers": {
4
+
"jsr:@std/assert@1": "1.0.16",
5
+
"jsr:@std/internal@^1.0.12": "1.0.12",
6
+
"npm:discord.js@^14.25.1": "14.25.1",
7
+
"npm:mime@^4.1.0": "4.1.0"
8
+
},
9
+
"jsr": {
10
+
"@std/assert@1.0.16": {
11
+
"integrity": "6a7272ed1eaa77defe76e5ff63ca705d9c495077e2d5fd0126d2b53fc5bd6532",
12
+
"dependencies": [
13
+
"jsr:@std/internal"
14
+
]
15
+
},
16
+
"@std/internal@1.0.12": {
17
+
"integrity": "972a634fd5bc34b242024402972cd5143eac68d8dffaca5eaa4dba30ce17b027"
18
+
}
19
+
},
20
+
"npm": {
21
+
"@discordjs/builders@1.13.1": {
22
+
"integrity": "sha512-cOU0UDHc3lp/5nKByDxkmRiNZBpdp0kx55aarbiAfakfKJHlxv/yFW1zmIqCAmwH5CRlrH9iMFKJMpvW4DPB+w==",
23
+
"dependencies": [
24
+
"@discordjs/formatters",
25
+
"@discordjs/util",
26
+
"@sapphire/shapeshift",
27
+
"discord-api-types",
28
+
"fast-deep-equal",
29
+
"ts-mixer",
30
+
"tslib"
31
+
]
32
+
},
33
+
"@discordjs/collection@1.5.3": {
34
+
"integrity": "sha512-SVb428OMd3WO1paV3rm6tSjM4wC+Kecaa1EUGX7vc6/fddvw/6lg90z4QtCqm21zvVe92vMMDt9+DkIvjXImQQ=="
35
+
},
36
+
"@discordjs/collection@2.1.1": {
37
+
"integrity": "sha512-LiSusze9Tc7qF03sLCujF5iZp7K+vRNEDBZ86FT9aQAv3vxMLihUvKvpsCWiQ2DJq1tVckopKm1rxomgNUc9hg=="
38
+
},
39
+
"@discordjs/formatters@0.6.2": {
40
+
"integrity": "sha512-y4UPwWhH6vChKRkGdMB4odasUbHOUwy7KL+OVwF86PvT6QVOwElx+TiI1/6kcmcEe+g5YRXJFiXSXUdabqZOvQ==",
41
+
"dependencies": [
42
+
"discord-api-types"
43
+
]
44
+
},
45
+
"@discordjs/rest@2.6.0": {
46
+
"integrity": "sha512-RDYrhmpB7mTvmCKcpj+pc5k7POKszS4E2O9TYc+U+Y4iaCP+r910QdO43qmpOja8LRr1RJ0b3U+CqVsnPqzf4w==",
47
+
"dependencies": [
48
+
"@discordjs/collection@2.1.1",
49
+
"@discordjs/util",
50
+
"@sapphire/async-queue",
51
+
"@sapphire/snowflake",
52
+
"@vladfrangu/async_event_emitter",
53
+
"discord-api-types",
54
+
"magic-bytes.js",
55
+
"tslib",
56
+
"undici"
57
+
]
58
+
},
59
+
"@discordjs/util@1.2.0": {
60
+
"integrity": "sha512-3LKP7F2+atl9vJFhaBjn4nOaSWahZ/yWjOvA4e5pnXkt2qyXRCHLxoBQy81GFtLGCq7K9lPm9R517M1U+/90Qg==",
61
+
"dependencies": [
62
+
"discord-api-types"
63
+
]
64
+
},
65
+
"@discordjs/ws@1.2.3": {
66
+
"integrity": "sha512-wPlQDxEmlDg5IxhJPuxXr3Vy9AjYq5xCvFWGJyD7w7Np8ZGu+Mc+97LCoEc/+AYCo2IDpKioiH0/c/mj5ZR9Uw==",
67
+
"dependencies": [
68
+
"@discordjs/collection@2.1.1",
69
+
"@discordjs/rest",
70
+
"@discordjs/util",
71
+
"@sapphire/async-queue",
72
+
"@types/ws",
73
+
"@vladfrangu/async_event_emitter",
74
+
"discord-api-types",
75
+
"tslib",
76
+
"ws"
77
+
]
78
+
},
79
+
"@sapphire/async-queue@1.5.5": {
80
+
"integrity": "sha512-cvGzxbba6sav2zZkH8GPf2oGk9yYoD5qrNWdu9fRehifgnFZJMV+nuy2nON2roRO4yQQ+v7MK/Pktl/HgfsUXg=="
81
+
},
82
+
"@sapphire/shapeshift@4.0.0": {
83
+
"integrity": "sha512-d9dUmWVA7MMiKobL3VpLF8P2aeanRTu6ypG2OIaEv/ZHH/SUQ2iHOVyi5wAPjQ+HmnMuL0whK9ez8I/raWbtIg==",
84
+
"dependencies": [
85
+
"fast-deep-equal",
86
+
"lodash"
87
+
]
88
+
},
89
+
"@sapphire/snowflake@3.5.3": {
90
+
"integrity": "sha512-jjmJywLAFoWeBi1W7994zZyiNWPIiqRRNAmSERxyg93xRGzNYvGjlZ0gR6x0F4gPRi2+0O6S71kOZYyr3cxaIQ=="
91
+
},
92
+
"@types/node@22.15.15": {
93
+
"integrity": "sha512-R5muMcZob3/Jjchn5LcO8jdKwSCbzqmPB6ruBxMcf9kbxtniZHP327s6C37iOfuw8mbKK3cAQa7sEl7afLrQ8A==",
94
+
"dependencies": [
95
+
"undici-types"
96
+
]
97
+
},
98
+
"@types/ws@8.18.1": {
99
+
"integrity": "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==",
100
+
"dependencies": [
101
+
"@types/node"
102
+
]
103
+
},
104
+
"@vladfrangu/async_event_emitter@2.4.7": {
105
+
"integrity": "sha512-Xfe6rpCTxSxfbswi/W/Pz7zp1WWSNn4A0eW4mLkQUewCrXXtMj31lCg+iQyTkh/CkusZSq9eDflu7tjEDXUY6g=="
106
+
},
107
+
"discord-api-types@0.38.36": {
108
+
"integrity": "sha512-qrbUbjjwtyeBg5HsAlm1C859epfOyiLjPqAOzkdWlCNsZCWJrertnETF/NwM8H+waMFU58xGSc5eXUfXah+WTQ=="
109
+
},
110
+
"discord.js@14.25.1": {
111
+
"integrity": "sha512-2l0gsPOLPs5t6GFZfQZKnL1OJNYFcuC/ETWsW4VtKVD/tg4ICa9x+jb9bkPffkMdRpRpuUaO/fKkHCBeiCKh8g==",
112
+
"dependencies": [
113
+
"@discordjs/builders",
114
+
"@discordjs/collection@1.5.3",
115
+
"@discordjs/formatters",
116
+
"@discordjs/rest",
117
+
"@discordjs/util",
118
+
"@discordjs/ws",
119
+
"@sapphire/snowflake",
120
+
"discord-api-types",
121
+
"fast-deep-equal",
122
+
"lodash.snakecase",
123
+
"magic-bytes.js",
124
+
"tslib",
125
+
"undici"
126
+
]
127
+
},
128
+
"fast-deep-equal@3.1.3": {
129
+
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
130
+
},
131
+
"lodash.snakecase@4.1.1": {
132
+
"integrity": "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw=="
133
+
},
134
+
"lodash@4.17.21": {
135
+
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
136
+
},
137
+
"magic-bytes.js@1.12.1": {
138
+
"integrity": "sha512-ThQLOhN86ZkJ7qemtVRGYM+gRgR8GEXNli9H/PMvpnZsE44Xfh3wx9kGJaldg314v85m+bFW6WBMaVHJc/c3zA=="
139
+
},
140
+
"mime@4.1.0": {
141
+
"integrity": "sha512-X5ju04+cAzsojXKes0B/S4tcYtFAJ6tTMuSPBEn9CPGlrWr8Fiw7qYeLT0XyH80HSoAoqWCaz+MWKh22P7G1cw==",
142
+
"bin": true
143
+
},
144
+
"ts-mixer@6.0.4": {
145
+
"integrity": "sha512-ufKpbmrugz5Aou4wcr5Wc1UUFWOLhq+Fm6qa6P0w0K5Qw2yhaUoiWszhCVuNQyNwrlGiscHOmqYoAox1PtvgjA=="
146
+
},
147
+
"tslib@2.8.1": {
148
+
"integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="
149
+
},
150
+
"undici-types@6.21.0": {
151
+
"integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="
152
+
},
153
+
"undici@6.21.3": {
154
+
"integrity": "sha512-gBLkYIlEnSp8pFbT64yFgGE6UIB9tAkhukC23PmMDCe5Nd+cRqKxSjw5y54MK2AZMgZfJWMaNE4nYUHgi1XEOw=="
155
+
},
156
+
"ws@8.18.3": {
157
+
"integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg=="
158
+
}
159
+
},
160
+
"workspace": {
161
+
"dependencies": [
162
+
"jsr:@std/assert@1",
163
+
"npm:discord.js@^14.25.1",
164
+
"npm:mime@^4.1.0"
165
+
]
166
+
}
167
+
}
-21
package.json
-21
package.json
···
1
-
{
2
-
"name": "discord",
3
-
"module": "index.ts",
4
-
"type": "module",
5
-
"private": true,
6
-
"scripts": {
7
-
"dev": "bun --watch src/index.ts",
8
-
"commands:sync": "bun src/sync.js"
9
-
},
10
-
"devDependencies": {
11
-
"@types/bun": "latest"
12
-
},
13
-
"peerDependencies": {
14
-
"typescript": "^5"
15
-
},
16
-
"dependencies": {
17
-
"@types/mime": "^4.0.0",
18
-
"discord.js": "^14.18.0",
19
-
"mime": "^4.0.6"
20
-
}
21
-
}
+5
-5
src/commands/dong/create.ts
+5
-5
src/commands/dong/create.ts
···
1
1
import {
2
-
Attachment,
3
2
AttachmentBuilder,
4
3
ChatInputCommandInteraction,
5
4
SlashCommandBuilder,
6
5
} from "discord.js";
7
-
import type { customClient } from "../..";
8
-
import { createDong } from "../../lib/dong-io";
9
-
import { download } from "../../lib/download";
6
+
import type { customClient } from "../../index.ts";
7
+
import { createDong } from "../../lib/dong-io.ts";
8
+
import { download } from "../../lib/download.ts";
9
+
import { Buffer } from "node:buffer";
10
10
11
11
export const data = new SlashCommandBuilder()
12
12
.setName("create")
···
47
47
48
48
await interaction.deferReply();
49
49
50
-
let downloaded = {
50
+
const downloaded = {
51
51
image: await download(image),
52
52
audio: await download(audio),
53
53
};
+5
-4
src/commands/dong/open.ts
+5
-4
src/commands/dong/open.ts
···
4
4
MessageFlags,
5
5
SlashCommandBuilder,
6
6
} from "discord.js";
7
-
import type { customClient } from "../..";
8
-
import { download } from "../../lib/download";
9
-
import { readDong } from "../../lib/dong-io";
7
+
import type { customClient } from "../../index.ts";
8
+
import { download } from "../../lib/download.ts";
9
+
import { readDong } from "../../lib/dong-io.ts";
10
10
import { Mime } from "mime";
11
11
import standardTypes from "mime/types/standard.js";
12
12
import otherTypes from "mime/types/other.js";
13
+
import { Buffer } from "node:buffer";
13
14
14
15
const mime = new Mime(standardTypes, otherTypes);
15
16
mime.define({ "audio/mpeg": ["mp3"] });
···
24
25
interaction: ChatInputCommandInteraction & { client: customClient }
25
26
) => {
26
27
const dong = interaction.options.getAttachment("dong", true);
27
-
await interaction.deferReply({flags: MessageFlags.Ephemeral});
28
+
await interaction.deferReply({ flags: MessageFlags.Ephemeral });
28
29
29
30
const downloadedDong = await download(dong);
30
31
+2
-5
src/commands/util/ping.ts
+2
-5
src/commands/util/ping.ts
···
1
-
import {
2
-
ChatInputCommandInteraction,
3
-
SlashCommandBuilder,
4
-
} from "discord.js";
5
-
import type { customClient } from "../..";
1
+
import { ChatInputCommandInteraction, SlashCommandBuilder } from "discord.js";
2
+
import type { customClient } from "../../index.ts";
6
3
7
4
export const data = new SlashCommandBuilder()
8
5
.setName("ping")
+13
-5
src/index.ts
+13
-5
src/index.ts
···
7
7
MessageFlags,
8
8
type Interaction,
9
9
} from "discord.js";
10
-
import { Glob } from "bun";
10
+
import { glob } from "node:fs/promises";
11
11
12
-
const token = process.env.token;
12
+
const token = Deno.env.get("TOKEN");
13
13
if (!token) throw new Error("Token required. Please fill in TOKEN in .env");
14
14
console.log("Token Valid!");
15
+
16
+
const __dirname = import.meta.dirname;
15
17
16
18
// client typing
17
19
export type customClient = Client & {
···
34
36
35
37
// setup commands
36
38
client.commands = new Collection();
37
-
const commandGlob = new Glob("**/*.ts");
38
-
for await (const file of commandGlob.scan("./src/commands")) {
39
-
const command = await import("./commands/" + file);
39
+
for await (const file of glob("src/commands/**/*.ts", {
40
+
exclude: ["node_modules"],
41
+
})) {
42
+
console.log(file);
43
+
const command = await import(`../${file}`);
40
44
// check command contains all required properties
41
45
if (
42
46
"data" in command &&
···
70
74
console.error(`No command ${interaction.commandName}`);
71
75
return;
72
76
}
77
+
78
+
console.log(
79
+
`Got command /${interaction.commandName} from @${interaction.user.username}`
80
+
);
73
81
74
82
try {
75
83
await command.execute(interaction);
+1
-12
src/lib/dong-io.ts
+1
-12
src/lib/dong-io.ts
···
4
4
}
5
5
}
6
6
7
-
const blobBytes = async (blob: Blob) => {
7
+
const blobBytes = (blob: Blob) => {
8
8
if ("bytes" in blob) return blob.bytes();
9
9
return new Response(blob).arrayBuffer().then((buffer) => {
10
10
const uint = new Uint8Array(buffer);
···
107
107
},
108
108
};
109
109
}
110
-
111
-
export const download = (file: File) => {
112
-
const url = URL.createObjectURL(file);
113
-
const a = document.createElement("a");
114
-
a.href = url;
115
-
a.download = file.name;
116
-
document.body.appendChild(a);
117
-
a.click();
118
-
document.body.removeChild(a);
119
-
URL.revokeObjectURL(url);
120
-
};
+12
-8
src/sync.js
+12
-8
src/sync.js
···
1
-
const { REST, Routes } = require("discord.js");
2
-
const { client: clientId, guild: guildId, token } = process.env;
3
-
const fs = require("node:fs");
4
-
const path = require("node:path");
1
+
import { REST, Routes } from "discord.js";
2
+
import fs from "node:fs";
3
+
import path from "node:path";
4
+
5
+
const clientId = Deno.env.get("CLIENT");
6
+
const token = Deno.env.get("TOKEN");
7
+
if (!clientId) throw "CLIENT not defined";
8
+
if (!token) throw "TOKEN not defined";
5
9
6
10
const commands = [];
7
11
// Grab all the command folders from the commands directory you created earlier
8
-
const foldersPath = path.join(__dirname, "commands");
12
+
const foldersPath = path.join(import.meta.dirname, "commands");
9
13
const commandFolders = fs.readdirSync(foldersPath);
10
14
11
15
for (const folder of commandFolders) {
···
17
21
// Grab the SlashCommandBuilder#toJSON() output of each command's data for deployment
18
22
for (const file of commandFiles) {
19
23
const filePath = path.join(commandsPath, file);
20
-
const command = require(filePath);
24
+
const command = await import(filePath);
21
25
if ("data" in command && "execute" in command) {
22
26
commands.push(command.data.toJSON());
23
27
} else {
···
38
42
`Started refreshing ${commands.length} application (/) commands.`
39
43
);
40
44
41
-
// The put method is used to fully refresh all commands in the guild with the current set
42
-
const data = await rest.put(Routes.applicationGuildCommands(clientId, guildId), {
45
+
// The put method is used to fully refresh all commands with the current set
46
+
const data = await rest.put(Routes.applicationCommands(clientId), {
43
47
body: commands,
44
48
});
45
49
-27
tsconfig.json
-27
tsconfig.json
···
1
-
{
2
-
"compilerOptions": {
3
-
// Enable latest features
4
-
"lib": ["ESNext", "DOM"],
5
-
"target": "ESNext",
6
-
"module": "ESNext",
7
-
"moduleDetection": "force",
8
-
"jsx": "react-jsx",
9
-
"allowJs": true,
10
-
11
-
// Bundler mode
12
-
"moduleResolution": "bundler",
13
-
"allowImportingTsExtensions": true,
14
-
"verbatimModuleSyntax": true,
15
-
"noEmit": true,
16
-
17
-
// Best practices
18
-
"strict": true,
19
-
"skipLibCheck": true,
20
-
"noFallthroughCasesInSwitch": true,
21
-
22
-
// Some stricter flags (disabled by default)
23
-
"noUnusedLocals": false,
24
-
"noUnusedParameters": false,
25
-
"noPropertyAccessFromIndexSignature": false
26
-
}
27
-
}