Skip to content

Commit

Permalink
rename username function
Browse files Browse the repository at this point in the history
  • Loading branch information
iamasink committed Jun 7, 2024
1 parent 4e05c77 commit af4c108
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/commands/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.shittyUsername(invitedBy) ? `\`${format.shittyUsername(invitedBy)}\` <@${invitedById}>` : `*Unknown*`
const invited = format.oldUsername(invitedBy) ? `\`${format.oldUsername(invitedBy)}\` <@${invitedById}>` : `*Unknown*`
guildtext += `\n**Invited by:** ${invited} ${invite.code.slice(0, 4)}`
}

Expand Down
2 changes: 1 addition & 1 deletion src/commands/invite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export default new ApplicationCommand({
if (hasExpired && uses === 0 && !showall) continue


tempoutput += `${name}\`${code}\`, by \`${format.shittyUsername(inviter)}\` (<@${inviter.id}>),`
tempoutput += `${name}\`${code}\`, by \`${format.oldUsername(inviter)}\` (<@${inviter.id}>),`

let guildinvite: Invite

Expand Down
2 changes: 1 addition & 1 deletion src/commands/issue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.shittyUsername(interaction.user)} (${interaction.user.id})\`
Reported by: \`${format.oldUsername(interaction.user)} (${interaction.user.id})\`
User's Message: \`\`\`${userissuedesc}\`\`\`
`

Expand Down
4 changes: 2 additions & 2 deletions src/commands/raid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default new ApplicationCommand({
await member.kick()
}
toban.push(member.user.id)
console.log(`kicked member ${format.shittyUsername(member.user)}`)
console.log(`kicked member ${format.oldUsername(member.user)}`)

}
break
Expand All @@ -65,7 +65,7 @@ export default new ApplicationCommand({
if (!member.user.avatarURL()) {
// await member.kick()
toban.push(member.user.id)
console.log(`kicked member: ${format.shittyUsername(member.user)}`)
console.log(`kicked member: ${format.oldUsername(member.user)}`)
}
break
}
Expand Down
2 changes: 1 addition & 1 deletion src/events/guildMemberAdd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default new Event({
}


log.log(guild, `${member.id}, \`${format.shittyUsername(member.user)}\` has joined guild ${guild}. ${note}`)
log.log(guild, `${member.id}, \`${format.oldUsername(member.user)}\` has joined guild ${guild}. ${note}`)
.then(async msg => {
if (!msg) return
let interaction = await commands.run(msg, "slash", "info", null, "user", [
Expand Down
2 changes: 1 addition & 1 deletion src/events/interactionCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default new Event({
let location: string
if (interaction.channel) location = interaction.channel.name
else location = "dms"
console.log(`${format.shittyUsername(interaction.user)} in #${location} triggered an interaction.`)
console.log(`${format.oldUsername(interaction.user)} in #${location} triggered an interaction.`)

//const guildID = interaction.guild.id

Expand Down
6 changes: 3 additions & 3 deletions src/events/messageDelete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.shittyUsername(message.author)} <@${message.author.id}> was deleted in <#${message.channel.id}>`
const msg = `A message by ${format.oldUsername(message.author)} <@${message.author.id}> was deleted in <#${message.channel.id}>`
console.log(msg)
log.log(message.guild, msg)

Expand All @@ -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.shittyUsername(message.author)} <@${message.author.id}> was deleted in <#${message.channel.id}> by ${format.shittyUsername(executor)}.`)
log.log(message.guild, `A message by ${format.shittyUsername(message.author)} <@${message.author.id}> was deleted in <#${message.channel.id}> by ${format.shittyUsername(executor)}.`)
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)}.`)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/events/userUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default new Event({
}, {})
console.log(diff)

if (format.shittyUsername(olduser) !== format.shittyUsername(newuser)) {
if (format.oldUsername(olduser) !== format.oldUsername(newuser)) {
database.set(`.users.${newuser.id}.usernames.${Date.now()}`, { from: olduser.tag, to: newuser.tag })
} else {
// console.log("not saving usernames cuz theyre the same lol")
Expand Down
2 changes: 1 addition & 1 deletion src/utils/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ 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.shittyUsername(interaction.user)} (${interaction.user.id})\`\nUser's Message: \`\`\`${usermessage}\`\`\``
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}\`\`\``

client.channels.fetch("767026023387758612").then((channel: GuildTextBasedChannel) => {
console.log(channel.name)
Expand Down
2 changes: 1 addition & 1 deletion src/utils/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export default {
}
return text
},
shittyUsername(user: User) {
oldUsername(user: User) {
if (user.discriminator == "0") {
return user.username
} else {
Expand Down

0 comments on commit af4c108

Please sign in to comment.