get-got / discord-downloader-go

A Discord bot program to download and otherwise handle files sent in Discord channels with extensive configuration. Can be used as a genuine Discord Bot or user account / self-bot
MIT License
271 stars 30 forks source link

Bot Crashing during history on arm64 #124

Closed Braccae closed 5 months ago

Braccae commented 5 months ago

Hi, I recently finished switching my servers over to arm64 and have noticed that this bot crashes during the history routine. The last bit of log before the crash is

2024/01/14 23:33:44 history.go:597:     > [History] 1110686102571978782/AUTORUN: Tried to edit status message but it doesn't exist, sending new one.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x535878]

goroutine 1486 [running]:
main.getSource(_, _)
        P:/Projects/Go/src/github.com/get-got/discord-downloader-go/config.go:1165 +0x38
main.handleHistory(0x0, {0x40000d3a58, 0x13}, {0x0, 0x0}, {0x0, 0x0})
        P:/Projects/Go/src/github.com/get-got/discord-downloader-go/history.go:242 +0xc00
created by main.main.func2
        P:/Projects/Go/src/github.com/get-got/discord-downloader-go/main.go:184 +0x4f4

For now, I'm running the x86_64 version again locally on an old laptop. but I would prefer to be able to move this back to my gallery server.

get-got commented 5 months ago

It's failing to edit the status message it sent (if it was even able to send one) and some bad code was making it crash in that instance. Fixed in v2.5.0, pushing today. https://github.com/get-got/discord-downloader-go/commit/0993bcefa24d49c36d50b5fcbb101c73edbf5fd3