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

Commit

Permalink
Upgrade IRC library to v0.14.1 for nicklist hotfix (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
aronson authored Oct 3, 2023
1 parent 84073b7 commit 7fdc4f5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
7 changes: 6 additions & 1 deletion lib/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
createDiscordReadyListener,
} from './discordListeners.ts';
import { AllWebhookMessageOptions } from 'https://raw.githubusercontent.com/harmonyland/harmony/main/src/structures/webhook.ts';
import { DiscordAPIError } from 'https://raw.githubusercontent.com/harmonyland/harmony/main/mod.ts';

// Usernames need to be between 2 and 32 characters for webhooks:
const USERNAME_MIN_LENGTH = 2;
Expand Down Expand Up @@ -228,7 +229,11 @@ export default class Bot {
return content.replace(userMentionRegex, `@${displayName}`);
} catch (e) {
// Happens when a webhook is mentioned similar to a user, prevent 404 from crashing bot
this.logger.error(e);
if (e instanceof DiscordAPIError) {
this.logger.error(`Discord API error in user mention lookup, falling back to no mention:\n${e}`);
} else {
this.logger.error(e);
}
return '';
}
}
Expand Down
30 changes: 15 additions & 15 deletions lib/deps.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// IRC exports
export { Client as IrcClient } from 'https://deno.land/x/[email protected].0/mod.ts';
export type { ClientOptions } from 'https://deno.land/x/[email protected].0/mod.ts';
export type { PrivmsgEvent } from 'https://deno.land/x/[email protected].0/plugins/privmsg.ts';
export type { ClientError } from 'https://deno.land/x/[email protected].0/core/errors.ts';
export type { RegisterEvent } from 'https://deno.land/x/[email protected].0/plugins/register.ts';
export type { NoticeEvent } from 'https://deno.land/x/[email protected].0/plugins/notice.ts';
export type { NickEvent } from 'https://deno.land/x/[email protected].0/plugins/nick.ts';
export type { JoinEvent } from 'https://deno.land/x/[email protected].0/plugins/join.ts';
export type { PartEvent } from 'https://deno.land/x/[email protected].0/plugins/part.ts';
export type { QuitEvent } from 'https://deno.land/x/[email protected].0/plugins/quit.ts';
export type { NicklistEvent } from 'https://deno.land/x/[email protected].0/plugins/nicklist.ts';
export type { CtcpActionEvent } from 'https://deno.land/x/[email protected].0/plugins/action.ts';
export type { InviteEvent } from 'https://deno.land/x/[email protected].0/plugins/invite.ts';
export { Client as IrcClient } from 'https://deno.land/x/[email protected].1/mod.ts';
export type { ClientOptions } from 'https://deno.land/x/[email protected].1/mod.ts';
export type { PrivmsgEvent } from 'https://deno.land/x/[email protected].1/plugins/privmsg.ts';
export type { ClientError } from 'https://deno.land/x/[email protected].1/core/errors.ts';
export type { RegisterEvent } from 'https://deno.land/x/[email protected].1/plugins/register.ts';
export type { NoticeEvent } from 'https://deno.land/x/[email protected].1/plugins/notice.ts';
export type { NickEvent } from 'https://deno.land/x/[email protected].1/plugins/nick.ts';
export type { JoinEvent } from 'https://deno.land/x/[email protected].1/plugins/join.ts';
export type { PartEvent } from 'https://deno.land/x/[email protected].1/plugins/part.ts';
export type { QuitEvent } from 'https://deno.land/x/[email protected].1/plugins/quit.ts';
export type { NicklistEvent } from 'https://deno.land/x/[email protected].1/plugins/nicklist.ts';
export type { CtcpActionEvent } from 'https://deno.land/x/[email protected].1/plugins/action.ts';
export type { InviteEvent } from 'https://deno.land/x/[email protected].1/plugins/invite.ts';
// Harmony/Discord exports
export {
AllowedMentionType,
Expand All @@ -23,5 +23,5 @@ export {
Webhook,
} from 'https://raw.githubusercontent.com/harmonyland/harmony/main/mod.ts';
// std exports
export { resolve as resolvePath } from 'https://deno.land/std@0.200.0/path/mod.ts';
export { parse as parseCLI } from 'https://deno.land/std@0.200.0/flags/mod.ts';
export { resolve as resolvePath } from 'https://deno.land/std@0.203.0/path/mod.ts';
export { parse as parseCLI } from 'https://deno.land/std@0.203.0/flags/mod.ts';

0 comments on commit 7fdc4f5

Please sign in to comment.