lizardman301 / Lizard-bot-rsf

Simple bot built for the r/streetfighter East Coast online weekly tournament to help players see current round and with some commands for TOs. Requires discord.py
Mozilla Public License 2.0
6 stars 4 forks source link

!botrole breaks when joining a new server #114

Closed lizardman301 closed 3 years ago

lizardman301 commented 3 years ago

Describe the bug !botrole will break the bot because it can not return a NoneType.

To Reproduce Steps to reproduce the behavior:

  1. Let Lizard-BOT join a new server
  2. Use !botrole command
  3. See error message

Expected behavior !botrole should either return "No role" or "Everyone"

Screenshots I am an idiot and deleted the message, but it occured in Mr_Madgear tourney's server. image

Additional context I broke it 😢

nogarremi commented 3 years ago

I'll test this in a moment

nogarremi commented 3 years ago

Two issues in one.

First is there is a problem bringing in the empty disabled list on server start that makes the command fail (This should probably be affecting more commands)

Secondly, there is the fact that the empty botrole returns a None object

Solution should be either a better default value in the database or telling python that if it is a None object to use an empty string or list instead.

I'll test the database one first since that is a better structural change and I would prefer it