DarkGuy10 / BotClient

A discord botclient built with Electron, React and discord.js.
MIT License
182 stars 17 forks source link

bug: client crashes while parsing discord system messages #45

Open hideonrosie opened 2 years ago

hideonrosie commented 2 years ago

Issue checklist

Issue description

So, i just got botclient crashed when switching from other channel to a channel that have AutoMod logging

Here is the crash report:

TypeError: Cannot read properties of undefined (reading 'startsWith')
    at r (file:///C:/Users/Admin/AppData/Local/Programs/botclient/resources/app.asar/build/static/js/main.89189ca3.js:2:1698255)
    at discord-messages
    at _ (file:///C:/Users/Admin/AppData/Local/Programs/botclient/resources/app.asar/build/static/js/main.89189ca3.js:2:115420)
    at DiscordMessages
    at main
    at div
    at div
    at r (file:///C:/Users/Admin/AppData/Local/Programs/botclient/resources/app.asar/build/static/js/main.89189ca3.js:2:1689800)
    at div
    at div
    at n (file:///C:/Users/Admin/AppData/Local/Programs/botclient/resources/app.asar/build/static/js/main.89189ca3.js:2:1672985)
    at div
    at div
    at div
    at div
    at div
    at div
    at n (file:///C:/Users/Admin/AppData/Local/Programs/botclient/resources/app.asar/build/static/js/main.89189ca3.js:2:1720516)
    at n (file:///C:/Users/Admin/AppData/Local/Programs/botclient/resources/app.asar/build/static/js/main.89189ca3.js:2:1598774)

Current behavior

No response

Expected behavior

No response

BotClient version

v0.10.3

Operating System

Windows 10 21H2. Build 19044.1826

How did you download the application?

From GitHub releases (or links from the readme)

Priority this issue should have

Medium (should be fixed soon)

Addition information

No response

DarkGuy10 commented 2 years ago

Can you give information on the channel that's causing the said error?

Like, channel-type, permissions, etc

Also, my closest guess is it's something to do with weird messages but i cant say for sure until I can reproduce the crash.

hideonrosie commented 2 years ago

This is that channel Information Type: TEXT Channel Permmissions:

In the server, I dedicate this channel to storing AutoMod logs, so I think AutoMod is the reason for this problem. Because then I tried deleting all Discord System messages and the Client didn't crash anymore

Sorry for the late reply, I've been busy studying for exams lately

DarkGuy10 commented 2 years ago

Yup, it's definitely an issue with Discord System messages. The only ones that are currently being parsed appropriately are the user joining messages.

The message parser is mostly legacy code from early days of the client and needs to be rewritten. This issue will be fixed at the same time :+1:

Sorry for the late reply, I've been busy studying for exams lately

Np! Tysm for taking the time to file this report and helping us out!