Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2019
2,984
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.69 KB | None | 0 0
  1. @dataclass
  2. class Command(object):
  3.     validator = None
  4.  
  5.     input: list
  6.     channel: str
  7.  
  8.     @classmethod
  9.     def recognize(cls, event):
  10.         return re.findall(re.compile(cls.validator), event['text'])
  11.  
  12.     def do(self):
  13.         raise NotImplementedError()
  14.  
  15.  
  16. class HelpCommand(Command):
  17.     validator = 'help'
  18.  
  19.     def do(self):
  20.         slack_client.api_call(
  21.             "chat.postMessage",
  22.             channel=self.channel,
  23.             text="""
  24.                Here are some things I can do:
  25.                    - type help to see this message
  26.                    - type "Standup for: <comma separated members list>" to start recording the standup
  27.                """
  28.         )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement