diff --git a/aurora/common/resident.ts b/aurora/common/resident.ts index 41909778..99011330 100644 --- a/aurora/common/resident.ts +++ b/aurora/common/resident.ts @@ -133,11 +133,10 @@ class ResidentHelper extends BaseHelper { } addCommonFields() { - if (!this.apiResident) this.addDatesFromDB() - else { + if (this.apiResident) { this.addBalance(this.apiResident?.stats?.balance) this.addDatesFromAPI() - } + } else this.addDatesFromDB() this.addLinkedAcc() } diff --git a/aurora/slashcommands/alliance.ts b/aurora/slashcommands/alliance.ts index ff77dc6d..52ec83d3 100644 --- a/aurora/slashcommands/alliance.ts +++ b/aurora/slashcommands/alliance.ts @@ -12,21 +12,21 @@ import AllianceModal from '../../bot/objects/AllianceModal.js' import type { SlashCommand } from "../../bot/types.js" const editingChannels = ["971408026516979813"] +const editorRole = "966359842417705020" const checkEditor = async (interaction: ChatInputCommandInteraction) => { const author = interaction.member as GuildMember - - const isEditor = editingChannels.includes(interaction.channelId) && - author.roles.cache.has('966359842417705020') - - if (!botDevs.includes(author.id) && !isEditor) { - return interaction.reply({embeds: [new EmbedBuilder() - .setTitle("That command is for editors only!\nIf you are an editor, you're probably in the wrong channel.") - .setAuthor({ name: author.user.username, iconURL: author.displayAvatarURL() }) - .setColor(Colors.Red) - .setTimestamp() - ]}).then(m => setTimeout(() => m.delete(), 10000)).catch(() => {}) - } + const isEditor = editingChannels.includes(interaction.channelId) && author.roles.cache.has(editorRole) + + if (!botDevs.includes(author.id) && !isEditor) interaction.reply({embeds: [new EmbedBuilder() + .setTitle("That command is for editors only!\nIf you are an editor, you're probably in the wrong channel.") + .setColor(Colors.Red) + .setTimestamp() + .setAuthor({ + name: author.user.username, + iconURL: author.displayAvatarURL() + }) + ]}).then(m => setTimeout(() => m.delete(), 10000)).catch(() => {}) } const getAlliance = async (options: CommandInteractionOptionResolver, skipCache = true) => { diff --git a/index.ts b/index.ts index 1597fce4..9fcfc6a6 100644 --- a/index.ts +++ b/index.ts @@ -45,7 +45,6 @@ const client: ExtendedClient = new Client({ client.login(process.env.DISCORD_BOT_TOKEN).then(token => { client.slashCommands = new Collection() client.auroraCommands = new Collection() - //client['novaCommands'] = new Collection() console.log(`Logged into Discord.\nToken: ${token}`) }).catch(console.error) @@ -95,4 +94,24 @@ process.on('unhandledRejection', (err: ErrorWithCode) => console.error('Unhandle process.on('uncaughtException', (err: ErrorWithCode) => { if (err.code != 50013) console.error('Uncaught Exception!\n', err) }) +//#endregion + +//#region ANTI-RETARD PING SPAM +const replies = [ + "no.", "be fucking patient moron", "I DO NOT CARE", "Do it again, I dare you.", + "^ this guy likes boys", "you have severe brain damage.", "shutup and smd", + "You have been automatically reported to Discord.", "Please hold. Currently doing your mother." +] + +client.on('messageCreate', async ({ member, guild, content, mentions, reply }) => { + if (guild.id != "966271635894190090") return // Ensure toolkit discord + if (member.roles.cache.has("966359842417705020")) return // Ensure not editor + + // Check regular content, if somehow mention was bypassed. + const isPing = content.includes("@Owen3H") || content.includes("<@263377802647175170>") + if (isPing || mentions.has("263377802647175170")) { + await reply(replies[Math.floor(Math.random() * replies.length)]) + member.timeout(10 * 60 * 1000) + } +}) //#endregion \ No newline at end of file