pinano-discord / Pinano-Discord-Bot

A Discord bot for the Pinano guild
MIT License
9 stars 11 forks source link

Don't crash when someone else adds a room #194

Closed pianiststickman closed 3 years ago

pianiststickman commented 3 years ago

Three recent crashes saw the following sequence: an admin added a room; the room wasn't tracked since the bot didn't create it; when someone joined the room, we tried to get a channel tracker and failed, and then crashed dereferencing the pointer. This change makes it so that when the autocreation feature is enabled, rooms added by users other than the bot are not tracked by the bot (nor are they auto-locked), and warns the announcement channel upon creation if that is the case.

(This does not apply if the room autocreation feature is turned off - in that case the bot is explicitly depending upon an outside process to create and delete rooms for it.)