1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-17 00:10:58 -05:00

Compare commits

..

2 Commits

Author SHA1 Message Date
AnxietyisReal
872c835e35 Mentally dying of 9 commands being loaded. 2023-08-07 18:14:08 +10:00
AnxietyisReal
b7bdadc97b Add docker-compose file 2023-08-07 15:36:16 +10:00
7 changed files with 24 additions and 7 deletions

4
.pnp.cjs generated
View File

@ -46,6 +46,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
["systeminformation", "npm:5.18.12"],\ ["systeminformation", "npm:5.18.12"],\
["typescript", "patch:typescript@npm%3A5.1.6#~builtin<compat/typescript>::version=5.1.6&hash=5da071"],\ ["typescript", "patch:typescript@npm%3A5.1.6#~builtin<compat/typescript>::version=5.1.6&hash=5da071"],\
["xml-js", "npm:1.6.11"],\ ["xml-js", "npm:1.6.11"],\
["youtube-sr", "npm:4.3.4"],\
["ytdl-core", "npm:4.11.5"]\ ["ytdl-core", "npm:4.11.5"]\
],\ ],\
"linkType": "SOFT"\ "linkType": "SOFT"\
@ -1035,6 +1036,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
["systeminformation", "npm:5.18.12"],\ ["systeminformation", "npm:5.18.12"],\
["typescript", "patch:typescript@npm%3A5.1.6#~builtin<compat/typescript>::version=5.1.6&hash=5da071"],\ ["typescript", "patch:typescript@npm%3A5.1.6#~builtin<compat/typescript>::version=5.1.6&hash=5da071"],\
["xml-js", "npm:1.6.11"],\ ["xml-js", "npm:1.6.11"],\
["youtube-sr", "npm:4.3.4"],\
["ytdl-core", "npm:4.11.5"]\ ["ytdl-core", "npm:4.11.5"]\
],\ ],\
"linkType": "SOFT"\ "linkType": "SOFT"\
@ -1158,7 +1160,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
["@types/youtube-sr", null],\ ["@types/youtube-sr", null],\
["discord.js", "npm:14.12.1"],\ ["discord.js", "npm:14.12.1"],\
["libsodium-wrappers", "npm:0.7.11"],\ ["libsodium-wrappers", "npm:0.7.11"],\
["youtube-sr", null]\ ["youtube-sr", "npm:4.3.4"]\
],\ ],\
"packagePeers": [\ "packagePeers": [\
"@discord-player/extractor",\ "@discord-player/extractor",\

View File

@ -1,3 +1,6 @@
# main; node:current-alpine3.18
# backup; node:current-bookworm
FROM node:current-alpine3.18 FROM node:current-alpine3.18
WORKDIR /bot WORKDIR /bot
RUN yarn
CMD ["yarn", "node", "dist/index.js"] CMD ["yarn", "node", "dist/index.js"]

9
docker-compose.yml Normal file
View File

@ -0,0 +1,9 @@
version: '3'
services:
bot:
container_name: 'Daggerbot'
image: 'git.toast-server.net/toast/daggerbot-ts:alpine3.18'
volumes:
- .:/bot
network_mode: host

View File

@ -39,10 +39,11 @@
"moment": "2.29.4", "moment": "2.29.4",
"mongoose": "7.4.2", "mongoose": "7.4.2",
"ms": "2.1.3", "ms": "2.1.3",
"prism-media": "^1.3.5", "prism-media": "1.3.5",
"systeminformation": "5.18.12", "systeminformation": "5.18.12",
"typescript": "5.1.6", "typescript": "5.1.6",
"xml-js": "1.6.11", "xml-js": "1.6.11",
"youtube-sr": "4.3.4",
"ytdl-core": "4.11.5" "ytdl-core": "4.11.5"
}, },
"devDependencies": { "devDependencies": {

View File

@ -107,12 +107,12 @@ export default class TClient extends Client {
for await (const file of readdirSync('dist/events')){ for await (const file of readdirSync('dist/events')){
const eventFile = await import(`./events/${file}`); const eventFile = await import(`./events/${file}`);
this.on(file.replace('.js',''), async(...args)=>eventFile.default.run(this,...args)) this.on(file.replace('.js',''), async(...args)=>eventFile.default.run(this,...args))
}; }
for await (const file of readdirSync('dist/commands')){ for await (const file of readdirSync('dist/commands')){
const command = await import(`./commands/${file}`); const command = await import(`./commands/${file}`);
this.commands.set(command.default.data.name,{command, uses: 0}); this.commands.set(command.default.data.name,{command, uses: 0});
this.registry.push(command.default.data.toJSON()) this.registry.push(command.default.data.toJSON())
}; }
} }
formatTime(integer: number, accuracy = 1, options?: formatTimeOpt){ formatTime(integer: number, accuracy = 1, options?: formatTimeOpt){
let achievedAccuracy = 0; let achievedAccuracy = 0;

View File

@ -16,6 +16,7 @@ client.on('ready', async()=>{
},300000) },300000)
}); });
if (client.config.botSwitches.registerCommands){ if (client.config.botSwitches.registerCommands){
console.log('Total commands: '+client.registry.length) //Debugging reasons.
client.config.whitelistedServers.forEach(guildId=>(client.guilds.cache.get(guildId) as Discord.Guild).commands.set(client.registry).catch((e:Error)=>{ client.config.whitelistedServers.forEach(guildId=>(client.guilds.cache.get(guildId) as Discord.Guild).commands.set(client.registry).catch((e:Error)=>{
console.log(`Couldn't register slash commands for ${guildId} because`, e.stack); console.log(`Couldn't register slash commands for ${guildId} because`, e.stack);
(client.channels.resolve(client.config.mainServer.channels.errors) as Discord.TextChannel).send(`Cannot register slash commands for **${client.guilds.cache.get(guildId).name}** (\`${guildId}\`):\n\`\`\`${e.message}\`\`\``) (client.channels.resolve(client.config.mainServer.channels.errors) as Discord.TextChannel).send(`Cannot register slash commands for **${client.guilds.cache.get(guildId).name}** (\`${guildId}\`):\n\`\`\`${e.message}\`\`\``)

View File

@ -848,10 +848,11 @@ __metadata:
moment: 2.29.4 moment: 2.29.4
mongoose: 7.4.2 mongoose: 7.4.2
ms: 2.1.3 ms: 2.1.3
prism-media: ^1.3.5 prism-media: 1.3.5
systeminformation: 5.18.12 systeminformation: 5.18.12
typescript: 5.1.6 typescript: 5.1.6
xml-js: 1.6.11 xml-js: 1.6.11
youtube-sr: 4.3.4
ytdl-core: 4.11.5 ytdl-core: 4.11.5
languageName: unknown languageName: unknown
linkType: soft linkType: soft
@ -1979,7 +1980,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"prism-media@npm:^1.3.5": "prism-media@npm:1.3.5, prism-media@npm:^1.3.5":
version: 1.3.5 version: 1.3.5
resolution: "prism-media@npm:1.3.5" resolution: "prism-media@npm:1.3.5"
peerDependencies: peerDependencies:
@ -2576,7 +2577,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"youtube-sr@npm:^4.3.4": "youtube-sr@npm:4.3.4, youtube-sr@npm:^4.3.4":
version: 4.3.4 version: 4.3.4
resolution: "youtube-sr@npm:4.3.4" resolution: "youtube-sr@npm:4.3.4"
checksum: e097f2a82ddc51a580e7b8556aba83968ee580ad29a8d035cbfdc497c4a6f227b3e3ef0bf4648c6edaf25aed18b872a0fad8fda0554d270129f7c5e60e4a01ef checksum: e097f2a82ddc51a580e7b8556aba83968ee580ad29a8d035cbfdc497c4a6f227b3e3ef0bf4648c6edaf25aed18b872a0fad8fda0554d270129f7c5e60e4a01ef