diff --git a/roll_witch/dice_bot/event_listener.py b/roll_witch/dice_bot/event_listener.py index 3e96da9..f64df19 100644 --- a/roll_witch/dice_bot/event_listener.py +++ b/roll_witch/dice_bot/event_listener.py @@ -5,9 +5,7 @@ class EventListenerClient(discord.Client): def __init__(self): intents: discord.Intents = discord.Intents( - messages=True, - guilds=True, - message_content=True + messages=True, guilds=True, message_content=True ) super().__init__(intents=intents) diff --git a/roll_witch/rolling/command/__init__.py b/roll_witch/rolling/command/__init__.py index 1453f9c..ac7774b 100644 --- a/roll_witch/rolling/command/__init__.py +++ b/roll_witch/rolling/command/__init__.py @@ -7,7 +7,7 @@ "!r-b": basic, "!roll": token, "!r": token, - "!sr": shadow_run + "!sr": shadow_run, } @@ -19,6 +19,6 @@ def get_command(message_content: str): clean_command_string = clean_command(message_content) for prefix, op_getter in operations.items(): if clean_command_string.startswith(prefix): - operation_input = clean_command_string[len(prefix):].lstrip() + operation_input = clean_command_string[len(prefix) :].lstrip() return op_getter, operation_input return None, message_content diff --git a/roll_witch/rolling/command/shadow_run.py b/roll_witch/rolling/command/shadow_run.py index fe3828c..ee08f72 100644 --- a/roll_witch/rolling/command/shadow_run.py +++ b/roll_witch/rolling/command/shadow_run.py @@ -1,9 +1,7 @@ from roll_witch.rolling.input import get_token_parser from roll_witch.rolling.output import OperationOutputWriter from roll_witch.rolling.roller import RollResult, RollSpec -from roll_witch.rolling.roller import ( - StandardRoller -) +from roll_witch.rolling.roller import StandardRoller from roll_witch.rolling.roller.operation_result import OperationResult @@ -34,7 +32,5 @@ def get_spec(roll_string): parser = get_token_parser() roll_spec = parser.parse(roll_string) if not roll_spec.target_number: - roll_spec.add_part( - RollSpec(target_number=5, operation=None) - ) + roll_spec.add_part(RollSpec(target_number=5, operation=None)) return roll_spec diff --git a/roll_witch/rolling/roller/__init__.py b/roll_witch/rolling/roller/__init__.py index a7aa162..73eb400 100644 --- a/roll_witch/rolling/roller/__init__.py +++ b/roll_witch/rolling/roller/__init__.py @@ -4,4 +4,10 @@ from .spec import RollSpec from .operation_result import OperationResult -__all__ = ["StandardRoller", "TargetedRoller", "RollResult", "OperationResult", "RollSpec"] +__all__ = [ + "StandardRoller", + "TargetedRoller", + "RollResult", + "OperationResult", + "RollSpec", +] diff --git a/roll_witch/web_app/roller.py b/roll_witch/web_app/roller.py index 6f52d29..85df4f3 100644 --- a/roll_witch/web_app/roller.py +++ b/roll_witch/web_app/roller.py @@ -8,18 +8,16 @@ async def roll(request: Request): data = await request.post() try: - roll_operation = data['roll_operation'] - if not(roll_operation.startswith('!r')): + roll_operation = data["roll_operation"] + if not (roll_operation.startswith("!r")): roll_operation = f"!r {roll_operation}" - bot_operation, roll_string = command.get_command( - message_content=roll_operation - ) + bot_operation, roll_string = command.get_command(message_content=roll_operation) print(f"Roll Request: {roll_string}") if bot_operation: operation_output = bot_operation.execute( roll_string=roll_string, - user='', + user="", ) print(f"Output: {operation_output}") return { @@ -32,8 +30,8 @@ async def roll(request: Request): return { "output": { "error": "Invalid Command", - "roll_request": data['roll_operation'], - "roll_result": "Error" + "roll_request": data["roll_operation"], + "roll_result": "Error", } } except Exception as e: @@ -44,7 +42,7 @@ async def roll(request: Request): return { "output": { "error": msg, - "roll_request": data['roll_operation'], - "roll_result": "Error" + "roll_request": data["roll_operation"], + "roll_result": "Error", } }