integrations.base.interface module¶
integrations/base/interface.py
- class integrations.base.interface.APIInterface¶
Bases:
ABCアダプタAPIインターフェース
- abstractmethod post(m)¶
メッセージを出力する
- Parameters:
m (MessageParserProtocol) – メッセージデータ
- Return type:
None
- class integrations.base.interface.AdapterInterface¶
Bases:
ABC,Generic[ConfigT,ApiT,FunctionsT,ParserT]アダプタインターフェース
- api: ApiT¶
インターフェース操作APIインスタンス
- conf: ConfigT¶
個別設定データクラス
- functions: FunctionsT¶
サービス専用関数インスタンス
- interface_type: str¶
サービス識別子
- parser: Type[ParserT]¶
メッセージパーサクラス
- class integrations.base.interface.FunctionsInterface¶
Bases:
ABC個別関数インターフェース
- abstractmethod get_conversations(m)¶
スレッド情報の取得
- Parameters:
m (MessageParserProtocol) – メッセージデータ
- Returns:
API response
- Return type:
dict
- abstractmethod post_processing(m)¶
後処理
- Parameters:
m (MessageParserProtocol) – メッセージデータ
- Return type:
None
- class integrations.base.interface.IntegrationsConfig¶
Bases:
ABC個別設定値
- __init__(_parser=None, _command_dispatcher=<factory>, _keyword_dispatcher=<factory>, main_conf=None, channel_config=None, slash_command='', badge_degree=False, badge_status=False, badge_grade=False, separate=False, channel_id=None, plotting_backend='matplotlib')¶
- Parameters:
_parser (ConfigParser | None)
_command_dispatcher (dict[str, Any])
_keyword_dispatcher (dict[str, Any])
main_conf (ConfigParser | None)
channel_config (Path | None)
slash_command (str)
badge_degree (bool)
badge_status (bool)
badge_grade (bool)
separate (bool)
channel_id (str | None)
plotting_backend (Literal['matplotlib', 'plotly'])
- Return type:
None
- badge_degree: bool = False¶
プレイしたゲーム数に対して表示される称号
True: 表示する
False: 表示しない
- badge_grade: bool = False¶
段位表示
True: 表示する
False: 表示しない
- badge_status: bool = False¶
勝率に対して付く調子バッジ
True: 表示する
False: 表示しない
- channel_config: Path | None = None¶
チャンネル個別設定状況
Path: チャンネル個別設定ファイルパス
None: 個別設定を利用していない
- channel_id: str | None = None¶
チャンネルIDを上書きする
- property command_dispatcher: dict[str, Any]¶
コマンドディスパッチテーブルを辞書で取得
- Returns:
コマンドディスパッチテーブル
- Return type:
dict[str, Any]
- property keyword_dispatcher: dict[str, Any]¶
キーワードディスパッチテーブルを辞書で取得
- Returns:
キーワードディスパッチテーブル
- Return type:
dict[str, Any]
- main_conf: ConfigParser | None = None¶
設定ファイル
- plotting_backend: Literal['matplotlib', 'plotly'] = 'matplotlib'¶
グラフ描写ライブラリ
- separate: bool = False¶
スコア入力元識別子別集計フラグ
True: 識別子別に集計
False: すべて集計
- slash_command: str = ''¶
スラッシュコマンド名
- class integrations.base.interface.MessageParserDataMixin¶
Bases:
objectメッセージ解析共通処理
- reset()¶
初期化
- Return type:
None
- set_headline(data, options)¶
ヘッドラインメッセージをセット
- Parameters:
data (MessageType) – 内容
options (StyleOptions) – 表示オプション
- Return type:
None
- set_message(data, options)¶
本文メッセージをセット
- Parameters:
data (MessageType) – 内容
options (StyleOptions) – 表示オプション
- Return type:
None
- status: StatusData¶
- class integrations.base.interface.MessageParserInterface¶
Bases:
ABCメッセージ解析インターフェース
- property argument: list[str]¶
コマンド引数として認識している文字列をリストで返す
- Returns:
引数リスト
- Return type:
list[str]
- abstract property check_updatable: bool¶
DB操作の許可チェック
- Returns:
真偽値
True: 許可
False: 禁止
- Return type:
bool
- abstract property ignore_user: bool¶
ignore_useridに存在するユーザかチェック
- Returns:
真偽値
True: 存在する(操作禁止ユーザ)
False: 存在しない
- Return type:
bool
- abstract property in_thread: bool¶
元メッセージへのリプライとなっているか
- Returns:
真偽値
True: リプライの形(リプライ/スレッドなど)
False: 通常メッセージ
- Return type:
bool
- abstract property is_bot: bool¶
botのポストかチェック
- Returns:
真偽値
True: botのポスト
False: ユーザのポスト
- Return type:
bool
- property is_command: bool¶
コマンドで実行されているかチェック
- Returns:
真偽値
True: コマンド実行
False: 非コマンド(キーワード呼び出し)
- Return type:
bool
- property keyword: str¶
コマンドとして認識している文字列を返す
- Returns:
コマンド名
- Return type:
str
- abstractmethod parser(body)¶
メッセージ解析
- Parameters:
body (Any) – 解析データ
- Return type:
None
- property reply_ts: str¶
リプライ先のタイムスタンプを取得する
- Returns:
タイムスタンプ
- Return type:
str
- status: StatusData¶