diff --git a/src/commands/info.ts b/src/commands/info.ts index 91b5ffd..bada61a 100644 --- a/src/commands/info.ts +++ b/src/commands/info.ts @@ -224,7 +224,7 @@ export default new ApplicationCommand({ if (invite) { const invitedById = invite.inviterId const invitedBy = await client.users.fetch(invitedById) || null - const invited = format.oldUsername(invitedBy) ? `\`${format.oldUsername(invitedBy)}\` <@${invitedById}>` : `*Unknown*` + const invited = invitedBy ? `\`${invitedBy}\` <@${invitedById}>` : `*Unknown*` guildtext += `\n**Invited by:** ${invited} ${invite.code.slice(0, 4)}` } diff --git a/src/commands/invite.ts b/src/commands/invite.ts index eb074e2..0782a95 100644 --- a/src/commands/invite.ts +++ b/src/commands/invite.ts @@ -122,7 +122,7 @@ export default new ApplicationCommand({ if (hasExpired && uses === 0 && !showall) continue - tempoutput += `${name}\`${code}\`, by \`${format.oldUsername(inviter)}\` (<@${inviter.id}>),` + tempoutput += `${name}\`${code}\`, by \`${inviter.username}\` (<@${inviter.id}>),` let guildinvite: Invite diff --git a/src/commands/issue.ts b/src/commands/issue.ts index 0be6cdb..3e60c52 100644 --- a/src/commands/issue.ts +++ b/src/commands/issue.ts @@ -74,7 +74,7 @@ export default new ApplicationCommand({ const userissuetitle = i.fields.getTextInputValue('errorReportModalTitleField') const userissuedesc = i.fields.getTextInputValue('errorReportModalDescriptionField') const content = stripIndents` - Reported by: \`${format.oldUsername(interaction.user)} (${interaction.user.id})\` + Reported by: \`${interaction.user} (${interaction.user.id})\` User's Message: \`\`\`${userissuedesc}\`\`\` ` diff --git a/src/events/guildMemberAdd.ts b/src/events/guildMemberAdd.ts index 61c131f..2b52f3d 100644 --- a/src/events/guildMemberAdd.ts +++ b/src/events/guildMemberAdd.ts @@ -51,7 +51,7 @@ export default new Event({ } - log.log(guild, `${member.id}, \`${format.oldUsername(member.user)}\` has joined guild ${guild}. ${note}`) + log.log(guild, `${member.id}, \`${member.user}\` has joined guild ${guild}. ${note}`) .then(async msg => { if (!msg) return let interaction = await commands.run(msg, "slash", "info", null, "user", [ diff --git a/src/events/interactionCreate.ts b/src/events/interactionCreate.ts index d6c7f72..b333714 100644 --- a/src/events/interactionCreate.ts +++ b/src/events/interactionCreate.ts @@ -15,7 +15,7 @@ export default new Event({ let location: string if (interaction.channel) location = interaction.channel.name else location = "dms" - console.log(`${format.oldUsername(interaction.user)} in #${location} triggered an interaction.`) + console.log(`${interaction.user} in #${location} triggered an interaction.`) //const guildID = interaction.guild.id diff --git a/src/events/messageDelete.ts b/src/events/messageDelete.ts index 57712d0..8cd383c 100644 --- a/src/events/messageDelete.ts +++ b/src/events/messageDelete.ts @@ -32,7 +32,7 @@ export default new Event({ // Perform a coherence check to make sure that there's *something* if (!deletionLog) { // Discord does not emit an audit log if the person who deleted the message is a bot deleting a single message or is the author of the message itself. - const msg = `A message by ${format.oldUsername(message.author)} <@${message.author.id}> was deleted in <#${message.channel.id}>` + const msg = `A message by ${message.author.username} <@${message.author.id}> was deleted in <#${message.channel.id}>` console.log(msg) log.log(message.guild, msg) @@ -46,8 +46,8 @@ export default new Event({ // Update the output with a bit more information // Also run a check to make sure that the log returned was for the same author's message if (target.id === message.author.id) { - console.log(`A message by ${format.oldUsername(message.author)} <@${message.author.id}> was deleted in <#${message.channel.id}> by ${format.oldUsername(executor)}.`) - log.log(message.guild, `A message by ${format.oldUsername(message.author)} <@${message.author.id}> was deleted in <#${message.channel.id}> by ${format.oldUsername(executor)}.`) + console.log(`A message by ${message.author.username} <@${message.author.id}> was deleted in <#${message.channel.id}> by ${executor.username}.`) + log.log(message.guild, `A message by ${message.author} <@${message.author.id}> was deleted in <#${message.channel.id}> by ${executor}.`) } } diff --git a/src/utils/commands.ts b/src/utils/commands.ts index a94cd65..d59c384 100644 --- a/src/utils/commands.ts +++ b/src/utils/commands.ts @@ -27,6 +27,7 @@ import config from "../config.json" import { setTimeout } from "node:timers" import { Octokit } from "@octokit/rest" import format from "./format" +import { stripIndents } from "common-tags" function merge(a: any, b: any, prop: any) { const reduced = a.filter( @@ -431,7 +432,11 @@ export default { .then(async i => { interaction.deleteReply() const usermessage = i.fields.getTextInputValue('errorReportModalField') - const content = `error: \`\`\`${error.toString()}\`\`\`\nOn command: \`${interaction.commandName}\`\nOptions: \`\`\`${JSON.stringify(interaction.options)}\`\`\`\nReported by: \`${format.oldUsername(interaction.user)} (${interaction.user.id})\`\nUser's Message: \`\`\`${usermessage}\`\`\`` + const content = stripIndents`error: \`\`\`${error.toString()}\`\`\` + On command: \`${interaction.commandName}\` + Options: \`\`\`${JSON.stringify(interaction.options)}\`\`\` + Reported by: \`${format.oldUsername(interaction.user)} (${interaction.user.id})\` + User's Message: \`\`\`${usermessage}\`\`\`` client.channels.fetch("767026023387758612").then((channel: GuildTextBasedChannel) => { console.log(channel.name)