mirror of https://github.com/jumpserver/jumpserver
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
532 B
20 lines
532 B
3 years ago
|
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)
|