From bfc76548ff6ed5259eda1cdab7ebff08236a4d3d Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 2 Sep 2019 01:30:27 +0200 Subject: [PATCH] Support permanent spells in /dndspell --- royalnet/commands/royalgames/dndspell.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/royalnet/commands/royalgames/dndspell.py b/royalnet/commands/royalgames/dndspell.py index bee96cde..89abe464 100644 --- a/royalnet/commands/royalgames/dndspell.py +++ b/royalnet/commands/royalgames/dndspell.py @@ -5,7 +5,7 @@ from ..command import Command from ..commandargs import CommandArgs from ..commanddata import CommandData from ..commandinterface import CommandInterface -from ...utils import parse_5etools_entry, ordinalformat +from ...utils import parse_5etools_entry, ordinalformat, andformat class DndspellCommand(Command): @@ -75,6 +75,7 @@ class DndspellCommand(Command): string += f'💎 [b]Material[/b] ([i]{spell["components"]["m"]["text"]}[/i]) | ' else: string += f'💎 [b]Material[/b] ([i]{spell["components"]["m"]}[/i]) | ' + string = string.rstrip(" ").rstrip("|") string += "\n" string += "\n" if "duration" in spell: @@ -85,6 +86,8 @@ class DndspellCommand(Command): string += 'Duration: ☁️ [b]Instantaneous[/b]' elif duration["type"] == "special": string += 'Duration: ⭐️ [b]Special[/b]' + elif duration["type"] == "permanent": + string += f"Duration: ♾ [b]Permanent[/b] (ends on {andformat(duration['ends'], final=' or ')})" else: string += f'Duration: ⚠️[b]UNKNOWN[/b]' if duration.get("concentration", False):