Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Discord.JS v14 #632

Closed
wants to merge 45 commits into from
Closed

Update to Discord.JS v14 #632

wants to merge 45 commits into from

Conversation

aronson
Copy link

@aronson aronson commented Aug 24, 2023

I updated the application.

Fixed some bugs/annoyances too:

  • No longer crashes when typing in a VC text channel in Discord
  • Changed default Discord->IRC username mapping to use displayName instead of username
  • Partial role matching was annoying in my testing so I guarded it with a new config, feel free to undo
  • Updated Winston to fix logging on some newer node versions

Problems:

  • I had to disable @ everyone pings because I'm not sure how to enable them
  • If you try to bind to a non-text Discord channel by ID or name it'll crash the app. I suggest not doing this

@dustwolf
Copy link

Much appreciated. I'm merging this with my own fork and testing...

@dustwolf
Copy link

The merged code seems to be working.

One change that I can see is that the "SERVER MEMBERS INTENT Required for your bot to receive events listed under GUILD_MEMBERS." is now required whereas the old version didn't need it. Other than that, everything seems to have worked like a charm.

@aronson aronson changed the title Update to Discord.JS v14 Update to Discord.JS v14 (and move to TypeScript) Aug 25, 2023
@aronson
Copy link
Author

aronson commented Aug 25, 2023

Continuing to work on this project, I made a number of fixes/changes and also converted the application to typescript (which should not affect end-users).

Changes that affect end-users:

  • I added a new config property, allowRoleMentions, true by default (the original behavior)
  • Related: role mentions were disabled by default before this comment, they're re-enabled now
  • I merged in the /names command PR from Kage
  • Network calls now use async/await where possible, potentially improving performance under load

Developer-relevant changes:

  • I switched to yarn, but you don't have to
  • I switched to tsx as the runner and removed the compilation step
  • I changed the linting rules
  • I installed prettier and ran it on everything
  • I re-worked the overall package.json, removing now unused dependencies
  • Sources are now in src/ instead of lib/

I made opinionated development changes and foolishly opened this PR against my main branch instead of a contribute branch, so these changes are also in this PR. I now understand this project is not actively maintained so I don't think it will be an issue.

I attempted to remove the GuildMembers intent as dustwolf mentioned above, but it seems it's necessary for the bot. Without it messages will not make it through the bridge. Not sure why that changed.

@aronson aronson closed this Aug 25, 2023
@aronson aronson changed the title Update to Discord.JS v14 (and move to TypeScript) Update to Discord.JS v14 Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants