From 9dc53eddef14fe956e14326e212d5697ee3c4781 Mon Sep 17 00:00:00 2001 From: marzavec Date: Tue, 11 Mar 2025 11:51:16 -0700 Subject: [PATCH] fixing some labels --- commands/channels/claimchannel.js | 2 +- commands/channels/makeprivate.js | 2 +- commands/channels/makepublic.js | 2 +- commands/channels/renewclaim.js | 2 +- commands/channels/setlevel.js | 2 +- commands/channels/unclaimchannel.js | 2 +- commands/mod/forceflair.js | 8 ++++---- commands/mod/kick.js | 4 ++-- commands/utility/_Constants.js | 11 ++++++++++- 9 files changed, 22 insertions(+), 13 deletions(-) diff --git a/commands/channels/claimchannel.js b/commands/channels/claimchannel.js index 587cd8b..6e0fc52 100644 --- a/commands/channels/claimchannel.js +++ b/commands/channels/claimchannel.js @@ -39,7 +39,7 @@ export async function run({ if (!socket.trip) { return server.reply({ cmd: 'warn', - text: 'Failed to run command: Missing trip code.', + text: 'Failed to run command: You must have a trip code to do this.', id: Errors.Global.MISSING_TRIPCODE, channel: socket.channel, // @todo Multichannel }, socket); diff --git a/commands/channels/makeprivate.js b/commands/channels/makeprivate.js index e366d11..b59b849 100644 --- a/commands/channels/makeprivate.js +++ b/commands/channels/makeprivate.js @@ -30,7 +30,7 @@ export async function run({ if (!socket.trip) { return server.reply({ cmd: 'warn', - text: 'Failed to run command: Missing trip code.', + text: 'Failed to run command: You must have a trip code to do this.', id: Errors.Global.MISSING_TRIPCODE, channel: socket.channel, // @todo Multichannel }, socket); diff --git a/commands/channels/makepublic.js b/commands/channels/makepublic.js index 02bafd4..1e81d70 100644 --- a/commands/channels/makepublic.js +++ b/commands/channels/makepublic.js @@ -35,7 +35,7 @@ export async function run({ if (!socket.trip) { return server.reply({ cmd: 'warn', - text: 'Failed to run command: Missing trip code.', + text: 'Failed to run command: You must have a trip code to do this.', id: Errors.Global.MISSING_TRIPCODE, channel: socket.channel, // @todo Multichannel }, socket); diff --git a/commands/channels/renewclaim.js b/commands/channels/renewclaim.js index f6a0747..4149003 100644 --- a/commands/channels/renewclaim.js +++ b/commands/channels/renewclaim.js @@ -36,7 +36,7 @@ export async function run({ if (!socket.trip) { return server.reply({ cmd: 'warn', - text: 'Failed to run command: Missing trip code.', + text: 'Failed to run command: You must have a trip code to do this.', id: Errors.Global.MISSING_TRIPCODE, channel: socket.channel, // @todo Multichannel }, socket); diff --git a/commands/channels/setlevel.js b/commands/channels/setlevel.js index d89e764..37605d9 100644 --- a/commands/channels/setlevel.js +++ b/commands/channels/setlevel.js @@ -67,7 +67,7 @@ export async function run({ return server.reply({ cmd: 'warn', text: 'Failed to set level: New level may not be the same or greater than your own.', - id: Errors.SetLevel.BAD_LEVEL, + id: Errors.SetLevel.LEVEL_CONFLICT, channel: socket.channel, // @todo Multichannel }, socket); } diff --git a/commands/channels/unclaimchannel.js b/commands/channels/unclaimchannel.js index a187337..088f103 100644 --- a/commands/channels/unclaimchannel.js +++ b/commands/channels/unclaimchannel.js @@ -36,7 +36,7 @@ export async function run({ if (!socket.trip) { return server.reply({ cmd: 'warn', - text: 'Failed to run command: Missing trip code.', + text: 'Failed to run command: You must have a trip code to do this.', id: Errors.Global.MISSING_TRIPCODE, channel: socket.channel, // @todo Multichannel }, socket); diff --git a/commands/mod/forceflair.js b/commands/mod/forceflair.js index 07c264c..1d49771 100644 --- a/commands/mod/forceflair.js +++ b/commands/mod/forceflair.js @@ -51,7 +51,7 @@ export async function run({ return server.reply({ cmd: 'warn', text: 'Invalid flair', - id: 11111, // Errors.ChangeColor.INVALID_COLOR, + id: Errors.ForceFlairErrors.INVALID_FLAIR, channel, // @todo Multichannel }, socket); } @@ -124,7 +124,7 @@ export function flairCheck({ server.reply({ cmd: 'warn', text: 'Refer to `/help forceflair` for instructions on how to use this command.', - id: 11111, // Errors.ForceColor.MISSING_NICK, + id: Errors.ForceFlairErrors.MISSING_NICK, channel: socket.channel, // @todo Multichannel }, socket); @@ -134,8 +134,8 @@ export function flairCheck({ if (input[2] === undefined) { server.reply({ cmd: 'warn', - text: 'Invalid newFlair', - id: 11111, // Errors.ChangeColor.INVALID_COLOR, + text: 'Invalid flair', + id: Errors.ForceFlairErrors.INVALID_FLAIR, channel: socket.channel, // @todo Multichannel }, socket); diff --git a/commands/mod/kick.js b/commands/mod/kick.js index a6144fb..826a355 100644 --- a/commands/mod/kick.js +++ b/commands/mod/kick.js @@ -163,12 +163,12 @@ export function runKickCheck({ if (payload.text.startsWith('/kick ')) { const input = payload.text.split(' '); - // If there is no trip parameter + // If there is no nick parameter if (!input[1]) { server.reply({ cmd: 'warn', text: 'Failed to kick: Missing name. Refer to `/help kick` for instructions on how to use this command.', - id: 111111, // Errors.SetLevel.BAD_TRIP, + id: Errors.Global.UNKNOWN_USER, // this is wrong #lazydev channel: socket.channel, // @todo Multichannel }, socket); diff --git a/commands/utility/_Constants.js b/commands/utility/_Constants.js index e2fb262..3256d8b 100644 --- a/commands/utility/_Constants.js +++ b/commands/utility/_Constants.js @@ -31,7 +31,8 @@ const ChangeColorErrors = UnclaimChannelErrors + 10; const EmoteErrors = ChangeColorErrors + 10; const WhisperErrors = EmoteErrors + 10; const ForceColorErrors = WhisperErrors + 10; -const UsersErrors = ForceColorErrors + 10; +const ForceFlairErrors = ForceColorErrors + 10; +const UsersErrors = ForceFlairErrors + 10; /** * Holds the numeric id values for each error type @@ -103,6 +104,7 @@ export const Errors = { BAD_LABEL: SetLevelErrors + 2, BAD_LEVEL: SetLevelErrors + 3, APPLY_ERROR: SetLevelErrors + 4, + LEVEL_CONFLICT: SetLevelErrors + 5, }, SetMOTD: { @@ -131,6 +133,11 @@ export const Errors = { MISSING_NICK: ForceColorErrors + 1, }, + ForceFlairErrors: { + INVALID_FLAIR: ForceFlairErrors + 1, + MISSING_NICK: ForceFlairErrors + 2, + }, + Users: { BAD_HASH_OR_IP: UsersErrors + 1, }, @@ -162,6 +169,8 @@ export const SystemMOTDs = [ 'Protip: Use a password or add a "#" followed by a password to get a trip code', 'Protip: You can claim an unclaimed channel by using /claimchannel', 'Protip: You can send emotes like: /me does a thing', + 'Protip: The owner of a channel can create moderators: /setlevel channelModerator', + 'Protip: A moderator can kick people from the room: /kick ', ]; /**