mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-17 16:30:58 -05:00
Compare commits
4 Commits
38cfcc6603
...
62ee72bcc1
Author | SHA1 | Date | |
---|---|---|---|
|
62ee72bcc1 | ||
|
af87fc1934 | ||
|
4dc9ca3e9c | ||
|
bf1ec8c48a |
@ -1,5 +1,5 @@
|
||||
FROM node:22.0.0-alpine3.19
|
||||
ENV YARN_VERSION 4.1.1
|
||||
ENV YARN_VERSION 4.2.1
|
||||
ENV TZ Australia/Sydney
|
||||
RUN yarn policies set-version $YARN_VERSION
|
||||
RUN apk update && apk upgrade && apk add --no-cache git fontconfig ttf-dejavu
|
||||
|
@ -25,7 +25,7 @@
|
||||
"npm": "yarn is required, dont use npm"
|
||||
},
|
||||
"engineStrict": true,
|
||||
"packageManager": "yarn@4.1.1+sha256.f3cc0eda8e5560e529c7147565b30faa43b4e472d90e8634d7134a37c7f59781",
|
||||
"packageManager": "yarn@4.2.1+sha512.4326f6a5a916363bfd3533f984bc4c91d47a0c6af2d79fc6e8a25dec14a1be88ec354e2b1d2919461647ec8df1d39303575f7726827704cdf9909d38621c9300",
|
||||
"dependencies": {
|
||||
"@napi-rs/canvas": "0.1.52",
|
||||
"@octokit/rest": "20.1.0",
|
||||
@ -46,7 +46,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/ms": "0.7.34",
|
||||
"@types/node": "20.12.7",
|
||||
"@types/node": "20.12.8",
|
||||
"@types/node-cron": "3.0.11",
|
||||
"typescript": "5.4.5"
|
||||
}
|
||||
|
@ -21,6 +21,8 @@ export default async(client:TClient, interaction: Discord.ChatInputCommandIntera
|
||||
if (!GuildMember && !['unban', 'ban'].includes(type)) return interaction.reply(`You cannot ${type} someone who is not in the server.`);
|
||||
if (User.bot) return interaction.reply(`You cannot ${type} a bot!`);
|
||||
|
||||
await interaction.deferReply({ephemeral: isInBKL});
|
||||
await client.punishments.punishmentAdd(type, {time, interaction}, interaction.user.id, reason, User, GuildMember);
|
||||
await Promise.all([
|
||||
interaction.deferReply({ephemeral: isInBKL}),
|
||||
client.punishments.punishmentAdd(type, {time, interaction}, interaction.user.id, reason, User, GuildMember)
|
||||
]);
|
||||
}
|
||||
|
@ -26,8 +26,8 @@
|
||||
"botPresence": {
|
||||
"activities": [
|
||||
{
|
||||
"name": "Today is April!",
|
||||
"url": "https://www.youtube.com/watch?v=_oYSiPBUuC8",
|
||||
"name": "Today is May!",
|
||||
"url": "https://www.youtube.com/watch?v=MgTmXbI9xIo",
|
||||
"type": 1
|
||||
}
|
||||
],
|
||||
|
@ -162,10 +162,10 @@ export class PunishmentsSvc {
|
||||
if (type === 'mute') millisecondTime = time ? ms(time) : 2419200000; // Timeouts have a maximum duration of 4 weeks (28 days)
|
||||
else millisecondTime = time ? ms(time) : null;
|
||||
|
||||
const durText = millisecondTime ? ` for ${Formatters.timeFormat(millisecondTime, 4, {longNames: true, commas: true})}` : '';
|
||||
const durText = millisecondTime ? Formatters.timeFormat(millisecondTime, 4, {longNames: true, commas: true}) : '';
|
||||
if (time) embed.addFields({name: 'Duration', value: durText});
|
||||
|
||||
if (guildUser) await guildUser.send(`You've been ${this.getPastTense(type)} ${inOrFromBoolean} **${guild.name}**${durText}\n\`${reason}\` (Case #${punishment.case_id})`).catch(()=>embed.setFooter({text: 'Unable to DM a member'}));
|
||||
if (guildUser) await guildUser.send(`You've been ${this.getPastTense(type)} ${inOrFromBoolean} **${guild.name}** for ${durText}\n\`${reason}\` (Case #${punishment.case_id})`).catch(()=>embed.setFooter({text: 'Unable to DM a member'}));
|
||||
|
||||
switch (type) {
|
||||
case 'ban':
|
||||
@ -238,10 +238,11 @@ export class PunishmentsSvc {
|
||||
removePunishmentResult = await guild.bans.remove(punishment.member, auditLogReason).catch((err:Error)=>err.message);
|
||||
break;
|
||||
case 'mute':
|
||||
if (guildUser) {
|
||||
if (!guildUser) this.model.update({expired: true}, {where: {case_id: caseId}});
|
||||
else {
|
||||
removePunishmentResult = await guildUser.timeout(null, auditLogReason).catch((err:Error)=>err.message);
|
||||
guildUser.send(`You've been unmuted in **${guild.name}**.`).catch(()=>null);
|
||||
} else this.model.update({expired: true}, {where: {case_id: caseId}});
|
||||
guildUser.send(`You've been unmuted in **${guild.name}**.\n\`${reason}\` (Case #${removePunishmentData.case_id})`).catch(()=>null);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
removePunishmentData.type = 'punishmentOverride';
|
||||
|
38
yarn.lock
38
yarn.lock
@ -6,11 +6,11 @@ __metadata:
|
||||
cacheKey: 10
|
||||
|
||||
"@babel/runtime@npm:^7.24.4":
|
||||
version: 7.24.4
|
||||
resolution: "@babel/runtime@npm:7.24.4"
|
||||
version: 7.24.5
|
||||
resolution: "@babel/runtime@npm:7.24.5"
|
||||
dependencies:
|
||||
regenerator-runtime: "npm:^0.14.0"
|
||||
checksum: 10/8ec8ce2c145bc7e31dd39ab66df124f357f65c11489aefacb30f431bae913b9aaa66aa5efe5321ea2bf8878af3fcee338c87e7599519a952e3a6f83aa1b03308
|
||||
checksum: 10/e0f4f4d4503f7338749d1dd92361ad132d683bde64e6b61d6c855e100dcd01592295fcfdcc960c946b85ef7908dc2f501080da58447c05812cf3cd80c599bb62
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@ -292,10 +292,10 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@octokit/openapi-types@npm:^22.1.0":
|
||||
version: 22.1.0
|
||||
resolution: "@octokit/openapi-types@npm:22.1.0"
|
||||
checksum: 10/d80567182efe6cc2c36b96853e622f013a21362897c49fc35fadccfbc1c32b26e478a119385093ea95a5877c76a9327c54457ad22b1815c7a20a6912f2f7e0fb
|
||||
"@octokit/openapi-types@npm:^22.2.0":
|
||||
version: 22.2.0
|
||||
resolution: "@octokit/openapi-types@npm:22.2.0"
|
||||
checksum: 10/0471b0c789fada5aa2390e6f82ba477738228ef7d2d986dda9aab0cb625d1562bd178ba0ba4d2655ce841079cd5efff9e58ece2077c27e569ea22109ea301830
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@ -375,11 +375,11 @@ __metadata:
|
||||
linkType: hard
|
||||
|
||||
"@octokit/types@npm:^13.0.0, @octokit/types@npm:^13.1.0":
|
||||
version: 13.4.1
|
||||
resolution: "@octokit/types@npm:13.4.1"
|
||||
version: 13.5.0
|
||||
resolution: "@octokit/types@npm:13.5.0"
|
||||
dependencies:
|
||||
"@octokit/openapi-types": "npm:^22.1.0"
|
||||
checksum: 10/ea2460da2e343edc2f4c9759d0846e40158b4023c9d802ee9edd0d15a18fa596cb151e0a21e8cad48c34c001942dc7813a4b15c399eb169e6fd5bd983d2f55dc
|
||||
"@octokit/openapi-types": "npm:^22.2.0"
|
||||
checksum: 10/d2aeebc1d8684c4e950f054a52b484e898b72d9f5f8433bcf010161716eea20d1132820d922212f19557a8f147354f2674d1a27b22941308b7c298bdd2674ffa
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@ -563,12 +563,12 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@types/node@npm:*, @types/node@npm:20.12.7":
|
||||
version: 20.12.7
|
||||
resolution: "@types/node@npm:20.12.7"
|
||||
"@types/node@npm:*, @types/node@npm:20.12.8":
|
||||
version: 20.12.8
|
||||
resolution: "@types/node@npm:20.12.8"
|
||||
dependencies:
|
||||
undici-types: "npm:~5.26.4"
|
||||
checksum: 10/b4a28a3b593a9bdca5650880b6a9acef46911d58cf7cfa57268f048e9a7157a7c3196421b96cea576850ddb732e3b54bc982c8eb5e1e5ef0635d4424c2fce801
|
||||
checksum: 10/1feab4c8cb08588eea10811ed4d02485a5cde47fdf92e7b3193fc9f8ee39ea556f6e3124dc6d5378354466ed5f7e5fbe5e20f625908de40ea37560368a50f72c
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@ -704,7 +704,7 @@ __metadata:
|
||||
"@sequelize/postgres": "npm:7.0.0-alpha.40"
|
||||
"@toast/tokenservice-client": "npm:1.2.7"
|
||||
"@types/ms": "npm:0.7.34"
|
||||
"@types/node": "npm:20.12.7"
|
||||
"@types/node": "npm:20.12.8"
|
||||
"@types/node-cron": "npm:3.0.11"
|
||||
ansi-colors: "npm:4.1.3"
|
||||
dayjs: "npm:1.11.11"
|
||||
@ -1362,9 +1362,9 @@ __metadata:
|
||||
linkType: hard
|
||||
|
||||
"type-fest@npm:^4.14.0":
|
||||
version: 4.18.0
|
||||
resolution: "type-fest@npm:4.18.0"
|
||||
checksum: 10/038fab7f07e4b2646d0c6a52be278bcf8171e733b6af29b605416e138914eb9d29d6ad6e3fb786ebe56eada3f127f690d3cf8fd0fb59e7c2efda9b31cde23082
|
||||
version: 4.18.1
|
||||
resolution: "type-fest@npm:4.18.1"
|
||||
checksum: 10/ff76e19cb969854161fea2de854073f346e159f5efff05906ece93cbde8a7161b9374121aca53782b44f754152cbacc70264c90ca1acc81ca917723acce5054f
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user