浏览代码

Reformatting

Kirk Trombley 4 年之前
父节点
当前提交
6ab4b919fe
共有 1 个文件被更改,包括 5 次插入16 次删除
  1. 5 16
      lib/rollbot/bot.py

+ 5 - 16
lib/rollbot/bot.py

@@ -34,14 +34,10 @@ class Rollbot(Generic[RawMsg]):
         raise NotImplemented("Must be implemented by driver")
 
     async def on_startup(self):
-        await asyncio.gather(
-            *[task(self.context) for task in self.command_config.startup]
-        )
+        await asyncio.gather(*[task(self.context) for task in self.command_config.startup])
 
     async def on_shutdown(self):
-        await asyncio.gather(
-            *[task(self.context) for task in self.command_config.shutdown]
-        )
+        await asyncio.gather(*[task(self.context) for task in self.command_config.shutdown])
 
     async def on_message(self, incoming: RawMsg):
         message = self.parse(incoming)
@@ -49,15 +45,10 @@ class Rollbot(Generic[RawMsg]):
             return
 
         message.command = Command.from_text(message.text)
-        if (
-            message.command is None
-            or message.command.bang not in self.command_config.bangs
-        ):
+        if message.command is None or message.command.bang not in self.command_config.bangs:
             return
 
-        command = self.command_config.aliases.get(
-            message.command.name, message.command.name
-        )
+        command = self.command_config.aliases.get(message.command.name, message.command.name)
         res = self.command_config.call_and_response.get(command, None)
         if res is not None:
             await self.respond(Response.from_message(message, res))
@@ -66,9 +57,7 @@ class Rollbot(Generic[RawMsg]):
         command_call = self.command_config.commands.get(command, None)
         if command_call is None:
             await self.respond(
-                Response.from_message(
-                    message, f"Sorry! I don't know the command {command}."
-                )
+                Response.from_message(message, f"Sorry! I don't know the command {command}.")
             )
             return