diff --git a/example/plugins/HydroRoll/__init__.py b/example/plugins/HydroRoll/__init__.py index b98671d..151a58a 100644 --- a/example/plugins/HydroRoll/__init__.py +++ b/example/plugins/HydroRoll/__init__.py @@ -64,7 +64,7 @@ async def handle(self) -> None: if cmd.startswith(current_cmd): if current_cmd != cmd: flag = True - elif current_cmd == cmd: + else: await self.event.reply(f"{cmd}") flag = False except GetEventTimeout: diff --git a/example/plugins/HydroRoll/utils.py b/example/plugins/HydroRoll/utils.py index 66df2f4..2665580 100644 --- a/example/plugins/HydroRoll/utils.py +++ b/example/plugins/HydroRoll/utils.py @@ -60,9 +60,6 @@ async def rule(self) -> bool: or self.event.group_id in self.config.accept_group ): return self.str_match(match_str) - elif self.config.handle_group_message: - if self.event.message_type == "guild": - return self.str_match(match_str) return False @abstractmethod @@ -153,14 +150,12 @@ def roll_dice( if streamline: return str(total) - else: - if len(rolls) > int(threshold): - return str(total) - rolls_str = " + ".join(str(r) for r in rolls) - result_str = ( - f"{total} = {rolls_str}" if is_reversed else f"{rolls_str} = {total}" - ) - return result_str + if len(rolls) > int(threshold): + return str(total) + rolls_str = " + ".join(str(r) for r in rolls) + return ( + f"{total} = {rolls_str}" if is_reversed else f"{rolls_str} = {total}" + ) def find_max_similarity(input_string, string_list):