Skip to content

Commit

Permalink
'Refactored by Sourcery' (#77)
Browse files Browse the repository at this point in the history
Co-authored-by: Sourcery AI <>
  • Loading branch information
sourcery-ai[bot] authored Nov 11, 2023
1 parent 6ce496e commit ef40456
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion example/plugins/HydroRoll/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
17 changes: 6 additions & 11 deletions example/plugins/HydroRoll/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit ef40456

Please sign in to comment.