🌈 style: format codes
This commit is contained in:
@@ -65,7 +65,9 @@ class PlatformManager:
|
||||
case "lark":
|
||||
from .sources.lark.lark_adapter import LarkPlatformAdapter # noqa: F401
|
||||
case "dingtalk":
|
||||
from .sources.dingtalk.dingtalk_adapter import DingtalkPlatformAdapter # noqa: F401
|
||||
from .sources.dingtalk.dingtalk_adapter import (
|
||||
DingtalkPlatformAdapter, # noqa: F401
|
||||
)
|
||||
case "telegram":
|
||||
from .sources.telegram.tg_adapter import TelegramPlatformAdapter # noqa: F401
|
||||
case "wecom":
|
||||
|
||||
@@ -2,7 +2,6 @@ import asyncio
|
||||
import uuid
|
||||
import aiohttp
|
||||
import dingtalk_stream
|
||||
import logging
|
||||
|
||||
from astrbot.api.platform import (
|
||||
Platform,
|
||||
@@ -98,9 +97,7 @@ class DingtalkPlatformAdapter(Platform):
|
||||
|
||||
if abm.type == MessageType.GROUP_MESSAGE:
|
||||
if message.is_in_at_list:
|
||||
abm.message.append(
|
||||
At(qq=abm.self_id)
|
||||
)
|
||||
abm.message.append(At(qq=abm.self_id))
|
||||
abm.group_id = message.conversation_id
|
||||
if self.unique_session:
|
||||
abm.session_id = abm.sender.user_id
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
import json
|
||||
import uuid
|
||||
import asyncio
|
||||
import aiohttp
|
||||
import dingtalk_stream
|
||||
import astrbot.api.message_components as Comp
|
||||
from typing import List
|
||||
from astrbot.api.event import AstrMessageEvent, MessageChain
|
||||
from astrbot.core.utils.io import download_image_by_url
|
||||
from astrbot import logger
|
||||
from astrbot.core.utils.io import file_to_base64
|
||||
|
||||
|
||||
class DingtalkMessageEvent(AstrMessageEvent):
|
||||
@@ -35,7 +29,9 @@ class DingtalkMessageEvent(AstrMessageEvent):
|
||||
elif isinstance(segment, Comp.Image):
|
||||
markdown_str = ""
|
||||
if segment.file and segment.file.startswith("file:///"):
|
||||
logger.warning("dingtalk only support url image, not: " + segment.file)
|
||||
logger.warning(
|
||||
"dingtalk only support url image, not: " + segment.file
|
||||
)
|
||||
continue
|
||||
elif segment.file and segment.file.startswith("http"):
|
||||
markdown_str += f"\n\n"
|
||||
@@ -43,7 +39,9 @@ class DingtalkMessageEvent(AstrMessageEvent):
|
||||
logger.warning("dingtalk only support url image, not base64")
|
||||
continue
|
||||
else:
|
||||
logger.warning("dingtalk only support url image, not: " + segment.file)
|
||||
logger.warning(
|
||||
"dingtalk only support url image, not: " + segment.file
|
||||
)
|
||||
continue
|
||||
|
||||
ret = await asyncio.get_event_loop().run_in_executor(
|
||||
|
||||
Reference in New Issue
Block a user