diff --git a/bot.py b/bot.py index 77f4ee6..92d113c 100644 --- a/bot.py +++ b/bot.py @@ -7,7 +7,7 @@ import configparser from discord.ext import commands from subprocess import Popen, PIPE from gqrxHandler import GQRXHandler -from BotResources import check_negative + # Init class for bot @@ -142,11 +142,6 @@ class Bot(commands.Bot): async def chsquelch(ctx, squelch: float, member: discord.Member = None): member = member or ctx.author.display_name - print(f"Squelch = {squelch}") - if not check_negative(squelch): - squelch = float(-abs(squelch)) - print(f"Squelch = {squelch}") - self.squelch = squelch await ctx.send(f"Ok {str(member).capitalize()}, I'm changing the squelch to {self.squelch}") diff --git a/gqrxHandler.py b/gqrxHandler.py index ee2c9bd..69cbd89 100644 --- a/gqrxHandler.py +++ b/gqrxHandler.py @@ -1,4 +1,5 @@ from telnetlib import Telnet +from BotResources import check_negative class GQRXHandler(): def __init__(self, hostname: str = "localhost", port: int = 7356): @@ -23,6 +24,10 @@ class GQRXHandler(): def change_squelch(self, squelch): tel_conn = self.create_telnet_connection() print(f"Changing squelch to {squelch}") + print(f"Squelch = {squelch}") + if not check_negative(squelch): + squelch = float(-abs(squelch)) + print(f"Squelch = {squelch}") tel_conn.write(bytes(f"L SQL {float(squelch)}", 'utf-8')) tel_conn.close()