AndBobsYourUncle / stable-diffusion-discord-bot

A Discord bot, written in Go, that interfaces with the Automatic 1111's API interface.
MIT License
128 stars 35 forks source link

The bot crashes if anyone tries to dm it #15

Open cc32133 opened 1 year ago

cc32133 commented 1 year ago

This is the error i get.

If anyone could help me i would be so thankful!

panic: runtime error: invalid memory address or nil pointer dereference [signal 0xc0000005 code=0x0 addr=0x50 pc=0x81b7ec]

goroutine 83 [running]: stable_diffusion_bot/discord_bot.(botImpl).processImagineCommand(0xc0001de7e0, 0x20?, 0xc00000a098) C:/stable/stable-diffusion-discord-bot-master/stable-diffusion-discord-bot-master/discord_bot/discord_bot.go:331 +0x40c stable_diffusion_bot/discord_bot.New.func2(0x0?, 0xc00000a098) C:/stable/stable-diffusion-discord-bot-master/stable-diffusion-discord-bot-master/discord_bot/discord_bot.go:99 +0x430 github.com/bwmarrin/discordgo.interactionCreateEventHandler.Handle(0x7fc34e?, 0xc000222380?, {0x876c40?, 0xc00000a098?}) /github.com/bwmarrin/discordgo@v0.26.1/eventhandlers.go:693 +0x38 created by github.com/bwmarrin/discordgo.(Session).handle /github.com/bwmarrin/discordgo@v0.26.1/event.go:171 +0x16a

drusepth commented 7 months ago

Just an FYI this seems to still be a bug in the latest release (v0.2.2).

For anyone else having this issue, here's a quick bash runner that'll just restart your bot any time it crashes:

while true; do ./stable_diffusion_bot -token YOUR_TOKEN -guild YOUR_GUILD_ID -host YOUR_HOST; echo "Bot crashed, restarting..."; sleep 1; done