Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Commit

Permalink
Better formatting for part/join/quit/nick IRC events (#45)
Browse files Browse the repository at this point in the history
* Add new defaults for part/join/quit messages to discord

* Implement better type checking for zod IRC options
  • Loading branch information
aronson authored Oct 12, 2023
1 parent 7833c4e commit 8192597
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const ConfigSchema = z.object({
nickname: z.string(),
discordToken: z.string(),
channelMapping: z.record(z.string()),
ircOptions: z.unknown().optional(),
ircOptions: z.custom<Partial<ClientOptions>>().optional(),
commandCharacters: z.array(z.string()).optional(),
ircNickColor: z.boolean().optional(),
ircNickColors: z.array(z.string()).optional(),
Expand Down
8 changes: 4 additions & 4 deletions lib/ircListeners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export function createIrcNickListener(bot: Bot) {
if (!bot.config.ircStatusNotices) return;
bot.sendExactToDiscord(
channel,
`*${oldNick}* is now known as ${newNick}`,
`*${oldNick}* is now known as ${newNick} in the connected IRC server`,
);
}
} else {
Expand Down Expand Up @@ -135,7 +135,7 @@ export function createIrcJoinListener(bot: Bot) {
if (!bot.config.ircStatusNotices) return;
await bot.sendExactToDiscord(
channel,
`*${nick}* has joined the channel`,
`*${nick}* has joined the connected IRC channel`,
);
};
}
Expand Down Expand Up @@ -169,7 +169,7 @@ export function createIrcPartListener(bot: Bot) {
if (!bot.config.ircStatusNotices) return;
await bot.sendExactToDiscord(
channel,
`*${nick}* has left the channel (${reason})`,
`*${nick}* has left the connected IRC channel (${reason})`,
);
};
}
Expand Down Expand Up @@ -199,7 +199,7 @@ export function createIrcQuitListener(bot: Bot) {
) return;
bot.sendExactToDiscord(
channel,
`*${nick}* has quit (${reason})`,
`*${nick}* has quit from the connected IRC server (${reason})`,
);
});
};
Expand Down

0 comments on commit 8192597

Please sign in to comment.