From 067cc33076fba23719006c35041cd07b142081de Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Mon, 4 Mar 2024 15:26:13 +1100 Subject: [PATCH 1/9] Add Josh to whitelist --- src/config.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/config.json b/src/config.json index b052520..dc0976c 100644 --- a/src/config.json +++ b/src/config.json @@ -37,7 +37,8 @@ "190407856527376384", "141304507249197057", "309373272594579456", - "301350210926280704" + "301350210926280704", + "475037861725339649" ], "contribList": [ "190407856527376384", From a6596e5d7e56e4dedc64fc81787fc95ac98e7c8c Mon Sep 17 00:00:00 2001 From: Toast <96593068+toast-ts@users.noreply.github.com> Date: Mon, 4 Mar 2024 20:45:52 +1100 Subject: [PATCH 2/9] Retire the `Bot Tech` role (#92) * Discontinue Bot Tech role * Remove autoresponses for Monster --- src/commands/dev.ts | 2 +- src/commands/mp.ts | 14 +++++++------- src/commands/suggest.ts | 4 ++-- src/config.json | 1 - src/helpers/MessageTool.ts | 1 + src/interfaces.d.ts | 1 - 6 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/commands/dev.ts b/src/commands/dev.ts index a00837c..4417f43 100644 --- a/src/commands/dev.ts +++ b/src/commands/dev.ts @@ -9,7 +9,7 @@ import util from 'node:util'; import fs from 'node:fs'; export default class Developer { static run(client: TClient, interaction: Discord.ChatInputCommandInteraction<'cached'>) { - if (!client.config.whitelist.includes(interaction.user.id)) return MessageTool.youNeedRole(interaction, 'bottech'); + if (!client.config.whitelist.includes(interaction.member.id)) return MessageTool.isWhitelisted(interaction); ({ eval: async()=>{ fs; diff --git a/src/commands/mp.ts b/src/commands/mp.ts index 70de466..c372fb5 100644 --- a/src/commands/mp.ts +++ b/src/commands/mp.ts @@ -118,7 +118,7 @@ export default class MP { }, maintenance: async()=>{ if (client.config.dcServer.id === interaction.guildId) { - if (!interaction.member.roles.cache.has(client.config.dcServer.roles.mpmod) && !interaction.member.roles.cache.has(client.config.dcServer.roles.bottech)) return MessageTool.youNeedRole(interaction, 'mpmod'); + if (!interaction.member.roles.cache.has(client.config.dcServer.roles.mpmod) && !client.config.whitelist.includes(interaction.member.id)) return MessageTool.youNeedRole(interaction, 'mpmod'); } const reason = interaction.options.getString('reason'); @@ -133,7 +133,7 @@ export default class MP { }, start: async()=>{ if (client.config.dcServer.id === interaction.guildId) { - if (!interaction.member.roles.cache.has(client.config.dcServer.roles.mpmod) && !interaction.member.roles.cache.has(client.config.dcServer.roles.bottech)) return MessageTool.youNeedRole(interaction, 'mpmod'); + if (!interaction.member.roles.cache.has(client.config.dcServer.roles.mpmod) && !client.config.whitelist.includes(interaction.member.id)) return MessageTool.youNeedRole(interaction, 'mpmod'); } const map_names = interaction.options.getString('map_names', true).split('|'); if (map_names.length > 10) return interaction.reply('You can only have up to 10 maps in a poll!'); @@ -150,7 +150,7 @@ export default class MP { }, end: async()=>{ if (client.config.dcServer.id === interaction.guildId) { - if (!interaction.member.roles.cache.has(client.config.dcServer.roles.mpmod) && !interaction.member.roles.cache.has(client.config.dcServer.roles.bottech)) return MessageTool.youNeedRole(interaction, 'mpmod'); + if (!interaction.member.roles.cache.has(client.config.dcServer.roles.mpmod) && !client.config.whitelist.includes(interaction.member.id)) return MessageTool.youNeedRole(interaction, 'mpmod'); } const msg_id = interaction.options.getString('message_id', true); const stripUrl = msg_id.replace(/https:\/\/discord.com\/channels\/\d+\/\d+\/(\d+)/, '$1'); @@ -172,14 +172,14 @@ export default class MP { }, maps: async()=>{ if (client.config.dcServer.id === interaction.guildId) { - if (!interaction.member.roles.cache.has(client.config.dcServer.roles.mpmod) && !interaction.member.roles.cache.has(client.config.dcServer.roles.bottech)) return MessageTool.youNeedRole(interaction, 'mpmod'); + if (!interaction.member.roles.cache.has(client.config.dcServer.roles.mpmod) && !client.config.whitelist.includes(interaction.member.id)) return MessageTool.youNeedRole(interaction, 'mpmod'); } const suggestionPool = await (interaction.guild.channels.cache.get(client.config.dcServer.channels.mpmod_chat) as Discord.TextChannel).messages.fetch(MAP_POOL_HOOKMSG); interaction.reply({embeds: [suggestionPool.embeds[0]]}); }, // Server management group create_server: async()=>{ if (client.config.dcServer.id === interaction.guildId) { - if (!interaction.member.roles.cache.has(client.config.dcServer.roles.mpmanager) && !interaction.member.roles.cache.has(client.config.dcServer.roles.bottech)) return MessageTool.youNeedRole(interaction, 'mpmanager'); + if (!interaction.member.roles.cache.has(client.config.dcServer.roles.mpmanager) && !client.config.whitelist.includes(interaction.member.id)) return MessageTool.youNeedRole(interaction, 'mpmanager'); } const dedicatedServerStatsURL = interaction.options.getString('dss-url'); if (!dedicatedServerStatsURL) { @@ -201,7 +201,7 @@ export default class MP { }, remove_server: async()=>{ if (client.config.dcServer.id === interaction.guildId) { - if (!interaction.member.roles.cache.has(client.config.dcServer.roles.mpmanager) && !interaction.member.roles.cache.has(client.config.dcServer.roles.bottech)) return MessageTool.youNeedRole(interaction, 'mpmanager'); + if (!interaction.member.roles.cache.has(client.config.dcServer.roles.mpmanager) && !client.config.whitelist.includes(interaction.member.id)) return MessageTool.youNeedRole(interaction, 'mpmanager'); } try { Logger.console('log', logPrefix, `Removing "${choiceSelector}" from database`) @@ -214,7 +214,7 @@ export default class MP { }, visibility_toggle: async()=>{ if (client.config.dcServer.id === interaction.guildId) { - if (!interaction.member.roles.cache.has(client.config.dcServer.roles.mpmanager) && !interaction.member.roles.cache.has(client.config.dcServer.roles.bottech)) return MessageTool.youNeedRole(interaction, 'mpmanager'); + if (!interaction.member.roles.cache.has(client.config.dcServer.roles.mpmanager) && !client.config.whitelist.includes(interaction.member.id)) return MessageTool.youNeedRole(interaction, 'mpmanager'); } const toggleFlag = interaction.options.getBoolean('is_active'); Logger.console('log', logPrefix, `Toggling isActive flag for "${choiceSelector}" to ${toggleFlag}`); diff --git a/src/commands/suggest.ts b/src/commands/suggest.ts index 20f45b5..3944b54 100644 --- a/src/commands/suggest.ts +++ b/src/commands/suggest.ts @@ -14,7 +14,7 @@ export default class Suggest { }, delete: async()=>{ if (client.config.dcServer.id === interaction.guildId) { - if (!interaction.member.roles.cache.has(client.config.dcServer.roles.bottech)) return MessageTool.youNeedRole(interaction, 'bottech'); + if (!client.config.whitelist.includes(interaction.member.id)) return MessageTool.isWhitelisted(interaction); } const sugg = await this.deleteSuggestion(client, idVal); if (sugg) return interaction.reply(`Suggestion \`#${idVal}\` has been deleted.`); @@ -22,7 +22,7 @@ export default class Suggest { }, update: async()=>{ if (client.config.dcServer.id === interaction.guildId) { - if (!interaction.member.roles.cache.has(client.config.dcServer.roles.bottech)) return MessageTool.youNeedRole(interaction, 'bottech'); + if (!client.config.whitelist.includes(interaction.member.id)) return MessageTool.isWhitelisted(interaction); } const status = interaction.options.getString('status', true); await this.updateSuggestion(client, idVal, status as 'Accepted'|'Rejected'); diff --git a/src/config.json b/src/config.json index dc0976c..af50d1b 100644 --- a/src/config.json +++ b/src/config.json @@ -61,7 +61,6 @@ ], "roles": { "admin": "468842789053136897", - "bottech": "1011341005389307925", "dcmod": "468841295150972929", "mpmanager": "1028735939813585029", "mpmod": "572151330710487041", diff --git a/src/helpers/MessageTool.ts b/src/helpers/MessageTool.ts index f46f428..55c2f89 100644 --- a/src/helpers/MessageTool.ts +++ b/src/helpers/MessageTool.ts @@ -14,4 +14,5 @@ export default class MessageTool { public static isStaff =(guildMember:Discord.GuildMember)=>config.dcServer.staffRoles.map((x:string)=>config.dcServer.roles[x]).some((x:string)=>guildMember.roles.cache.has(x)); public static youNeedRole =(interaction:Discord.CommandInteraction, role:keyof typeof config.dcServer.roles)=>interaction.reply(`You do not have ${this.formatMention(config.dcServer.roles[role], 'role')} role to use this command.`); public static isModerator =(guildMember:Discord.GuildMember)=>config.dcServer.staffRoles.filter((x:string)=>/^admin|^dcmod/.test(x)).map((x:string)=>config.dcServer.roles[x]).some((x:string)=>guildMember.roles.cache.has(x)); + public static isWhitelisted =(interaction:Discord.CommandInteraction)=>interaction.reply('You are not on whitelist!') } diff --git a/src/interfaces.d.ts b/src/interfaces.d.ts index 45210e6..64425de 100644 --- a/src/interfaces.d.ts +++ b/src/interfaces.d.ts @@ -136,7 +136,6 @@ export interface Config { staffRoles: string[], roles: { admin: string, - bottech: string, dcmod: string, mpmanager: string, mpmod: string, From 8abe1dfaf2d7d78fa819e7266c901b60a4746fc7 Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Tue, 5 Mar 2024 11:03:04 +1100 Subject: [PATCH 3/9] Add channelUpdate event --- src/commands/case.ts | 2 +- src/commands/rank.ts | 2 +- src/config.json | 5 +++-- src/events/channelUpdate.ts | 27 +++++++++++++++++++++++++++ src/events/guildBanAdd.ts | 2 +- src/events/guildBanRemove.ts | 2 +- src/events/guildMemberAdd.ts | 2 +- src/events/guildMemberRemove.ts | 2 +- src/events/guildMemberUpdate.ts | 2 +- src/events/messageCreate.ts | 2 +- src/events/messageDelete.ts | 2 +- src/events/messageDeleteBulk.ts | 2 +- src/events/messageUpdate.ts | 2 +- src/events/ready.ts | 2 +- src/index.ts | 2 +- src/interfaces.d.ts | 5 +++-- src/models/punishments.ts | 2 +- src/models/userLevels.ts | 4 ++-- 18 files changed, 49 insertions(+), 20 deletions(-) create mode 100644 src/events/channelUpdate.ts diff --git a/src/commands/case.ts b/src/commands/case.ts index d3be107..381cec8 100644 --- a/src/commands/case.ts +++ b/src/commands/case.ts @@ -4,7 +4,7 @@ import Formatters from '../helpers/Formatters.js'; import MessageTool from '../helpers/MessageTool.js'; export default class Case { private static async updateEntry(client:TClient, caseId:number, reason:string) { - const logsArray = [client.config.dcServer.channels.logs, client.config.dcServer.channels.bankick_log]; + const logsArray = [client.config.dcServer.channels.bot_log, client.config.dcServer.channels.bankick_log]; for (const channelID of logsArray) { const channel = await client.channels.fetch(channelID) as Discord.TextChannel; if (channel && channel.type === Discord.ChannelType.GuildText) { diff --git a/src/commands/rank.ts b/src/commands/rank.ts index 49fc66f..0c90f69 100644 --- a/src/commands/rank.ts +++ b/src/commands/rank.ts @@ -61,7 +61,7 @@ export default class Rank { const member = interaction.options.getMember('member'); const duration = ms(interaction.options.getString('duration')); const reason = interaction.options.getString('reason'); - const botlog = interaction.guild.channels.cache.get(client.config.dcServer.channels.logs) as Discord.TextChannel; + const botlog = interaction.guild.channels.cache.get(client.config.dcServer.channels.bot_log) as Discord.TextChannel; if (await client.userLevels.blockUser(member.id, Date.now() + duration)) { await interaction.reply(`Done, DM has been sent to **${member.displayName}** with the reason.`); diff --git a/src/config.json b/src/config.json index af50d1b..42beae8 100644 --- a/src/config.json +++ b/src/config.json @@ -76,7 +76,7 @@ "thismeanswar": "1091300529696673792", "bot_suggestions": "1040018521746325586", "bot_status": "1009753780188884992", - "logs": "548032776830582794", + "bot_log": "548032776830582794", "welcome": "621134751897616406", "botcommands": "468888722210029588", "bankick_log": "1048341961901363352", @@ -85,7 +85,8 @@ "mpmod_chat": "516344221452599306", "multifarm_chat": "1149238561934151690", "pw_list": "1193424588554645505", - "help_forum": "1022236553562558464" + "help_forum": "1022236553562558464", + "server_log": "1040002995783471265" } } } diff --git a/src/events/channelUpdate.ts b/src/events/channelUpdate.ts new file mode 100644 index 0000000..6a37b00 --- /dev/null +++ b/src/events/channelUpdate.ts @@ -0,0 +1,27 @@ +import Discord from 'discord.js'; +import TClient from '../client.js'; +export default class ChannelUpdate { + static async run(client:TClient, oldChannel:Discord.GuildChannel, newChannel:Discord.GuildChannel) { + if (!client.config.botSwitches.logs) return; + if (oldChannel.guild?.id != client.config.dcServer.id) return; + + const auditChupdate = (await newChannel.guild.fetchAuditLogs({limit: 1, type: Discord.AuditLogEvent.ChannelUpdate})).entries.first(); + if (!auditChupdate) return console.log(`Channel (${oldChannel.name}) was updated but no audit log found for this channel.`); + + const serverLog = client.channels.cache.get(client.config.dcServer.channels.server_log) as Discord.TextChannel; + const embed = new client.embed().setColor(client.config.embedColor).setFooter({text: auditChupdate.executor.displayName, iconURL: auditChupdate.executor.displayAvatarURL({size: 2048})}).setTimestamp(); + + if (auditChupdate.changes.length > 0) { + const changes = auditChupdate.changes; + const formatAudit =(auditValue:Discord.AuditLogChange)=>`${auditValue.old === undefined ? 'None' : auditValue.old} āžœ ${auditValue.new === '' ? 'None' : auditValue.new}`; + + embed.setTitle(`\`${oldChannel.name}\` was updated`).setTimestamp(auditChupdate.createdTimestamp); + for (const change of changes) { + if (change.key === 'name') embed.addFields({name: 'Name', value: formatAudit(change), inline: true}); + if (change.key === 'topic') embed.addFields({name: 'Topic', value: formatAudit(change), inline: true}); + } + + await serverLog.send({embeds: [embed]}); + } + } +} diff --git a/src/events/guildBanAdd.ts b/src/events/guildBanAdd.ts index 40a32aa..18eac7a 100644 --- a/src/events/guildBanAdd.ts +++ b/src/events/guildBanAdd.ts @@ -15,7 +15,7 @@ export default class GuildBanAdd { {name: 'šŸ”¹ Reason', value: reason === null ? 'Reason unspecified': reason} ); if (!await client.userLevels.fetchUser(member.user.id)) embed.setFooter({text: 'Rank data has been wiped.'}); - (client.channels.resolve(client.config.dcServer.channels.logs) as Discord.TextChannel).send({embeds: [embed]}); + (client.channels.resolve(client.config.dcServer.channels.bot_log) as Discord.TextChannel).send({embeds: [embed]}); client.memberJoinDates.delete(member.user.id); } else console.log(`User was banned from "${member.guild.name}" but no audit log could be fetched.`) } diff --git a/src/events/guildBanRemove.ts b/src/events/guildBanRemove.ts index f0dd1c0..70bbb93 100644 --- a/src/events/guildBanRemove.ts +++ b/src/events/guildBanRemove.ts @@ -6,7 +6,7 @@ export default class GuildBanRemove { const unbanLog = (await member.guild.fetchAuditLogs({limit: 1, type: Discord.AuditLogEvent.MemberBanRemove})).entries.first(); if (!unbanLog) return console.log(`User was unbanned from ${member.guild.name} but no audit log for this user.`) const { executor, target, reason } = unbanLog; - if (target.id === member.user.id) (client.channels.resolve(client.config.dcServer.channels.logs) as Discord.TextChannel).send({embeds: [ + if (target.id === member.user.id) (client.channels.resolve(client.config.dcServer.channels.bot_log) as Discord.TextChannel).send({embeds: [ new client.embed().setColor(client.config.embedColorGreen).setTimestamp().setThumbnail(member.user.displayAvatarURL({size: 2048})).setTitle(`Member Unbanned: ${target.username}`).setDescription(`šŸ”¹ **User**\n<@${target.id}>\n\`${target.id}\``).addFields( {name: 'šŸ”¹ Moderator', value: `<@${executor.id}>\n\`${executor.id}\``}, {name: 'šŸ”¹ Reason', value: `${reason === null ? 'Reason unspecified.': reason}`} diff --git a/src/events/guildMemberAdd.ts b/src/events/guildMemberAdd.ts index 2701009..3660d54 100644 --- a/src/events/guildMemberAdd.ts +++ b/src/events/guildMemberAdd.ts @@ -22,7 +22,7 @@ export default class GuildMemberAdd { const newInvites = await member.guild.invites.fetch(); const usedInvite = newInvites.find((inv:Discord.Invite)=>client.invites.get(inv.code)?.uses < inv.uses); newInvites.forEach((inv:Discord.Invite)=>client.invites.set(inv.code,{uses: inv.uses, creator: inv.inviterId, channel: inv.channel.name})); - (client.channels.resolve(client.config.dcServer.channels.logs) as Discord.TextChannel).send({embeds: [ + (client.channels.resolve(client.config.dcServer.channels.bot_log) as Discord.TextChannel).send({embeds: [ new client.embed().setColor(client.config.embedColorGreen).setTimestamp().setThumbnail(member.user.displayAvatarURL({size: 2048})).setTitle(`${isBot} Joined: ${member.user.username}`).setFooter({text: `Total members: ${index}${suffix} | ID: ${member.user.id}`}).addFields( {name: 'šŸ”¹ Account Creation Date', value: `\n`}, {name: 'šŸ”¹ Invite Data:', value: usedInvite ? `Invite: \`${usedInvite.code}\`\nCreated by: **${usedInvite.inviter?.username}**\nChannel: **#${usedInvite.channel.name}**` : 'No invite data could be fetched.'} diff --git a/src/events/guildMemberRemove.ts b/src/events/guildMemberRemove.ts index 47ed70a..4503491 100644 --- a/src/events/guildMemberRemove.ts +++ b/src/events/guildMemberRemove.ts @@ -16,7 +16,7 @@ export default class GuildMemberRemove { {name: `šŸ”¹ Roles: ${member.roles.cache.size - 1}`, value: `${member.roles.cache.size > 1 ? member.roles.cache.filter((x)=>x.id !== member.guild.roles.everyone.id).sort((a,b)=>b.position - a.position).map(x=>x).join(member.roles.cache.size > 4 ? ' ' : '\n').slice(0,1024) : 'No roles'}`, inline: true} ); if (levelData && levelData.dataValues.messages > 1) embed.addFields({name: 'šŸ”¹ Total messages', value: levelData.dataValues.messages.toLocaleString('en-US'), inline: true}); - (client.channels.resolve(client.config.dcServer.channels.logs) as Discord.TextChannel).send({embeds: [embed]}); + (client.channels.resolve(client.config.dcServer.channels.bot_log) as Discord.TextChannel).send({embeds: [embed]}); await client.userLevels.deleteUser(member.id); } } diff --git a/src/events/guildMemberUpdate.ts b/src/events/guildMemberUpdate.ts index 8995862..5d63221 100644 --- a/src/events/guildMemberUpdate.ts +++ b/src/events/guildMemberUpdate.ts @@ -4,7 +4,7 @@ export default class GuildMemberUpdate { static run(client:TClient, oldMember:Discord.GuildMember, newMember:Discord.GuildMember){ if (oldMember.guild.id != client.config.dcServer.id) return; if (!client.config.botSwitches.logs) return; - const channel = (client.channels.resolve(client.config.dcServer.channels.logs) as Discord.TextChannel); + const channel = (client.channels.resolve(client.config.dcServer.channels.bot_log) as Discord.TextChannel); if (oldMember.nickname != newMember.nickname){ const embed = new client.embed().setColor(client.config.embedColor).setTimestamp().setThumbnail(newMember.displayAvatarURL({size: 2048})).setTitle(`Nickname updated: ${newMember.user.username}`).setDescription(`<@${newMember.user.id}>\n\`${newMember.user.id}\``) oldMember.nickname === null ? '' : embed.addFields({name: 'šŸ”¹ Old nickname', value: `\`\`\`${oldMember.nickname}\`\`\``}) diff --git a/src/events/messageCreate.ts b/src/events/messageCreate.ts index 832ec45..6eacf28 100644 --- a/src/events/messageCreate.ts +++ b/src/events/messageCreate.ts @@ -10,7 +10,7 @@ import MessageTool from '../helpers/MessageTool.js'; export default class MessageCreate { static async run(client:TClient, message:Discord.Message) { if (message.author.bot) return; - if (!message.inGuild()) return (client.channels.resolve(client.config.dcServer.channels.logs) as Discord.TextChannel).send({content: `${this.randomEmotes[Math.floor(Math.random()*this.randomEmotes.length)]} ${MessageTool.formatMention(client.config.whitelist[0], 'user')}\n**${message.author.username}** (\`${message.author.id}\`) sent me a DM, their message is:\`\`\`${message.content}\`\`\``, allowedMentions: {parse: ['users']}}); + if (!message.inGuild()) return (client.channels.resolve(client.config.dcServer.channels.bot_log) as Discord.TextChannel).send({content: `${this.randomEmotes[Math.floor(Math.random()*this.randomEmotes.length)]} ${MessageTool.formatMention(client.config.whitelist[0], 'user')}\n**${message.author.username}** (\`${message.author.id}\`) sent me a DM, their message is:\`\`\`${message.content}\`\`\``, allowedMentions: {parse: ['users']}}); let automodded: boolean; if (client.config.botSwitches.automod && !message.member?.roles.cache.has(client.config.dcServer.roles.dcmod) && !message.member?.roles.cache.has(client.config.dcServer.roles.admin) && message.guildId === client.config.dcServer.id) { diff --git a/src/events/messageDelete.ts b/src/events/messageDelete.ts index dcaad2f..7e4ba3a 100644 --- a/src/events/messageDelete.ts +++ b/src/events/messageDelete.ts @@ -15,6 +15,6 @@ export default class MessageDelete { ) const attachments:string[] = []; msg.attachments.forEach(x=>attachments.push(x.url)); - (client.channels.resolve(client.config.dcServer.channels.logs) as Discord.TextChannel).send({embeds: [embed], files: attachments}) + (client.channels.resolve(client.config.dcServer.channels.bot_log) as Discord.TextChannel).send({embeds: [embed], files: attachments}) } } diff --git a/src/events/messageDeleteBulk.ts b/src/events/messageDeleteBulk.ts index 66a50b6..4ea5e7c 100644 --- a/src/events/messageDeleteBulk.ts +++ b/src/events/messageDeleteBulk.ts @@ -8,7 +8,7 @@ export default class MessageDeleteBulk { msg.content === undefined ?? null; })) return; - (client.channels.resolve(client.config.dcServer.channels.logs) as Discord.TextChannel).send({embeds: [ + (client.channels.resolve(client.config.dcServer.channels.bot_log) as Discord.TextChannel).send({embeds: [ new client.embed().setColor(client.config.embedColorRed).setTimestamp() .setTitle(`${messages.size} messages were purged`) .setDescription(`\`\`\`${messages.map(msgs=>`${msgs.author?.username}: ${msgs.content}`).reverse().join('\n').slice(0,3900)}\`\`\``) diff --git a/src/events/messageUpdate.ts b/src/events/messageUpdate.ts index 708dae6..182bb23 100644 --- a/src/events/messageUpdate.ts +++ b/src/events/messageUpdate.ts @@ -10,7 +10,7 @@ export default class MessageUpdate { if (await client.prohibitedWords.findWord(Automoderator.scanMsg(newMsg)) && (!MessageTool.isStaff(newMsg.member))) newMsg.delete(); if (!rawSwitches.MESSAGE_UPDATE || rawSwitches.MESSAGE_UPDATE) { rawSwitches.MESSAGE_UPDATE = true; - (client.channels.resolve(client.config.dcServer.channels.logs) as Discord.TextChannel).send({embeds: [new client.embed().setColor(client.config.embedColor).setTimestamp().setAuthor({name: `Author: ${oldMsg.author.username} (${oldMsg.author.id})`, iconURL: oldMsg.author.displayAvatarURL()}).setTitle('Message edited').addFields({name: 'Old content', value: `\`\`\`${oldMsg.content.length < 1 ? '(Attachment)' : Discord.escapeCodeBlock(oldMsg.content.slice(0,2048))}\`\`\``}, {name: 'New content', value: `\`\`\`${Discord.escapeCodeBlock(newMsg.content.slice(0,2048))}\`\`\``}, {name: 'Channel', value: `<#${oldMsg.channelId}>`})], components: [new Discord.ActionRowBuilder().addComponents(new Discord.ButtonBuilder().setStyle(5).setURL(oldMsg.url).setLabel('Jump to message'))]}); + (client.channels.resolve(client.config.dcServer.channels.bot_log) as Discord.TextChannel).send({embeds: [new client.embed().setColor(client.config.embedColor).setTimestamp().setAuthor({name: `Author: ${oldMsg.author.username} (${oldMsg.author.id})`, iconURL: oldMsg.author.displayAvatarURL()}).setTitle('Message edited').addFields({name: 'Old content', value: `\`\`\`${oldMsg.content.length < 1 ? '(Attachment)' : Discord.escapeCodeBlock(oldMsg.content.slice(0,2048))}\`\`\``}, {name: 'New content', value: `\`\`\`${Discord.escapeCodeBlock(newMsg.content.slice(0,2048))}\`\`\``}, {name: 'Channel', value: `<#${oldMsg.channelId}>`})], components: [new Discord.ActionRowBuilder().addComponents(new Discord.ButtonBuilder().setStyle(5).setURL(oldMsg.url).setLabel('Jump to message'))]}); } } } diff --git a/src/events/ready.ts b/src/events/ready.ts index 131822f..1c305c8 100644 --- a/src/events/ready.ts +++ b/src/events/ready.ts @@ -6,7 +6,7 @@ export default class Ready { const botSwitches = Object.entries(client.config.botSwitches).map(([k, v])=>`${ansi.yellow(k)}${ansi.black(':')} ${v}`).join('\n').replace(/true/g, ansi.green('true')).replace(/false/g, ansi.red('false')); await client.guilds.fetch(client.config.dcServer.id).then(async guild=>{ - const logsArray = [client.config.dcServer.channels.logs, client.config.dcServer.channels.bankick_log]; + const logsArray = [client.config.dcServer.channels.bot_log, client.config.dcServer.channels.bankick_log]; for (const channelID of logsArray) { const channel = await client.channels.fetch(channelID) as Discord.TextChannel; if (channel && channel.type === Discord.ChannelType.GuildText) await channel.messages.fetch({limit: 15}); diff --git a/src/index.ts b/src/index.ts index bfdd477..b5ab9f7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -72,7 +72,7 @@ setInterval(async()=>{ // Send notification to #bot-log that the data has been pushed to database. const commands = await client.guilds.cache.get(client.config.dcServer.id)?.commands.fetch(); - if (commands) (client.channels.resolve(client.config.dcServer.channels.logs) as Discord.TextChannel).send({embeds: [ + if (commands) (client.channels.resolve(client.config.dcServer.channels.bot_log) as Discord.TextChannel).send({embeds: [ new client.embed().setDescription(`Pushed the following\ndata to x.name === 'rank').id}>`).setFields( {name: 'Day', value: formattedDate.toString(), inline: true}, {name: 'Messages', value: Intl.NumberFormat('en-us').format(total).toString(), inline: true} diff --git a/src/interfaces.d.ts b/src/interfaces.d.ts index 64425de..817c0ab 100644 --- a/src/interfaces.d.ts +++ b/src/interfaces.d.ts @@ -151,7 +151,7 @@ export interface Config { thismeanswar: string, bot_suggestions: string, bot_status: string, - logs: string, + bot_log: string, welcome: string, botcommands: string, bankick_log: string, @@ -160,7 +160,8 @@ export interface Config { mpmod_chat: string, multifarm_chat: string, pw_list: string, - help_forum: string + help_forum: string, + server_log: string } } } diff --git a/src/models/punishments.ts b/src/models/punishments.ts index 783a1f7..01dd76f 100644 --- a/src/models/punishments.ts +++ b/src/models/punishments.ts @@ -113,7 +113,7 @@ export class PunishmentsSvc { channel = this.client.config.dcServer.channels.bankick_log; break; default: - channel = this.client.config.dcServer.channels.logs; + channel = this.client.config.dcServer.channels.bot_log; break; } const embed = new this.client.embed() diff --git a/src/models/userLevels.ts b/src/models/userLevels.ts index 87fb146..125dd88 100644 --- a/src/models/userLevels.ts +++ b/src/models/userLevels.ts @@ -123,7 +123,7 @@ export class UserLevelsSvc { try { // Send notification to dcServer's logs channel after cronjob is complete. - (this.client.channels.resolve(this.client.config.dcServer.channels.logs) as Discord.TextChannel).send({embeds: [new this.client.embed() + (this.client.channels.resolve(this.client.config.dcServer.channels.bot_log) as Discord.TextChannel).send({embeds: [new this.client.embed() .setColor('#A3FFE3') .setTitle('Yearly data reset has begun!') .setDescription(MessageTool.concatMessage( @@ -142,7 +142,7 @@ export class UserLevelsSvc { this.client.config.LRSstart = newEpoch; const logText = `Resetting LRSstart to \`${newEpoch}\`, saved to config file`; Logger.console('log', 'DailyMsgs', logText); - (this.client.channels.resolve(this.client.config.dcServer.channels.logs) as Discord.TextChannel).send({embeds: [new this.client.embed() + (this.client.channels.resolve(this.client.config.dcServer.channels.bot_log) as Discord.TextChannel).send({embeds: [new this.client.embed() .setColor(this.client.config.embedColorXmas) .setTitle('Happy New Years! Level System is clean!') .setDescription(logText) From 59ba9abccfe30210eac42eb7a5df0eb626cebf6f Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Tue, 5 Mar 2024 11:21:08 +1100 Subject: [PATCH 4/9] Use ??= instead of ternary operator --- src/events/channelUpdate.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/events/channelUpdate.ts b/src/events/channelUpdate.ts index 6a37b00..6d7692a 100644 --- a/src/events/channelUpdate.ts +++ b/src/events/channelUpdate.ts @@ -13,7 +13,7 @@ export default class ChannelUpdate { if (auditChupdate.changes.length > 0) { const changes = auditChupdate.changes; - const formatAudit =(auditValue:Discord.AuditLogChange)=>`${auditValue.old === undefined ? 'None' : auditValue.old} āžœ ${auditValue.new === '' ? 'None' : auditValue.new}`; + const formatAudit =(auditValue:Discord.AuditLogChange)=>`${auditValue.old ??= 'None'} āžœ ${auditValue.new ??= 'None'}`; embed.setTitle(`\`${oldChannel.name}\` was updated`).setTimestamp(auditChupdate.createdTimestamp); for (const change of changes) { From 754881c93f57111568cb814fefe960359febbe58 Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Wed, 6 Mar 2024 11:12:36 +1100 Subject: [PATCH 5/9] Update Yarn to 4.1.1 --- .pnp.cjs | 82 ++++++++++++++++++++++++++-------------------------- Dockerfile | 2 +- package.json | 4 +-- yarn.lock | 82 ++++++++++++++++++++++++++-------------------------- 4 files changed, 85 insertions(+), 85 deletions(-) diff --git a/.pnp.cjs b/.pnp.cjs index 2c4ec82..133c085 100644 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -26,7 +26,7 @@ const RAW_RUNTIME_STATE = [null, {\ "packageLocation": "./",\ "packageDependencies": [\ - ["@napi-rs/canvas", "npm:0.1.50"],\ + ["@napi-rs/canvas", "npm:0.1.51"],\ ["@octokit/rest", "npm:20.0.2"],\ ["@toast/tokenservice-client", "npm:1.0.14::__archiveUrl=https%3A%2F%2Fgit.toast-server.net%2Fapi%2Fpackages%2Ftoast%2Fnpm%2F%2540toast%252Ftokenservice-client%2F-%2F1.0.14%2Ftokenservice-client-1.0.14.tgz"],\ ["@types/ms", "npm:0.7.34"],\ @@ -179,100 +179,100 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@napi-rs/canvas", [\ - ["npm:0.1.50", {\ - "packageLocation": "./.yarn/cache/@napi-rs-canvas-npm-0.1.50-6d57a400a9-c9ed3ecdaa.zip/node_modules/@napi-rs/canvas/",\ + ["npm:0.1.51", {\ + "packageLocation": "./.yarn/cache/@napi-rs-canvas-npm-0.1.51-af269bc98a-10d4e8f884.zip/node_modules/@napi-rs/canvas/",\ "packageDependencies": [\ - ["@napi-rs/canvas", "npm:0.1.50"],\ - ["@napi-rs/canvas-android-arm64", "npm:0.1.50"],\ - ["@napi-rs/canvas-darwin-arm64", "npm:0.1.50"],\ - ["@napi-rs/canvas-darwin-x64", "npm:0.1.50"],\ - ["@napi-rs/canvas-linux-arm-gnueabihf", "npm:0.1.50"],\ - ["@napi-rs/canvas-linux-arm64-gnu", "npm:0.1.50"],\ - ["@napi-rs/canvas-linux-arm64-musl", "npm:0.1.50"],\ - ["@napi-rs/canvas-linux-x64-gnu", "npm:0.1.50"],\ - ["@napi-rs/canvas-linux-x64-musl", "npm:0.1.50"],\ - ["@napi-rs/canvas-win32-x64-msvc", "npm:0.1.50"]\ + ["@napi-rs/canvas", "npm:0.1.51"],\ + ["@napi-rs/canvas-android-arm64", "npm:0.1.51"],\ + ["@napi-rs/canvas-darwin-arm64", "npm:0.1.51"],\ + ["@napi-rs/canvas-darwin-x64", "npm:0.1.51"],\ + ["@napi-rs/canvas-linux-arm-gnueabihf", "npm:0.1.51"],\ + ["@napi-rs/canvas-linux-arm64-gnu", "npm:0.1.51"],\ + ["@napi-rs/canvas-linux-arm64-musl", "npm:0.1.51"],\ + ["@napi-rs/canvas-linux-x64-gnu", "npm:0.1.51"],\ + ["@napi-rs/canvas-linux-x64-musl", "npm:0.1.51"],\ + ["@napi-rs/canvas-win32-x64-msvc", "npm:0.1.51"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@napi-rs/canvas-android-arm64", [\ - ["npm:0.1.50", {\ - "packageLocation": "./.yarn/unplugged/@napi-rs-canvas-android-arm64-npm-0.1.50-11d6135d75/node_modules/@napi-rs/canvas-android-arm64/",\ + ["npm:0.1.51", {\ + "packageLocation": "./.yarn/unplugged/@napi-rs-canvas-android-arm64-npm-0.1.51-34205099a0/node_modules/@napi-rs/canvas-android-arm64/",\ "packageDependencies": [\ - ["@napi-rs/canvas-android-arm64", "npm:0.1.50"]\ + ["@napi-rs/canvas-android-arm64", "npm:0.1.51"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@napi-rs/canvas-darwin-arm64", [\ - ["npm:0.1.50", {\ - "packageLocation": "./.yarn/unplugged/@napi-rs-canvas-darwin-arm64-npm-0.1.50-6b2d108329/node_modules/@napi-rs/canvas-darwin-arm64/",\ + ["npm:0.1.51", {\ + "packageLocation": "./.yarn/unplugged/@napi-rs-canvas-darwin-arm64-npm-0.1.51-dbc0153384/node_modules/@napi-rs/canvas-darwin-arm64/",\ "packageDependencies": [\ - ["@napi-rs/canvas-darwin-arm64", "npm:0.1.50"]\ + ["@napi-rs/canvas-darwin-arm64", "npm:0.1.51"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@napi-rs/canvas-darwin-x64", [\ - ["npm:0.1.50", {\ - "packageLocation": "./.yarn/unplugged/@napi-rs-canvas-darwin-x64-npm-0.1.50-b670722e63/node_modules/@napi-rs/canvas-darwin-x64/",\ + ["npm:0.1.51", {\ + "packageLocation": "./.yarn/unplugged/@napi-rs-canvas-darwin-x64-npm-0.1.51-58ab818cac/node_modules/@napi-rs/canvas-darwin-x64/",\ "packageDependencies": [\ - ["@napi-rs/canvas-darwin-x64", "npm:0.1.50"]\ + ["@napi-rs/canvas-darwin-x64", "npm:0.1.51"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@napi-rs/canvas-linux-arm-gnueabihf", [\ - ["npm:0.1.50", {\ - "packageLocation": "./.yarn/unplugged/@napi-rs-canvas-linux-arm-gnueabihf-npm-0.1.50-74ef8d8007/node_modules/@napi-rs/canvas-linux-arm-gnueabihf/",\ + ["npm:0.1.51", {\ + "packageLocation": "./.yarn/unplugged/@napi-rs-canvas-linux-arm-gnueabihf-npm-0.1.51-61ee4ee217/node_modules/@napi-rs/canvas-linux-arm-gnueabihf/",\ "packageDependencies": [\ - ["@napi-rs/canvas-linux-arm-gnueabihf", "npm:0.1.50"]\ + ["@napi-rs/canvas-linux-arm-gnueabihf", "npm:0.1.51"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@napi-rs/canvas-linux-arm64-gnu", [\ - ["npm:0.1.50", {\ - "packageLocation": "./.yarn/unplugged/@napi-rs-canvas-linux-arm64-gnu-npm-0.1.50-c8c1e133bc/node_modules/@napi-rs/canvas-linux-arm64-gnu/",\ + ["npm:0.1.51", {\ + "packageLocation": "./.yarn/unplugged/@napi-rs-canvas-linux-arm64-gnu-npm-0.1.51-f1ee66dd14/node_modules/@napi-rs/canvas-linux-arm64-gnu/",\ "packageDependencies": [\ - ["@napi-rs/canvas-linux-arm64-gnu", "npm:0.1.50"]\ + ["@napi-rs/canvas-linux-arm64-gnu", "npm:0.1.51"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@napi-rs/canvas-linux-arm64-musl", [\ - ["npm:0.1.50", {\ - "packageLocation": "./.yarn/unplugged/@napi-rs-canvas-linux-arm64-musl-npm-0.1.50-c675999c51/node_modules/@napi-rs/canvas-linux-arm64-musl/",\ + ["npm:0.1.51", {\ + "packageLocation": "./.yarn/unplugged/@napi-rs-canvas-linux-arm64-musl-npm-0.1.51-944cfbf386/node_modules/@napi-rs/canvas-linux-arm64-musl/",\ "packageDependencies": [\ - ["@napi-rs/canvas-linux-arm64-musl", "npm:0.1.50"]\ + ["@napi-rs/canvas-linux-arm64-musl", "npm:0.1.51"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@napi-rs/canvas-linux-x64-gnu", [\ - ["npm:0.1.50", {\ - "packageLocation": "./.yarn/unplugged/@napi-rs-canvas-linux-x64-gnu-npm-0.1.50-a8ca0545bd/node_modules/@napi-rs/canvas-linux-x64-gnu/",\ + ["npm:0.1.51", {\ + "packageLocation": "./.yarn/unplugged/@napi-rs-canvas-linux-x64-gnu-npm-0.1.51-057f6a7370/node_modules/@napi-rs/canvas-linux-x64-gnu/",\ "packageDependencies": [\ - ["@napi-rs/canvas-linux-x64-gnu", "npm:0.1.50"]\ + ["@napi-rs/canvas-linux-x64-gnu", "npm:0.1.51"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@napi-rs/canvas-linux-x64-musl", [\ - ["npm:0.1.50", {\ - "packageLocation": "./.yarn/unplugged/@napi-rs-canvas-linux-x64-musl-npm-0.1.50-65f7471d30/node_modules/@napi-rs/canvas-linux-x64-musl/",\ + ["npm:0.1.51", {\ + "packageLocation": "./.yarn/unplugged/@napi-rs-canvas-linux-x64-musl-npm-0.1.51-c96e16ae54/node_modules/@napi-rs/canvas-linux-x64-musl/",\ "packageDependencies": [\ - ["@napi-rs/canvas-linux-x64-musl", "npm:0.1.50"]\ + ["@napi-rs/canvas-linux-x64-musl", "npm:0.1.51"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@napi-rs/canvas-win32-x64-msvc", [\ - ["npm:0.1.50", {\ - "packageLocation": "./.yarn/unplugged/@napi-rs-canvas-win32-x64-msvc-npm-0.1.50-52fd2a856e/node_modules/@napi-rs/canvas-win32-x64-msvc/",\ + ["npm:0.1.51", {\ + "packageLocation": "./.yarn/unplugged/@napi-rs-canvas-win32-x64-msvc-npm-0.1.51-de823ce2f1/node_modules/@napi-rs/canvas-win32-x64-msvc/",\ "packageDependencies": [\ - ["@napi-rs/canvas-win32-x64-msvc", "npm:0.1.50"]\ + ["@napi-rs/canvas-win32-x64-msvc", "npm:0.1.51"]\ ],\ "linkType": "HARD"\ }]\ @@ -795,7 +795,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./",\ "packageDependencies": [\ ["daggerbot-ts", "workspace:."],\ - ["@napi-rs/canvas", "npm:0.1.50"],\ + ["@napi-rs/canvas", "npm:0.1.51"],\ ["@octokit/rest", "npm:20.0.2"],\ ["@toast/tokenservice-client", "npm:1.0.14::__archiveUrl=https%3A%2F%2Fgit.toast-server.net%2Fapi%2Fpackages%2Ftoast%2Fnpm%2F%2540toast%252Ftokenservice-client%2F-%2F1.0.14%2Ftokenservice-client-1.0.14.tgz"],\ ["@types/ms", "npm:0.7.34"],\ diff --git a/Dockerfile b/Dockerfile index 27f4b3a..66a5724 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM node:21.1.0-bookworm-slim -ENV YARN_VERSION 4.1.0 +ENV YARN_VERSION 4.1.1 ENV TZ Australia/Sydney RUN yarn policies set-version $YARN_VERSION RUN apt update -y && apt upgrade -y && apt install -y git fontconfig && npm install -g typescript diff --git a/package.json b/package.json index 0d8a64e..1cb5c0a 100644 --- a/package.json +++ b/package.json @@ -25,9 +25,9 @@ "npm": "yarn is required, dont use npm" }, "engineStrict": true, - "packageManager": "yarn@4.1.0+sha256.81a00df816059803e6b5148acf03ce313cad36b7f6e5af6efa040a15981a6ffb", + "packageManager": "yarn@4.1.1+sha256.f3cc0eda8e5560e529c7147565b30faa43b4e472d90e8634d7134a37c7f59781", "dependencies": { - "@napi-rs/canvas": "0.1.50", + "@napi-rs/canvas": "0.1.51", "@octokit/rest": "20.0.2", "@toast/tokenservice-client": "1.0.14", "ansi-colors": "4.1.3", diff --git a/yarn.lock b/yarn.lock index 48f9936..903baf1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -116,82 +116,82 @@ __metadata: languageName: node linkType: hard -"@napi-rs/canvas-android-arm64@npm:0.1.50": - version: 0.1.50 - resolution: "@napi-rs/canvas-android-arm64@npm:0.1.50" +"@napi-rs/canvas-android-arm64@npm:0.1.51": + version: 0.1.51 + resolution: "@napi-rs/canvas-android-arm64@npm:0.1.51" conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@napi-rs/canvas-darwin-arm64@npm:0.1.50": - version: 0.1.50 - resolution: "@napi-rs/canvas-darwin-arm64@npm:0.1.50" +"@napi-rs/canvas-darwin-arm64@npm:0.1.51": + version: 0.1.51 + resolution: "@napi-rs/canvas-darwin-arm64@npm:0.1.51" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@napi-rs/canvas-darwin-x64@npm:0.1.50": - version: 0.1.50 - resolution: "@napi-rs/canvas-darwin-x64@npm:0.1.50" +"@napi-rs/canvas-darwin-x64@npm:0.1.51": + version: 0.1.51 + resolution: "@napi-rs/canvas-darwin-x64@npm:0.1.51" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@napi-rs/canvas-linux-arm-gnueabihf@npm:0.1.50": - version: 0.1.50 - resolution: "@napi-rs/canvas-linux-arm-gnueabihf@npm:0.1.50" +"@napi-rs/canvas-linux-arm-gnueabihf@npm:0.1.51": + version: 0.1.51 + resolution: "@napi-rs/canvas-linux-arm-gnueabihf@npm:0.1.51" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@napi-rs/canvas-linux-arm64-gnu@npm:0.1.50": - version: 0.1.50 - resolution: "@napi-rs/canvas-linux-arm64-gnu@npm:0.1.50" +"@napi-rs/canvas-linux-arm64-gnu@npm:0.1.51": + version: 0.1.51 + resolution: "@napi-rs/canvas-linux-arm64-gnu@npm:0.1.51" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@napi-rs/canvas-linux-arm64-musl@npm:0.1.50": - version: 0.1.50 - resolution: "@napi-rs/canvas-linux-arm64-musl@npm:0.1.50" +"@napi-rs/canvas-linux-arm64-musl@npm:0.1.51": + version: 0.1.51 + resolution: "@napi-rs/canvas-linux-arm64-musl@npm:0.1.51" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@napi-rs/canvas-linux-x64-gnu@npm:0.1.50": - version: 0.1.50 - resolution: "@napi-rs/canvas-linux-x64-gnu@npm:0.1.50" +"@napi-rs/canvas-linux-x64-gnu@npm:0.1.51": + version: 0.1.51 + resolution: "@napi-rs/canvas-linux-x64-gnu@npm:0.1.51" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@napi-rs/canvas-linux-x64-musl@npm:0.1.50": - version: 0.1.50 - resolution: "@napi-rs/canvas-linux-x64-musl@npm:0.1.50" +"@napi-rs/canvas-linux-x64-musl@npm:0.1.51": + version: 0.1.51 + resolution: "@napi-rs/canvas-linux-x64-musl@npm:0.1.51" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@napi-rs/canvas-win32-x64-msvc@npm:0.1.50": - version: 0.1.50 - resolution: "@napi-rs/canvas-win32-x64-msvc@npm:0.1.50" +"@napi-rs/canvas-win32-x64-msvc@npm:0.1.51": + version: 0.1.51 + resolution: "@napi-rs/canvas-win32-x64-msvc@npm:0.1.51" conditions: os=win32 & cpu=x64 languageName: node linkType: hard -"@napi-rs/canvas@npm:0.1.50": - version: 0.1.50 - resolution: "@napi-rs/canvas@npm:0.1.50" +"@napi-rs/canvas@npm:0.1.51": + version: 0.1.51 + resolution: "@napi-rs/canvas@npm:0.1.51" dependencies: - "@napi-rs/canvas-android-arm64": "npm:0.1.50" - "@napi-rs/canvas-darwin-arm64": "npm:0.1.50" - "@napi-rs/canvas-darwin-x64": "npm:0.1.50" - "@napi-rs/canvas-linux-arm-gnueabihf": "npm:0.1.50" - "@napi-rs/canvas-linux-arm64-gnu": "npm:0.1.50" - "@napi-rs/canvas-linux-arm64-musl": "npm:0.1.50" - "@napi-rs/canvas-linux-x64-gnu": "npm:0.1.50" - "@napi-rs/canvas-linux-x64-musl": "npm:0.1.50" - "@napi-rs/canvas-win32-x64-msvc": "npm:0.1.50" + "@napi-rs/canvas-android-arm64": "npm:0.1.51" + "@napi-rs/canvas-darwin-arm64": "npm:0.1.51" + "@napi-rs/canvas-darwin-x64": "npm:0.1.51" + "@napi-rs/canvas-linux-arm-gnueabihf": "npm:0.1.51" + "@napi-rs/canvas-linux-arm64-gnu": "npm:0.1.51" + "@napi-rs/canvas-linux-arm64-musl": "npm:0.1.51" + "@napi-rs/canvas-linux-x64-gnu": "npm:0.1.51" + "@napi-rs/canvas-linux-x64-musl": "npm:0.1.51" + "@napi-rs/canvas-win32-x64-msvc": "npm:0.1.51" dependenciesMeta: "@napi-rs/canvas-android-arm64": optional: true @@ -211,7 +211,7 @@ __metadata: optional: true "@napi-rs/canvas-win32-x64-msvc": optional: true - checksum: 10/c9ed3ecdaa54c82b4a98bbd7a5297b80083e779ab28a929b2a795ef58b436850a40b569b36f93b709d8ae811573680b775688179d8e7d7d6fbd181420c6945ca + checksum: 10/10d4e8f8849bd476bfaa0ef169c0cfd9612d61affa5a6e3cb60d7e877a57be1557b6a5a2f4da4cfcb50422828d1dfcb01c5279d5fc319c77ee3b3eb9350bbacc languageName: node linkType: hard @@ -585,7 +585,7 @@ __metadata: version: 0.0.0-use.local resolution: "daggerbot-ts@workspace:." dependencies: - "@napi-rs/canvas": "npm:0.1.50" + "@napi-rs/canvas": "npm:0.1.51" "@octokit/rest": "npm:20.0.2" "@toast/tokenservice-client": "npm:1.0.14" "@types/ms": "npm:0.7.34" From 9d1c8dd238ffb36fa4881b41e3222d3908ead068 Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Fri, 8 Mar 2024 09:08:09 +1100 Subject: [PATCH 6/9] Update TypeScript to 5.4.2 --- .pnp.cjs | 40 ++++++++++++++++++------------------- package.json | 6 +++--- src/events/channelUpdate.ts | 7 ++++--- tsconfig.json | 4 ++-- yarn.lock | 38 +++++++++++++++++------------------ 5 files changed, 48 insertions(+), 47 deletions(-) diff --git a/.pnp.cjs b/.pnp.cjs index 133c085..40aa625 100644 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -28,9 +28,9 @@ const RAW_RUNTIME_STATE = "packageDependencies": [\ ["@napi-rs/canvas", "npm:0.1.51"],\ ["@octokit/rest", "npm:20.0.2"],\ - ["@toast/tokenservice-client", "npm:1.0.14::__archiveUrl=https%3A%2F%2Fgit.toast-server.net%2Fapi%2Fpackages%2Ftoast%2Fnpm%2F%2540toast%252Ftokenservice-client%2F-%2F1.0.14%2Ftokenservice-client-1.0.14.tgz"],\ + ["@toast/tokenservice-client", "npm:1.0.16::__archiveUrl=https%3A%2F%2Fgit.toast-server.net%2Fapi%2Fpackages%2Ftoast%2Fnpm%2F%2540toast%252Ftokenservice-client%2F-%2F1.0.16%2Ftokenservice-client-1.0.16.tgz"],\ ["@types/ms", "npm:0.7.34"],\ - ["@types/node", "npm:20.11.24"],\ + ["@types/node", "npm:20.11.25"],\ ["@types/node-cron", "npm:3.0.11"],\ ["@types/pg", "npm:8.11.2"],\ ["@types/sequelize", "npm:4.28.20"],\ @@ -47,7 +47,7 @@ const RAW_RUNTIME_STATE = ["sequelize", "virtual:20c353e2d6536e37339997f03975c6a660f4d296e664d291bd43620c6162cca8eb5ef90b0998dc9db75ff6862e5da587d0530bae26805f5fadc8f17aaa4ff794#npm:6.37.1"],\ ["simple-git", "npm:3.22.0"],\ ["systeminformation", "npm:5.22.0"],\ - ["typescript", "patch:typescript@npm%3A5.3.3#optional!builtin::version=5.3.3&hash=e012d7"],\ + ["typescript", "patch:typescript@npm%3A5.4.2#optional!builtin::version=5.4.2&hash=5adc0c"],\ ["undici", "npm:6.7.0"]\ ],\ "linkType": "SOFT"\ @@ -609,10 +609,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@toast/tokenservice-client", [\ - ["npm:1.0.14::__archiveUrl=https%3A%2F%2Fgit.toast-server.net%2Fapi%2Fpackages%2Ftoast%2Fnpm%2F%2540toast%252Ftokenservice-client%2F-%2F1.0.14%2Ftokenservice-client-1.0.14.tgz", {\ - "packageLocation": "./.yarn/cache/@toast-tokenservice-client-npm-1.0.14-8e8e9cba19-b478e70965.zip/node_modules/@toast/tokenservice-client/",\ + ["npm:1.0.16::__archiveUrl=https%3A%2F%2Fgit.toast-server.net%2Fapi%2Fpackages%2Ftoast%2Fnpm%2F%2540toast%252Ftokenservice-client%2F-%2F1.0.16%2Ftokenservice-client-1.0.16.tgz", {\ + "packageLocation": "./.yarn/cache/@toast-tokenservice-client-npm-1.0.16-de708ec9ce-a946df28f2.zip/node_modules/@toast/tokenservice-client/",\ "packageDependencies": [\ - ["@toast/tokenservice-client", "npm:1.0.14::__archiveUrl=https%3A%2F%2Fgit.toast-server.net%2Fapi%2Fpackages%2Ftoast%2Fnpm%2F%2540toast%252Ftokenservice-client%2F-%2F1.0.14%2Ftokenservice-client-1.0.14.tgz"],\ + ["@toast/tokenservice-client", "npm:1.0.16::__archiveUrl=https%3A%2F%2Fgit.toast-server.net%2Fapi%2Fpackages%2Ftoast%2Fnpm%2F%2540toast%252Ftokenservice-client%2F-%2F1.0.16%2Ftokenservice-client-1.0.16.tgz"],\ ["undici", "npm:6.7.0"]\ ],\ "linkType": "HARD"\ @@ -632,7 +632,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@types-continuation-local-storage-npm-3.2.7-763e4dc12b-1f272b53bc.zip/node_modules/@types/continuation-local-storage/",\ "packageDependencies": [\ ["@types/continuation-local-storage", "npm:3.2.7"],\ - ["@types/node", "npm:20.11.24"]\ + ["@types/node", "npm:20.11.25"]\ ],\ "linkType": "HARD"\ }]\ @@ -666,10 +666,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@types/node", [\ - ["npm:20.11.24", {\ - "packageLocation": "./.yarn/cache/@types-node-npm-20.11.24-4e19eedf98-7f34bfae5f.zip/node_modules/@types/node/",\ + ["npm:20.11.25", {\ + "packageLocation": "./.yarn/cache/@types-node-npm-20.11.25-b6ac39dd46-861265f1bb.zip/node_modules/@types/node/",\ "packageDependencies": [\ - ["@types/node", "npm:20.11.24"],\ + ["@types/node", "npm:20.11.25"],\ ["undici-types", "npm:5.26.5"]\ ],\ "linkType": "HARD"\ @@ -689,7 +689,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@types-pg-npm-8.11.2-bdf321bea4-7c05cf63be.zip/node_modules/@types/pg/",\ "packageDependencies": [\ ["@types/pg", "npm:8.11.2"],\ - ["@types/node", "npm:20.11.24"],\ + ["@types/node", "npm:20.11.25"],\ ["pg-protocol", "npm:1.6.0"],\ ["pg-types", "npm:4.0.2"]\ ],\ @@ -723,7 +723,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@types-ws-npm-8.5.10-a877a38f71-9b414dc5e0.zip/node_modules/@types/ws/",\ "packageDependencies": [\ ["@types/ws", "npm:8.5.10"],\ - ["@types/node", "npm:20.11.24"]\ + ["@types/node", "npm:20.11.25"]\ ],\ "linkType": "HARD"\ }],\ @@ -731,7 +731,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/@types-ws-npm-8.5.9-91d1b2ab07-7cf66383b8.zip/node_modules/@types/ws/",\ "packageDependencies": [\ ["@types/ws", "npm:8.5.9"],\ - ["@types/node", "npm:20.11.24"]\ + ["@types/node", "npm:20.11.25"]\ ],\ "linkType": "HARD"\ }]\ @@ -797,9 +797,9 @@ const RAW_RUNTIME_STATE = ["daggerbot-ts", "workspace:."],\ ["@napi-rs/canvas", "npm:0.1.51"],\ ["@octokit/rest", "npm:20.0.2"],\ - ["@toast/tokenservice-client", "npm:1.0.14::__archiveUrl=https%3A%2F%2Fgit.toast-server.net%2Fapi%2Fpackages%2Ftoast%2Fnpm%2F%2540toast%252Ftokenservice-client%2F-%2F1.0.14%2Ftokenservice-client-1.0.14.tgz"],\ + ["@toast/tokenservice-client", "npm:1.0.16::__archiveUrl=https%3A%2F%2Fgit.toast-server.net%2Fapi%2Fpackages%2Ftoast%2Fnpm%2F%2540toast%252Ftokenservice-client%2F-%2F1.0.16%2Ftokenservice-client-1.0.16.tgz"],\ ["@types/ms", "npm:0.7.34"],\ - ["@types/node", "npm:20.11.24"],\ + ["@types/node", "npm:20.11.25"],\ ["@types/node-cron", "npm:3.0.11"],\ ["@types/pg", "npm:8.11.2"],\ ["@types/sequelize", "npm:4.28.20"],\ @@ -816,7 +816,7 @@ const RAW_RUNTIME_STATE = ["sequelize", "virtual:20c353e2d6536e37339997f03975c6a660f4d296e664d291bd43620c6162cca8eb5ef90b0998dc9db75ff6862e5da587d0530bae26805f5fadc8f17aaa4ff794#npm:6.37.1"],\ ["simple-git", "npm:3.22.0"],\ ["systeminformation", "npm:5.22.0"],\ - ["typescript", "patch:typescript@npm%3A5.3.3#optional!builtin::version=5.3.3&hash=e012d7"],\ + ["typescript", "patch:typescript@npm%3A5.4.2#optional!builtin::version=5.4.2&hash=5adc0c"],\ ["undici", "npm:6.7.0"]\ ],\ "linkType": "SOFT"\ @@ -1541,10 +1541,10 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["typescript", [\ - ["patch:typescript@npm%3A5.3.3#optional!builtin::version=5.3.3&hash=e012d7", {\ - "packageLocation": "./.yarn/cache/typescript-patch-4778c7998b-c93786fcc9.zip/node_modules/typescript/",\ + ["patch:typescript@npm%3A5.4.2#optional!builtin::version=5.4.2&hash=5adc0c", {\ + "packageLocation": "./.yarn/cache/typescript-patch-c145cea93e-f5f9a4133c.zip/node_modules/typescript/",\ "packageDependencies": [\ - ["typescript", "patch:typescript@npm%3A5.3.3#optional!builtin::version=5.3.3&hash=e012d7"]\ + ["typescript", "patch:typescript@npm%3A5.4.2#optional!builtin::version=5.4.2&hash=5adc0c"]\ ],\ "linkType": "HARD"\ }]\ @@ -1617,7 +1617,7 @@ const RAW_RUNTIME_STATE = "packageLocation": "./.yarn/cache/wkx-npm-0.5.0-fca5152cd8-b8975e33f9.zip/node_modules/wkx/",\ "packageDependencies": [\ ["wkx", "npm:0.5.0"],\ - ["@types/node", "npm:20.11.24"]\ + ["@types/node", "npm:20.11.25"]\ ],\ "linkType": "HARD"\ }]\ diff --git a/package.json b/package.json index 1cb5c0a..bc2f3e3 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "dependencies": { "@napi-rs/canvas": "0.1.51", "@octokit/rest": "20.0.2", - "@toast/tokenservice-client": "1.0.14", + "@toast/tokenservice-client": "1.0.16", "ansi-colors": "4.1.3", "dayjs": "1.11.10", "discord.js": "14.14.1", @@ -47,10 +47,10 @@ }, "devDependencies": { "@types/ms": "0.7.34", - "@types/node": "20.11.24", + "@types/node": "20.11.25", "@types/node-cron": "3.0.11", "@types/pg": "8.11.2", "@types/sequelize": "4.28.20", - "typescript": "5.3.3" + "typescript": "5.4.2" } } diff --git a/src/events/channelUpdate.ts b/src/events/channelUpdate.ts index 6d7692a..8b91c5f 100644 --- a/src/events/channelUpdate.ts +++ b/src/events/channelUpdate.ts @@ -1,8 +1,8 @@ import Discord from 'discord.js'; import TClient from '../client.js'; export default class ChannelUpdate { - static async run(client:TClient, oldChannel:Discord.GuildChannel, newChannel:Discord.GuildChannel) { - if (!client.config.botSwitches.logs) return; + static async run(_client:TClient, _oldChannel:Discord.GuildChannel, _newChannel:Discord.GuildChannel) { +/* if (!client.config.botSwitches.logs) return; if (oldChannel.guild?.id != client.config.dcServer.id) return; const auditChupdate = (await newChannel.guild.fetchAuditLogs({limit: 1, type: Discord.AuditLogEvent.ChannelUpdate})).entries.first(); @@ -22,6 +22,7 @@ export default class ChannelUpdate { } await serverLog.send({embeds: [embed]}); - } + } */ } } +// Commented out, will be refactored later due to issues. diff --git a/tsconfig.json b/tsconfig.json index bdd2702..43d0392 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,12 +11,12 @@ "allowSyntheticDefaultImports": true, "target": "ES2022", "module": "ESNext", - "baseUrl": "./", + "baseUrl": ".", "rootDir": "src", "outDir": "dist", "moduleResolution": "bundler", "typeRoots": [ "./src/interfaces.d.ts" ] }, "include": [ "src" ], - "exclude": [ ".yarn/cache", ".yarn/unplugged", ".git", "src/*.json", "postgres-replica-stuff" ] + "exclude": [ ".yarn/cache", ".yarn/unplugged", ".git", "src/*.json" ] } diff --git a/yarn.lock b/yarn.lock index 903baf1..0aec8d3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -427,12 +427,12 @@ __metadata: languageName: node linkType: hard -"@toast/tokenservice-client@npm:1.0.14": - version: 1.0.14 - resolution: "@toast/tokenservice-client@npm:1.0.14::__archiveUrl=https%3A%2F%2Fgit.toast-server.net%2Fapi%2Fpackages%2Ftoast%2Fnpm%2F%2540toast%252Ftokenservice-client%2F-%2F1.0.14%2Ftokenservice-client-1.0.14.tgz" +"@toast/tokenservice-client@npm:1.0.16": + version: 1.0.16 + resolution: "@toast/tokenservice-client@npm:1.0.16::__archiveUrl=https%3A%2F%2Fgit.toast-server.net%2Fapi%2Fpackages%2Ftoast%2Fnpm%2F%2540toast%252Ftokenservice-client%2F-%2F1.0.16%2Ftokenservice-client-1.0.16.tgz" dependencies: undici: "npm:6.7.0" - checksum: 10/b478e70965fec7f2f1c492e5ecf4b5d33b5044c29e2391dec3d52e1137e8f4bf3849e587e1830e9469eba5db7505d691cc625846d2a70610af4a91e1f94833e0 + checksum: 10/a946df28f2ba6e36f881f7160bafe0dfe06227520b2a1a8ace729651064103bce92dcfc0d23deb6df845839f380fbdc17af86b1f1ea11ab3cc513c751ec23fb8 languageName: node linkType: hard @@ -482,12 +482,12 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:*, @types/node@npm:20.11.24": - version: 20.11.24 - resolution: "@types/node@npm:20.11.24" +"@types/node@npm:*, @types/node@npm:20.11.25": + version: 20.11.25 + resolution: "@types/node@npm:20.11.25" dependencies: undici-types: "npm:~5.26.4" - checksum: 10/7f34bfae5f9b98b9910230af4b4c52dc7fb2d1e96fdebfbc3d7576f8ab3d100076f193f9469add9e7418b455294155e7e6a028498cc5e98f9d49349875a459cf + checksum: 10/861265f1bbb151404bd8842b595f027a4ff067c61ecff9a37b9f7f53922c18dd532c8e795e8e7675dd8dba056645623fd2b9848d5ef72863ec3609096cd2923e languageName: node linkType: hard @@ -587,9 +587,9 @@ __metadata: dependencies: "@napi-rs/canvas": "npm:0.1.51" "@octokit/rest": "npm:20.0.2" - "@toast/tokenservice-client": "npm:1.0.14" + "@toast/tokenservice-client": "npm:1.0.16" "@types/ms": "npm:0.7.34" - "@types/node": "npm:20.11.24" + "@types/node": "npm:20.11.25" "@types/node-cron": "npm:3.0.11" "@types/pg": "npm:8.11.2" "@types/sequelize": "npm:4.28.20" @@ -606,7 +606,7 @@ __metadata: sequelize: "npm:6.37.1" simple-git: "npm:3.22.0" systeminformation: "npm:5.22.0" - typescript: "npm:5.3.3" + typescript: "npm:5.4.2" undici: "npm:6.7.0" languageName: unknown linkType: soft @@ -1191,23 +1191,23 @@ __metadata: languageName: node linkType: hard -"typescript@npm:5.3.3": - version: 5.3.3 - resolution: "typescript@npm:5.3.3" +"typescript@npm:5.4.2": + version: 5.4.2 + resolution: "typescript@npm:5.4.2" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10/6e4e6a14a50c222b3d14d4ea2f729e79f972fa536ac1522b91202a9a65af3605c2928c4a790a4a50aa13694d461c479ba92cedaeb1e7b190aadaa4e4b96b8e18 + checksum: 10/f8cfdc630ab1672f004e9561eb2916935b2d267792d07ce93e97fc601c7a65191af32033d5e9c0169b7dc37da7db9bf320f7432bc84527cb7697effaa4e4559d languageName: node linkType: hard -"typescript@patch:typescript@npm%3A5.3.3#optional!builtin": - version: 5.3.3 - resolution: "typescript@patch:typescript@npm%3A5.3.3#optional!builtin::version=5.3.3&hash=e012d7" +"typescript@patch:typescript@npm%3A5.4.2#optional!builtin": + version: 5.4.2 + resolution: "typescript@patch:typescript@npm%3A5.4.2#optional!builtin::version=5.4.2&hash=5adc0c" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10/c93786fcc9a70718ba1e3819bab56064ead5817004d1b8186f8ca66165f3a2d0100fee91fa64c840dcd45f994ca5d615d8e1f566d39a7470fc1e014dbb4cf15d + checksum: 10/f5f9a4133c2670761f0166eae5b3bafbc4a3fc24f0f42a93c9c893d9e9d6e66ea066969c5e7483fa66b4ae0e99125592553f3b92fd3599484de8be13b0615176 languageName: node linkType: hard From a2fe3afdb7f283a63d27b8ff382e91599550d19e Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Sat, 9 Mar 2024 17:13:09 +1100 Subject: [PATCH 7/9] Hide username for anonymity reasons --- src/commands/dev.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/dev.ts b/src/commands/dev.ts index 4417f43..94fda02 100644 --- a/src/commands/dev.ts +++ b/src/commands/dev.ts @@ -128,7 +128,7 @@ export default class Developer { const member = interaction.options.getMember('member'); const message = interaction.options.getString('message'); const int = await interaction.reply({content: '*Sending...*', fetchReply: true}); - client.users.cache.get(member.id).send(`${message}\nā•° ${interaction.member.displayName}`).then(()=>int.edit(`Successfully sent a DM to **${member.user.username}** with the following message:\n\`\`\`${message}\`\`\``)).catch((e:Error)=>int.edit(`\`${e.message}\``)) + client.users.cache.get(member.id).send(`${message}\nā•° *Pseudonymous User*`).then(()=>int.edit(`Successfully sent a DM to **${member.user.username}** with the following message:\n\`\`\`${message}\`\`\``)).catch((e:Error)=>int.edit(`\`${e.message}\``)) }, modify_rank_msgs: async()=>{ if (interaction.guildId !== client.config.dcServer.id) return interaction.reply({content: 'This command is only available in the main server.', ephemeral: true}); From 0ad5c2cc375a6cd9f697a02e8f6cded63629b51a Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Sat, 9 Mar 2024 17:40:40 +1100 Subject: [PATCH 8/9] Forward attachments too. --- src/events/messageCreate.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/events/messageCreate.ts b/src/events/messageCreate.ts index 6eacf28..2b68670 100644 --- a/src/events/messageCreate.ts +++ b/src/events/messageCreate.ts @@ -10,7 +10,12 @@ import MessageTool from '../helpers/MessageTool.js'; export default class MessageCreate { static async run(client:TClient, message:Discord.Message) { if (message.author.bot) return; - if (!message.inGuild()) return (client.channels.resolve(client.config.dcServer.channels.bot_log) as Discord.TextChannel).send({content: `${this.randomEmotes[Math.floor(Math.random()*this.randomEmotes.length)]} ${MessageTool.formatMention(client.config.whitelist[0], 'user')}\n**${message.author.username}** (\`${message.author.id}\`) sent me a DM, their message is:\`\`\`${message.content}\`\`\``, allowedMentions: {parse: ['users']}}); + if (!message.inGuild()) { + let fwdImages:string[] = []; + message.attachments.forEach(x=>fwdImages.push(x.url)); + (client.channels.resolve(client.config.dcServer.channels.bot_log) as Discord.TextChannel).send({content: `${this.randomEmotes[Math.floor(Math.random()*this.randomEmotes.length)]} ${MessageTool.formatMention(client.config.whitelist[0], 'user')}\n**${message.author.username}** (\`${message.author.id}\`) sent me a DM, their message is:\`\`\`${message.content.length < 1 ? '(No content)' : message.content}\`\`\``, files: fwdImages, allowedMentions: {parse: ['users']}}); + return; + } let automodded: boolean; if (client.config.botSwitches.automod && !message.member?.roles.cache.has(client.config.dcServer.roles.dcmod) && !message.member?.roles.cache.has(client.config.dcServer.roles.admin) && message.guildId === client.config.dcServer.id) { From b14de3201d01b8ae91eaee92ecb0224e141fec48 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 12:54:10 +1100 Subject: [PATCH 9/9] Bump undici from 6.7.0 to 6.7.1 (#93) Bumps [undici](https://github.com/nodejs/undici) from 6.7.0 to 6.7.1. - [Release notes](https://github.com/nodejs/undici/releases) - [Commits](https://github.com/nodejs/undici/compare/v6.7.0...v6.7.1) --- updated-dependencies: - dependency-name: undici dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .pnp.cjs | 11 +++++++++-- package.json | 2 +- yarn.lock | 9 ++++++++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.pnp.cjs b/.pnp.cjs index 40aa625..1621c5f 100644 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -48,7 +48,7 @@ const RAW_RUNTIME_STATE = ["simple-git", "npm:3.22.0"],\ ["systeminformation", "npm:5.22.0"],\ ["typescript", "patch:typescript@npm%3A5.4.2#optional!builtin::version=5.4.2&hash=5adc0c"],\ - ["undici", "npm:6.7.0"]\ + ["undici", "npm:6.7.1"]\ ],\ "linkType": "SOFT"\ }]\ @@ -817,7 +817,7 @@ const RAW_RUNTIME_STATE = ["simple-git", "npm:3.22.0"],\ ["systeminformation", "npm:5.22.0"],\ ["typescript", "patch:typescript@npm%3A5.4.2#optional!builtin::version=5.4.2&hash=5adc0c"],\ - ["undici", "npm:6.7.0"]\ + ["undici", "npm:6.7.1"]\ ],\ "linkType": "SOFT"\ }]\ @@ -1574,6 +1574,13 @@ const RAW_RUNTIME_STATE = ["@fastify/busboy", "npm:2.1.1"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:6.7.1", {\ + "packageLocation": "./.yarn/cache/undici-npm-6.7.1-cc741edc29-7e66eb7fb6.zip/node_modules/undici/",\ + "packageDependencies": [\ + ["undici", "npm:6.7.1"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["undici-types", [\ diff --git a/package.json b/package.json index bc2f3e3..2e02daa 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "sequelize": "6.37.1", "simple-git": "3.22.0", "systeminformation": "5.22.0", - "undici": "6.7.0" + "undici": "6.7.1" }, "devDependencies": { "@types/ms": "0.7.34", diff --git a/yarn.lock b/yarn.lock index 0aec8d3..000f929 100644 --- a/yarn.lock +++ b/yarn.lock @@ -607,7 +607,7 @@ __metadata: simple-git: "npm:3.22.0" systeminformation: "npm:5.22.0" typescript: "npm:5.4.2" - undici: "npm:6.7.0" + undici: "npm:6.7.1" languageName: unknown linkType: soft @@ -1243,6 +1243,13 @@ __metadata: languageName: node linkType: hard +"undici@npm:6.7.1": + version: 6.7.1 + resolution: "undici@npm:6.7.1" + checksum: 10/7e66eb7fb6b3641efc9381b335334a7fe0d69d4b8004147b2a7658f279adfd392fb908acf71627e2cd1f863d9ab4d5b1470139364468d486ab69aee43a8246e5 + languageName: node + linkType: hard + "universal-user-agent@npm:^6.0.0": version: 6.0.1 resolution: "universal-user-agent@npm:6.0.1"