From d5ff376330d8ecc2308d24f6736325e6044fdee0 Mon Sep 17 00:00:00 2001 From: Jade Date: Tue, 20 Jun 2023 00:57:24 -0500 Subject: [PATCH] Added let func --- CharmCord/tools.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CharmCord/tools.py b/CharmCord/tools.py index d267c1c..3ceca07 100644 --- a/CharmCord/tools.py +++ b/CharmCord/tools.py @@ -4,6 +4,7 @@ from .Functions import * timezones = (timezone("EST"), timezone("UTC"), timezone("US/Pacific")) +lets = {} class FunctionHandler: @@ -12,7 +13,7 @@ def __init__(self): def register_functions(self): for line in all_Funcs: - function = eval(line.replace("$", "")) # nosec + function = eval(line.replace("$", "")) # nosec self.funcs[line.replace("\n", "").lower()] = function async def execute_functions(self, keyword, args, context): @@ -156,7 +157,8 @@ async def findBracketPairs(entry: str, Functions, context): end = None balance = 0 for i in argument: - if i == "$" and start is None and argument[count + 1] != "$": + digits = ["1", "2", "3", "4", "5", "6", '7', '8', "9", "0"] # A keyword will never start or have a digit in it + if i == "$" and start is None and argument[count + 1] != "$" and argument[count + 1] not in digits: # $$keyword will discount the first $ as part of the text start = count elif i == "[": balance += 1 @@ -170,9 +172,7 @@ async def findBracketPairs(entry: str, Functions, context): argument = ( argument[:start] + str( - await findBracketPairs( - argument[start: end + 1], Functions, context - ) + await findBracketPairs(argument[start: end + 1], Functions, context) ) + argument[end + 1:] )