0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

SlackClient(python)のWEB Hometab機能を書いてみた。

0
Last updated at Posted at 2020-04-06

 概要

SlackAPI v2から追加された、HOME TAB機能について、python-slackclientで使えるクラスを書いてみた。
プルリクする自信がないのでここにメモする。


class HomeTab(JsonObject):
   """Create Home Tab JsonObject

   https://api.slack.com/surfaces/tabs/using#publishing

   Args:
      blocks: ホームタブを構成するブロック要素
   """
   attributes = {"view"}

   def __init__(self, *, blocks: Optional[List[blocks.Block]] = None):
      self.subtype = "home"
      self.blocks = blocks

   def to_dict(self):
      json = super().to_dict()
      json["type"] = self.subtype
      json["blocks"] = extract_json(self.blocks)
      return json
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?