Noisegate V2 #8

Merged
logan merged 47 commits from NoiseGateV2 into master 2022-03-28 00:13:08 -04:00
Showing only changes of commit 83c2971742 - Show all commits

6
bot.py
View File

@@ -480,7 +480,7 @@ class Bot(commands.Bot):
config[str(profile_name)]['Frequency'] = self.freq
config[str(profile_name)]['Mode'] = self.mode
config[str(profile_name)]['Squelch'] = str(self.squelch)
config[str(profile_name)]['Noisegate Sensitivity'] = str(self.noisegate_sensitivity)
config[str(profile_name)]['Noisegate_Sensitivity'] = str(self.noisegate_sensitivity)
with open('./profiles.ini', 'w+') as config_file:
config.write(config_file)
@@ -503,8 +503,8 @@ class Bot(commands.Bot):
self.mode = config[self.profile_name]['Mode']
self.squelch = float(config[self.profile_name]['Squelch'])
try:
self.noisegate_sensitivity = int(config[self.profile_name]['Noisegate Sensitivity'])
except KeyError as err:
self.noisegate_sensitivity = int(config[self.profile_name]['Noisegate_Sensitivity'])
except KeyError:
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