KeyError instead of NameError ~507 bot.py

This commit is contained in:
Logan Cusano
2022-03-27 14:56:56 -04:00
parent 3a2d9531f9
commit 1a705c2b6c

2
bot.py
View File

@@ -504,7 +504,7 @@ class Bot(commands.Bot):
self.squelch = float(config[self.profile_name]['Squelch'])
try:
self.noisegate_sensitivity = int(config[self.profile_name]['Noisegate Sensitivity'])
except NameError as err:
except KeyError as err:
print(f"Config does not contain a 'noisegate sensitivity' value, "
f"creating one now with the default value: {BotResources.DEFAULT_NOISEGATE_THRESHOLD}")
self.noisegate_sensitivity = BotResources.DEFAULT_NOISEGATE_THRESHOLD