feat: 添加 飞书 (#6602)

* feat: 添加 飞书

Co-authored-by: xinwen <coderWen@126.com>
Co-authored-by: wenyann <64353056+wenyann@users.noreply.github.com>
This commit is contained in:
fit2bot
2021-08-12 16:44:06 +08:00
committed by GitHub
parent a2907a6e6d
commit 54751a715c
32 changed files with 975 additions and 356 deletions

View File

@@ -0,0 +1,19 @@
from django.conf import settings
from common.message.backends.feishu import FeiShu as Client
from .base import BackendBase
class FeiShu(BackendBase):
account_field = 'feishu_id'
is_enable_field_in_settings = 'AUTH_FEISHU'
def __init__(self):
self.client = Client(
app_id=settings.FEISHU_APP_ID,
app_secret=settings.FEISHU_APP_SECRET
)
def send_msg(self, users, msg):
accounts, __, __ = self.get_accounts(users)
return self.client.send_text(accounts, msg)