Skip to content

Commit

Permalink
remove #0000
Browse files Browse the repository at this point in the history
  • Loading branch information
nayvcake committed Jul 11, 2023
1 parent f26318d commit 6598a2c
Show file tree
Hide file tree
Showing 33 changed files with 146 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default class ShopProfileCommand extends Command {
componentSelected: '',
profileType: user.profileType,
married: user.isMarry,
partnerName: marryWith ? `${marryWith?.username}#${marryWith.discriminator}` : '',
partnerName: marryWith ? `@${marryWith?.username}` : '',
user,
marryWith,
avatar,
Expand Down
2 changes: 1 addition & 1 deletion apps/discord/src/commands/slash/mod/AnnounceCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default class AnnounceCommand extends Command {
embed.setColor('DEFAULT')
embed.setAuthor(guild.name, guild.iconURL)
embed.setDescription(announce)
embed.setFooter(ctx._locale('commands:announce.embedSendBy', { 0: `${ctx.message.member.username}#${ctx.message.member.discriminator}` }), ctx.message.member.avatarURL)
embed.setFooter(ctx._locale('commands:announce.embedSendBy', { 0: `@${ctx.message.member.username}` }), ctx.message.member.avatarURL)
const everyone = new Button()
everyone.setStyle(1)
everyone.setLabel(ctx._locale('commands:announce.mentionEveryone'))
Expand Down
8 changes: 4 additions & 4 deletions apps/discord/src/commands/slash/mod/BanCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default class BanCommand extends Command {
const member = await ctx.getUser(ctx.args.get('user').value?.id ?? ctx.args.get('user').value)
const guildMember = ctx.message.guild.members.get(member.id)
const reason = ctx._locale('basic:punishment.reason', {
0: `${ctx.message.member.user.username}#${ctx.message.member.user.discriminator}`, 1: ctx.args.get('reason') ?
0: `@${ctx.message.member.user.username}`, 1: ctx.args.get('reason') ?
ctx.args.get('reason').value : ctx._locale('basic:noReason')
})
let quantity = ctx.args.get('message_days')?.value
Expand All @@ -56,9 +56,9 @@ export default class BanCommand extends Command {
const embed = new EmbedBuilder()
embed.setColor('MODERATION')
embed.setThumbnail(member.avatarURL)
embed.setTitle(ctx._locale('basic:punishment.banned', { 0: `${member.username}#${member.discriminator}` }))
embed.addField(ctx._locale('basic:punishment.embed.memberName'), `${member.username}#${member.discriminator} (\`${member.id}\`)`)
embed.addField(ctx._locale('basic:punishment.embed.staffName'), `${ctx.message.member.username}#${ctx.message.member.discriminator} (\`${ctx.message.member.id}\`)`)
embed.setTitle(ctx._locale('basic:punishment.banned', { 0: `@${member.username}` }))
embed.addField(ctx._locale('basic:punishment.embed.memberName'), `@${member.username} (\`${member.id}\`)`)
embed.addField(ctx._locale('basic:punishment.embed.staffName'), `@${ctx.message.member.username} (\`${ctx.message.member.id}\`)`)
embed.addField(ctx._locale('basic:punishment.embed.reason'), ctx.args.get('reason')?.value ?? ctx._locale('basic:noReason'))

ctx.send(embed.build())
Expand Down
10 changes: 5 additions & 5 deletions apps/discord/src/commands/slash/mod/BanInfoCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default class BanInfoCommand extends Command {
embed.setColor('MODERATION')
embed.setThumbnail(member.user.avatarURL)
embed.setTitle(ctx._locale('commands:baninfo.title'))
embed.addField(ctx._locale('commands:baninfo.memberName'), `${member.user.username}#${member.user.discriminator} (\`${member.user.id}\`)`)
embed.addField(ctx._locale('commands:baninfo.memberName'), `@${member.user.username} (\`${member.user.id}\`)`)
embed.addField(ctx._locale('commands:baninfo.reason'), member.reason ? member.reason : ctx._locale('basic:noReason'))
const unban = new Button()
.setStyle(4)
Expand Down Expand Up @@ -70,13 +70,13 @@ export default class BanInfoCommand extends Command {
}

unban(guild, member, ctx, ack) {
guild.unbanMember(member.user.id, ctx._locale('basic:punishment.reason', { 0: `${ctx.message.member.user.username}#${ctx.message.member.user.discriminator}`, 1: ctx._locale('basic:noReason') })).then(() => {
guild.unbanMember(member.user.id, ctx._locale('basic:punishment.reason', { 0: `@${ctx.message.member.user.username}`, 1: ctx._locale('basic:noReason') })).then(() => {
const unbanEmbed = new EmbedBuilder()
unbanEmbed.setColor('MODERATION')
unbanEmbed.setThumbnail(member.user.avatarURL)
unbanEmbed.setTitle(ctx._locale('basic:punishment.unbanned', { 0: `${member.user.username}#${member.user.discriminator}` }))
unbanEmbed.addField(ctx._locale('basic:punishment.embed.memberName'), `${member.user.username}#${member.user.discriminator} (\`${member.user.id}\`)`)
unbanEmbed.addField(ctx._locale('basic:punishment.embed.staffName'), `${ctx.message.member.user.username}#${ctx.message.member.user.discriminator} (\`${ctx.message.member.user.id}\`)`)
unbanEmbed.setTitle(ctx._locale('basic:punishment.unbanned', { 0: `@${member.user.username}` }))
unbanEmbed.addField(ctx._locale('basic:punishment.embed.memberName'), `@${member.user.username} (\`${member.user.id}\`)`)
unbanEmbed.addField(ctx._locale('basic:punishment.embed.staffName'), `@${ctx.message.member.user.username} (\`${ctx.message.member.user.id}\`)`)
unbanEmbed.addField(ctx._locale('basic:punishment.embed.reason'), ctx._locale('basic:noReason'))

ack.sendAck('update', {
Expand Down
6 changes: 3 additions & 3 deletions apps/discord/src/commands/slash/mod/KickCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ export default class KickCommand extends Command {
if (!guildMember) return ctx.replyT('error', 'basic:invalidUser')
try {
const embed = new EmbedBuilder()
embed.setTitle(ctx._locale('basic:punishment.kicked', { 0: `${member.username}#${member.discriminator}` }))
embed.setTitle(ctx._locale('basic:punishment.kicked', { 0: `@${member.username}` }))
embed.setColor('MODERATION')
embed.setThumbnail(member.avatarURL)
embed.addField(ctx._locale('basic:punishment.embed.memberName'), `${guildMember.user.username}#${guildMember.user.discriminator} (\`${guildMember.user.id}\`)`)
embed.addField(ctx._locale('basic:punishment.embed.staffName'), `${ctx.message.author.username}#${ctx.message.author.discriminator} (\`${ctx.message.author.id}\`)`)
embed.addField(ctx._locale('basic:punishment.embed.memberName'), `@${guildMember.user.username} (\`${guildMember.user.id}\`)`)
embed.addField(ctx._locale('basic:punishment.embed.staffName'), `@${ctx.message.author.username} (\`${ctx.message.author.id}\`)`)
embed.addField(ctx._locale('basic:punishment.embed.reason'), reason)
guildMember.kick(reason).then(() => ctx.send(embed.build()))

Expand Down
8 changes: 4 additions & 4 deletions apps/discord/src/commands/slash/mod/MuteCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default class MuteCommand extends Command {
const member = await ctx.getUser(ctx.args.get('user').value?.id ?? ctx.args.get('user').value)
const guildMember = ctx.message.guild.members.get(member.id)
const reason = ctx._locale('basic:punishment.reason', {
0: `${ctx.message.member.user.username}#${ctx.message.member.user.discriminator}`, 1: ctx.args.get('reason') ?
0: `@${ctx.message.member.user.username}`, 1: ctx.args.get('reason') ?
ctx.args.get('reason').value : ctx._locale('basic:noReason')
})
const time = ctx.args.get('time')?.value
Expand All @@ -64,9 +64,9 @@ export default class MuteCommand extends Command {
const embed = new EmbedBuilder()
embed.setColor('MODERATION')
embed.setThumbnail(member.avatarURL)
embed.setTitle(ctx._locale('basic:punishment.muted', { 0: `${member.username}#${member.discriminator}` }))
embed.addField(ctx._locale('basic:punishment.embed.memberName'), `${member.username}#${member.discriminator} (\`${member.id}\`)`)
embed.addField(ctx._locale('basic:punishment.embed.staffName'), `${ctx.message.member.username}#${ctx.message.member.discriminator} (\`${ctx.message.member.id}\`)`)
embed.setTitle(ctx._locale('basic:punishment.muted', { 0: `@${member.username}` }))
embed.addField(ctx._locale('basic:punishment.embed.memberName'), `@${member.username} (\`${member.id}\`)`)
embed.addField(ctx._locale('basic:punishment.embed.staffName'), `@${ctx.message.member.username} (\`${ctx.message.member.id}\`)`)
embed.addField(ctx._locale('basic:punishment.embed.reason'), ctx.args.get('reason')?.value ?? ctx._locale('basic:noReason'))

ctx.send(embed.build())
Expand Down
4 changes: 2 additions & 2 deletions apps/discord/src/commands/slash/mod/ReportCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export default class ReportCommand extends Command {
const embed = new EmbedBuilder()
embed.setColor('MODERATION')
embed.setThumbnail(member.avatarURL)
embed.addField(ctx._locale('commands:report.embed.memberName'), `${member.username}#${member.discriminator} (\`${member.id}\`)`)
embed.addField(ctx._locale('commands:report.embed.authorName'), `${ctx.message.author.username}#${ctx.message.author.discriminator} (\`${ctx.message.author.id}\`)`)
embed.addField(ctx._locale('commands:report.embed.memberName'), `@${member.username} (\`${member.id}\`)`)
embed.addField(ctx._locale('commands:report.embed.authorName'), `@${ctx.message.author.username} (\`${ctx.message.author.id}\`)`)
embed.addField(ctx._locale('commands:report.embed.channel'), ctx.message.channel.mention)
embed.addField(ctx._locale('commands:report.embed.reason'), proof ? `[${reason}](${proof})` : reason)

Expand Down
8 changes: 4 additions & 4 deletions apps/discord/src/commands/slash/mod/SoftBanCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ export default class SoftBanCommand extends Command {
}))
.then(() => {
const embed = new EmbedBuilder()
embed.setTitle(ctx._locale('basic:punishment.softBan', { 0: `${member.username}#${member.discriminator}` }))
embed.setTitle(ctx._locale('basic:punishment.softBan', { 0: `@${member.username}` }))
embed.setColor('MODERATION')
embed.setThumbnail(member.avatarURL)
embed.addField(ctx._locale('basic:punishment.memberName'), `${member.username}#${member.discriminator}`, true)
embed.addField(ctx._locale('basic:punishment.embed.memberName'), `${member.username}#${member.discriminator} (\`${member.id}\`)`)
embed.addField(ctx._locale('basic:punishment.embed.staffName'), `${ctx.message.author.username}#${ctx.message.author.discriminator} (\`${ctx.message.author.id}\`)`)
embed.addField(ctx._locale('basic:punishment.memberName'), `@${member.username}`, true)
embed.addField(ctx._locale('basic:punishment.embed.memberName'), `@${member.username} (\`${member.id}\`)`)
embed.addField(ctx._locale('basic:punishment.embed.staffName'), `@${ctx.message.author.username} (\`${ctx.message.author.id}\`)`)
embed.addField(ctx._locale('basic:punishment.embed.reason'), reason)

ctx.send(embed.build())
Expand Down
8 changes: 4 additions & 4 deletions apps/discord/src/commands/slash/mod/UnbanCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ export default class UnbanCommand extends Command {
if (!member) return ctx.replyT('error', 'commands:unban.notBanned')
const reason = ctx.args.get('reason')?.value ?? ctx._locale('basic:noReason')

guild.unbanMember(member.user.id, ctx._locale('basic:punishment.reason', { 0: `${ctx.message.author.username}#${ctx.message.author.discriminator}`, 1: reason })).then(() => {
guild.unbanMember(member.user.id, ctx._locale('basic:punishment.reason', { 0: `@${ctx.message.author.username}`, 1: reason })).then(() => {
const embed = new EmbedBuilder()
embed.setColor('MODERATION')
embed.setThumbnail(member.user.avatarURL)
embed.setTitle(ctx._locale('basic:punishment.unbanned', { 0: `${member.user.username}#${member.user.discriminator}` }))
embed.addField(ctx._locale('basic:punishment.embed.memberName'), `${member.user.username}#${member.user.discriminator} (\`${member.user.id}\`)`)
embed.addField(ctx._locale('basic:punishment.embed.staffName'), `${ctx.message.author.username}#${ctx.message.author.discriminator} (\`${ctx.message.author.id}\`)`)
embed.setTitle(ctx._locale('basic:punishment.unbanned', { 0: `@${member.user.username}` }))
embed.addField(ctx._locale('basic:punishment.embed.memberName'), `@${member.user.username} (\`${member.user.id}\`)`)
embed.addField(ctx._locale('basic:punishment.embed.staffName'), `@${ctx.message.author.username} (\`${ctx.message.author.id}\`)`)
embed.addField(ctx._locale('basic:punishment.embed.reason'), reason)

ctx.send(embed.build())
Expand Down
8 changes: 4 additions & 4 deletions apps/discord/src/commands/slash/mod/UnmuteCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default class UnmuteCommand extends Command {
const member = await ctx.getUser(ctx.args.get('user').value?.id ?? ctx.args.get('user').value)
const guildMember = ctx.message.guild.members.get(member.id)
const reason = ctx._locale('basic:punishment.reason', {
0: `${ctx.message.member.user.username}#${ctx.message.member.user.discriminator}`, 1: ctx.args.get('reason') ?
0: `@${ctx.message.member.user.username}`, 1: ctx.args.get('reason') ?
ctx.args.get('reason').value : ctx._locale('basic:noReason')
})
if (!member) return ctx.replyT('error', 'basic:invalidUser')
Expand All @@ -52,9 +52,9 @@ export default class UnmuteCommand extends Command {
const embed = new EmbedBuilder()
embed.setColor('MODERATION')
embed.setThumbnail(member.avatarURL)
embed.setTitle(ctx._locale('basic:punishment.unmuted', { 0: `${member.username}#${member.discriminator}` }))
embed.addField(ctx._locale('basic:punishment.embed.memberName'), `${member.username}#${member.discriminator} (\`${member.id}\`)`)
embed.addField(ctx._locale('basic:punishment.embed.staffName'), `${ctx.message.member.username}#${ctx.message.member.discriminator} (\`${ctx.message.member.id}\`)`)
embed.setTitle(ctx._locale('basic:punishment.unmuted', { 0: `@${member.username}` }))
embed.addField(ctx._locale('basic:punishment.embed.memberName'), `@${member.username} (\`${member.id}\`)`)
embed.addField(ctx._locale('basic:punishment.embed.staffName'), `@${ctx.message.member.username} (\`${ctx.message.member.id}\`)`)
embed.addField(ctx._locale('basic:punishment.embed.reason'), ctx.args.get('reason')?.value ?? ctx._locale('basic:noReason'))

ctx.send(embed.build())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default class InventoryProfileCommand extends Command {
componentSelected: '',
profileType: user.profileType,
married: user.isMarry,
partnerName: marryWith ? `${marryWith?.username}#${marryWith.discriminator}` : '',
partnerName: marryWith ? `@${marryWith?.username}` : '',
user,
marryWith,
avatar,
Expand Down
2 changes: 1 addition & 1 deletion apps/discord/src/commands/slash/social/ProfileCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export default class ProfileCommand extends Command {
money: Number(user.yens).toLocaleString(),
aboutMe: user.aboutme !== '' ? user.aboutme : ctx._locale('commands:profile.defaultAboutMe', { 0: ctx.db.guild.prefix }),
married: user.isMarry,
partnerName: `${couple?.username}#${couple.discriminator}`,
partnerName: `@${couple?.username}`,
bgId: user.background,
stickerId: user.sticker,
favColor: user.profileColor,
Expand Down
2 changes: 1 addition & 1 deletion apps/discord/src/commands/slash/social/WorkCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default class WorkCommand extends Command {
const jobsList = Object.entries(TypeProfession)
.map(([k, [type, salary, emoji, text, time]]) => {
return {
label: ctx._locale(text),
label: ctx._locale(text.toString()),
value: k,
description: ctx._locale(`commands:work.description.${k}`),
custom_id: k,
Expand Down
2 changes: 1 addition & 1 deletion apps/discord/src/commands/slash/utils/EmojiCommand.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Command, SlashCommandContext } from '../../../structures/util'
import axios from 'axios'
import { CommandBase, CommandOptions } from 'eris'
import { Command, SlashCommandContext } from '../../../structures/util'

export default class EmojiCommand extends Command {
constructor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default class ServerInfoCommand extends Command {
}
const description = [
`**${_locale('commands:serverinfo.guildName')}:** ${guild.name} (\`${guild.id}\`)`,
`**${_locale('commands:serverinfo.guildOwner')}:** ${owner.username}#${owner.discriminator} (\`${owner.id}\`)`,
`**${_locale('commands:serverinfo.guildOwner')}:** @${owner.username} (\`${owner.id}\`)`,
`**${_locale('commands:serverinfo.guildAFKChannel.title')}:** ${guild.channels.get(guild.afkChannelID) ? `${guild.channels.get(guild.afkChannelID).name} (\`${guild.channels.get(guild.afkChannelID).id}\`)` : _locale('commands:serverinfo.guildAFKChannel.noAfkChannel')}`,
`**${_locale('commands:serverinfo.booster.levelCount')}:** ${guild.premiumTier} (${_locale('commands:serverinfo.booster.boosterCount')}: ${guild.premiumSubscriptionCount})`,
`**${_locale('commands:serverinfo.guildMember')}:** ${guild.memberCount}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default class UserInfoCommand extends Command {
const embed = new EmbedBuilder()
embed.setColor(`#${highRole?.color.toString(16)}` ?? null)
embed.setThumbnail(avatar)
embed.addField(ctx._locale('commands:userinfo.username'), `${member.username}#${member.discriminator}`, true)
embed.addField(ctx._locale('commands:userinfo.username'), `@${member.username}`, true)
embed.addField(ctx._locale('commands:userinfo.userid'), member.id, true)
embed.addField(ctx._locale('commands:userinfo.createdAt'), `<t:${parseInt(member.createdAt / 1000).toFixed(0)}:F>`, true)
guildMember ? embed.addField(ctx._locale('commands:userinfo.joinedAt'), `<t:${parseInt(guildMember.joinedAt / 1000).toFixed(0)}:F> (<t:${parseInt(guildMember.joinedAt / 1000).toFixed(0)}:R>)`, true) : null
Expand Down
2 changes: 1 addition & 1 deletion apps/discord/src/commands/vanilla/dev/BlackListCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default class BlackListCommand extends Command {
const user = await ctx.getUser(ctx.args[1])
if (!user) return ctx.reply('error', 'eu não posso editar algo de uma pessoa que não foi informada.')
const dbUser = await ctx.db.db.getOrCreate(user.id)
const userInfo = user ? `${user.username}#${user.discriminator} - (${user.id})` : dbUser.id
const userInfo = user ? `@${user.username} - (${user.id})` : dbUser.id
const msg = `\`\`\`asciidoc\n== USER BANNED INFO ==\n\n• User :: ${userInfo}\n• Banned :: ${dbUser.blacklist}\n• Reason :: ${dbUser.blacklistReason}\`\`\``
ctx.send(msg)
}
Expand Down
31 changes: 29 additions & 2 deletions apps/discord/src/defineTypes/defineState.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,43 @@ const isJson = (data) => {
return false
}
}

/**
* @template T
*/
export class StateData {
/**
*
* @param {T} actionState
*/
constructor(actionState) {
this.actionState = actionState
}
}

/**
*
* @template T
* @typedef StateEffect
* @property {(property: T) => keyof property} get
* @property {<S>(data: S) => StateDataEffect<T & S>} setState
* @property {(property: keyof T) => StateDataEffect<T>} del
* @property {import('events').EventEmitter | null} [event]
* @property {() => void} destroy;
* @memberof StateEffect
*/

/**
* @template T
* @typedef StateDataEffect
* @type {StateData<StateEffect<T>> & T}
*/

/**
* @template T
* @description This will help save unnecessary variable and after you are done and set the data to null and let the GC work.
* @returns {StateData?}
* @param {T} [data]
* @param {{eventEmitter: boolean;}} [options]
* @returns {StateDataEffect<T>}
*/
export const defineState = (data, options = { eventEmitter: false }) => {
let state = data ?? {}
Expand Down
1 change: 1 addition & 0 deletions apps/discord/src/lib/tokamak.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ const renderRize = async (options = optionsTokamak) => {
/**
*
* @param {keyof ConstantBackground} name
* @param {cache: boolean} [options]
* @returns {Promise<Buffer | null | undefined>}
*/
export const getBackground = async (name, options = { cache: false }) => {
Expand Down
2 changes: 1 addition & 1 deletion apps/discord/src/listeners/client/ErrorListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default class ErrorListener extends Listener {
embed.setColor('ERROR')
embed.setTitle(_locale('events:executionFailure.embedTitle'))
embed.setDescription(`\`\`\`js\n${error.stack.removePath().slice(0, 1800)}\`\`\``)
embed.setFooter(`Instance: ${client.user.username}#${client.user.discriminator}`, client.user.avatarURL)
embed.setFooter(`Instance: @${client.user.username}`, client.user.avatarURL)
embed.setTimestamp()
client.executeWebhook(webhook.id, webhook.token, {
embeds: [embed],
Expand Down
Loading

0 comments on commit 6598a2c

Please sign in to comment.