From e2c100c5bb3ac6f08368787851d6e85e27c57100 Mon Sep 17 00:00:00 2001 From: Rich Oberholtzer Date: Tue, 14 Apr 2020 21:48:16 -0400 Subject: [PATCH 1/6] removing " from service variable --- r0b3bot.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/r0b3bot.py b/r0b3bot.py index df7fab0..4ec4fa3 100644 --- a/r0b3bot.py +++ b/r0b3bot.py @@ -599,6 +599,12 @@ async def spsub(ctx, service = "NONE"): datestring = datetime.now() datestring = datestring.strftime("%m/%d/%Y-%H:%M:%S") + bad_chars = ['"'] + + # using replace() to remove bad_chars + for i in bad_chars : + service = service.replace(i, '') + print(f"[{datestring}]: {ctx.message.author.display_name} called '$spsub {service}'") # Only work on this if the user has supplied a service name to monitor, a value of NONE From 7b7f57f4c0eb05f2a7d39a58cb90a7016dce9be4 Mon Sep 17 00:00:00 2001 From: Rich Oberholtzer Date: Tue, 14 Apr 2020 21:50:55 -0400 Subject: [PATCH 2/6] trying more ' --- r0b3bot.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/r0b3bot.py b/r0b3bot.py index 4ec4fa3..547b645 100644 --- a/r0b3bot.py +++ b/r0b3bot.py @@ -599,13 +599,13 @@ async def spsub(ctx, service = "NONE"): datestring = datetime.now() datestring = datestring.strftime("%m/%d/%Y-%H:%M:%S") - bad_chars = ['"'] + #bad_chars = ['"'] # using replace() to remove bad_chars - for i in bad_chars : - service = service.replace(i, '') + #for i in bad_chars : + service = service.replace('"', '') - print(f"[{datestring}]: {ctx.message.author.display_name} called '$spsub {service}'") + print(f"[{datestring}]: {ctx.message.author.display_name} called '$spsub '{service}'''") # Only work on this if the user has supplied a service name to monitor, a value of NONE # means nothing was specified From f11c0762589be1879ab3db280709760633e69ee3 Mon Sep 17 00:00:00 2001 From: Rich Oberholtzer Date: Tue, 14 Apr 2020 21:52:41 -0400 Subject: [PATCH 3/6] trying removal of print statement --- r0b3bot.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/r0b3bot.py b/r0b3bot.py index 547b645..b438070 100644 --- a/r0b3bot.py +++ b/r0b3bot.py @@ -599,13 +599,7 @@ async def spsub(ctx, service = "NONE"): datestring = datetime.now() datestring = datestring.strftime("%m/%d/%Y-%H:%M:%S") - #bad_chars = ['"'] - - # using replace() to remove bad_chars - #for i in bad_chars : - service = service.replace('"', '') - - print(f"[{datestring}]: {ctx.message.author.display_name} called '$spsub '{service}'''") + #print(f"[{datestring}]: {ctx.message.author.display_name} called '$spsub '{service}'''") # Only work on this if the user has supplied a service name to monitor, a value of NONE # means nothing was specified From 65a608395b6cbe6a9886cf3e627138606b1634c2 Mon Sep 17 00:00:00 2001 From: Rich Oberholtzer Date: Tue, 14 Apr 2020 21:55:00 -0400 Subject: [PATCH 4/6] adding code to allow inserting _ in place of spaces and will revert --- r0b3bot.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/r0b3bot.py b/r0b3bot.py index b438070..c0b92c6 100644 --- a/r0b3bot.py +++ b/r0b3bot.py @@ -599,7 +599,9 @@ async def spsub(ctx, service = "NONE"): datestring = datetime.now() datestring = datestring.strftime("%m/%d/%Y-%H:%M:%S") - #print(f"[{datestring}]: {ctx.message.author.display_name} called '$spsub '{service}'''") + service.replace("_"," ") + + print(f"[{datestring}]: {ctx.message.author.display_name} called '$spsub '{service}'''") # Only work on this if the user has supplied a service name to monitor, a value of NONE # means nothing was specified From 63602bc19cf894bae23a197d12c591f0ab61c61e Mon Sep 17 00:00:00 2001 From: Rich Oberholtzer Date: Tue, 14 Apr 2020 21:57:31 -0400 Subject: [PATCH 5/6] wasnt saving the result, doh --- r0b3bot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/r0b3bot.py b/r0b3bot.py index c0b92c6..8c2a79c 100644 --- a/r0b3bot.py +++ b/r0b3bot.py @@ -599,7 +599,8 @@ async def spsub(ctx, service = "NONE"): datestring = datetime.now() datestring = datestring.strftime("%m/%d/%Y-%H:%M:%S") - service.replace("_"," ") + # replace _ with sapces + service = service.replace("_"," ") print(f"[{datestring}]: {ctx.message.author.display_name} called '$spsub '{service}'''") From 83f7270d6bc525d8c3ace5b76e4fdc796381da6d Mon Sep 17 00:00:00 2001 From: Rich Oberholtzer Date: Tue, 14 Apr 2020 21:59:10 -0400 Subject: [PATCH 6/6] updated help message --- r0b3bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r0b3bot.py b/r0b3bot.py index 8c2a79c..654604a 100644 --- a/r0b3bot.py +++ b/r0b3bot.py @@ -914,7 +914,7 @@ async def help(ctx): embed.add_field(name=f"{BOT_COMMAND_PREFIX}help", value="Gives this message", inline=False) embed.add_field(name=f"{BOT_COMMAND_PREFIX}last_error", value="Will display the real error message the bot has last encountered for additional debugging info") embed.add_field(name=f"{BOT_COMMAND_PREFIX}spstatus servicename", value="Retrieves status of service from StatPing") - embed.add_field(name=f"{BOT_COMMAND_PREFIX}spsub service", value="Allows user to subscribe to service status change alerts for the channel. Can replace with -list and -del:service to manage alerts.") + embed.add_field(name=f"{BOT_COMMAND_PREFIX}spsub service", value="Allows user to subscribe to service status change alerts for the channel. Can replace with -list and -del:service to manage alerts. NOTICE:Replace spaces in service names w/ '_'!") await ctx.send(embed=embed) embed = discord.Embed(title="A note about sound clips:", description="Sound clips are only played in voice channels. If a user is not specified when calling the command, the sound will played in the channel of that issuing user is currently joined to. When a username is specified, the bot will play the sound in the channel that user is currently in.")