Strencher / BetterDiscordStuff

A collection of my BetterDiscord plugins
https://strencher.github.io/BetterDiscordStuff/
358 stars 226 forks source link

[Bug] UnreadCountBadges could not be compiled #371

Closed Setnour6 closed 8 months ago

Setnour6 commented 10 months ago

Using Windows 11 on the latest October 28 2023 build of Discord, BetterDiscord, etc. before 1:55 PM EST

Description

When I load discord, the UnreadCountBadges plugin won't load at all, and displays an error.

Message: TypeError: Cannot read properties of undefined (reading 'reduce') at eval (betterdiscord://plugins/UnreadCountBadges.plugin.js:272:143) at createMemoize (betterdiscord://plugins/UnreadCountBadges.plugin.js:105:12) at get @discord/icons [as @discord/icons] (betterdiscord://plugins/UnreadCountBadges.plugin.js:272:12) at eval (betterdiscord://plugins/UnreadCountBadges.plugin.js:675:41) at eval (betterdiscord://plugins/UnreadCountBadges.plugin.js:1241:5) at buildPlugin (betterdiscord://plugins/UnreadCountBadges.plugin.js:1243:4) at eval (betterdiscord://plugins/UnreadCountBadges.plugin.js:1248:2) at D.requireAddon (betterdiscord/renderer.js:5:33852) at D.loadAddon (betterdiscord/renderer.js:5:6322) at D.loadAddon (betterdiscord/renderer.js:5:31520)

I could not find any update through forked repositories. If someone has updated it, please let me know and I can use it.

Reproduction steps (assuming you know how to use BetterDiscord):

  1. Open discord with the plugin installed
  2. You will find the message appear showing plugin errors
  3. If needed, enable ZeresPluginLibrary and BDFDB
  4. Restart or close discord completely
  5. Open discord again
  6. The error should still appear

This issue happens 100% of the time for me.

Plugins being used:

image Disabled: AutoStartRichPresence, BetterBannedUsers, BetterMediaPlayer, BlurNsfw, ChannelPermissions, CompleteTimestamps, Copier, DoNotTrack, PermissionsViewer, Timezones

ElRaphik commented 8 months ago

From what I understand, this bug occurs because the method reduce is used over an undefined object, I think it's because the way to obtain such objects is deprecated and the plugin has to be partially rewritten. I haven't touched to discord.js not BetterDiscord in a while and didn't follow the last two years' changes so chances are I'm wrong. I'll try to find something tho (if the bug still exists).

domi-btnr commented 8 months ago

Thats known: https://github.com/Strencher/BetterDiscordStuff/issues/324 I'll close the issue to not get confused about the amount of issues. When UnreadCountBadges gets fixed, I'll update the Issue