diff --git a/src/commands/promote-demote.ts b/src/commands/promote-demote.ts index eba20e91..b325480d 100644 --- a/src/commands/promote-demote.ts +++ b/src/commands/promote-demote.ts @@ -1,5 +1,4 @@ import { ApplicationCommandOptionType, EmbedBuilder } from 'discord.js'; -import capitaliseString from '@util/capitalise-string'; export default { data: { @@ -39,7 +38,7 @@ export default { await bot.executeTask(`/g ${type} ${user}`); embed .setColor(type === 'promote' ? 'Green' : 'Red') - .setTitle(capitaliseString(`${type}d!`)) + .setTitle(type === 'promote' ? 'Promoted!' : 'Demoted!') .setDescription(`${user} has been ${type}d!`); } catch (e) { embed diff --git a/src/commands/toggle-mute.ts b/src/commands/toggle-mute.ts index 3663eb35..d9e6b63e 100644 --- a/src/commands/toggle-mute.ts +++ b/src/commands/toggle-mute.ts @@ -1,5 +1,4 @@ import { ApplicationCommandOptionType, EmbedBuilder } from 'discord.js'; -import capitaliseString from '@util/capitalise-string'; export default { data: { @@ -49,7 +48,7 @@ export default { try { await bot.executeTask(`/g ${type} ${user} ${duration}`); embed - .setTitle(capitaliseString(`${type}d!`)) + .setTitle(type === 'mute' ? 'Muted!' : 'Unmuted!') .setDescription( `${user} was ${type}d${type === 'mute' ? ` for ${duration}!` : '!'}` ) diff --git a/src/events/mineflayer/chat/member-kick.ts b/src/events/mineflayer/chat/member-kick.ts index 7d855f54..addb406a 100644 --- a/src/events/mineflayer/chat/member-kick.ts +++ b/src/events/mineflayer/chat/member-kick.ts @@ -8,15 +8,15 @@ export default { bot, rank: string | undefined, playerName: string, - kickedByRank: string | undefined, - kickedByPlayerName: string + kickerRank: string | undefined, + kickerName: string ) => { await bot.sendToDiscord( 'gc', `${Emojis.negativeGuildEvent} **${rank ? `${rank} ` : ''}${escapeMarkdown( playerName - )}** was kicked by **${kickedByRank ? `${kickedByRank} ` : ''}${escapeMarkdown( - kickedByPlayerName + )}** was kicked by **${kickerRank ? `${kickerRank} ` : ''}${escapeMarkdown( + kickerName )}**`, undefined, true diff --git a/src/events/mineflayer/chat/promote-demote.ts b/src/events/mineflayer/chat/promote-demote.ts index 637b7d80..7829b1f1 100644 --- a/src/events/mineflayer/chat/promote-demote.ts +++ b/src/events/mineflayer/chat/promote-demote.ts @@ -10,14 +10,14 @@ export default { rank: string | undefined, playerName: string, type: 'promoted' | 'demoted', - guildRankFrom: string, - guildRankTo: string + originalRank: string, + newRank: string ) => { await bot.sendToDiscord( 'gc', `${type === 'promoted' ? Emojis.positiveGuildEvent : Emojis.negativeGuildEvent} **${ rank ? `${rank} ` : '' - }${escapeMarkdown(playerName)}** was ${type} to ${guildRankTo} from ${guildRankFrom}!`, + }${escapeMarkdown(playerName)}** was ${type} to ${newRank} from ${originalRank}!`, getRankColor(rank), true ); diff --git a/src/events/regex.ts b/src/events/regex.ts index dcdbad2c..7819baca 100644 --- a/src/events/regex.ts +++ b/src/events/regex.ts @@ -35,7 +35,7 @@ export default { * Returns: * - Hypixel Rank * - Player Name - * - muted / unmuted + * - Type (muted / unmuted) * - Muter Hypixel Rank * - Muter Player Name * - Muter Player Name @@ -49,7 +49,7 @@ export default { * * Returns: * - Player Name - * - joined / left + * - Type (joined / left) */ 'chat:joinLeave': /^Guild > (\w{2,17}).*? (joined|left)\.$/, @@ -76,7 +76,7 @@ export default { * When "/g online" is typed, and the online and total member count is shown * * Returns: - * - Online / Total + * - Type (Online / Total) * - Member Count */ 'chat:memberCount': /^(Online|Total) Members: (\d+)$/, @@ -87,7 +87,7 @@ export default { * Returns: * - Hypixel Rank * - Player Name - * - joined / left + * - Type (joined / left) */ 'chat:memberJoinLeave': /^(\[.*])?\s*(\w{2,17}).*? (joined|left) the guild!$/, @@ -109,7 +109,7 @@ export default { * Returns: * - Hypixel Rank * - Player Name - * - promoted / demoted + * - Type (promoted / demoted) * - From Rank * - To Rank */ diff --git a/src/util/capitalise-string.ts b/src/util/capitalise-string.ts deleted file mode 100644 index cb99705e..00000000 --- a/src/util/capitalise-string.ts +++ /dev/null @@ -1 +0,0 @@ -export default (str: string) => str.charAt(0).toUpperCase() + str.slice(1); diff --git a/src/util/emojis.ts b/src/util/emojis.ts index 87718e35..8f18c494 100644 --- a/src/util/emojis.ts +++ b/src/util/emojis.ts @@ -1,41 +1,10 @@ export default { - /** - * Join Emoji - */ join: '📥', - - /** - * Leave Emoji - */ leave: '📤', - - /** - * Success Emoji - */ success: '✅', - - /** - * Error Emoji - */ error: '❌', - - /** - * Warning Emoji - */ warning: '⚠️', - - /** - * Alert Emoji - */ alert: '🚨', - - /** - * Positive Guild Event Emoji - */ positiveGuildEvent: '🎉', - - /** - * Negative Guild Event Emoji - */ negativeGuildEvent: '👋', }; diff --git a/test.js b/test.js new file mode 100644 index 00000000..d0f396d9 --- /dev/null +++ b/test.js @@ -0,0 +1,3 @@ +if (' '.tri) { + console.log('true'); +}