Skip to content

Commit

Permalink
fix: remove repeat util
Browse files Browse the repository at this point in the history
  • Loading branch information
zhayujie committed Nov 27, 2023
1 parent 697c6d5 commit 21ad51f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
4 changes: 2 additions & 2 deletions channel/feishu/feishu_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from common.expired_dict import ExpiredDict
from bridge.context import ContextType
from channel.chat_channel import ChatChannel, check_prefix
from utils import file_util
from common import utils
import json
import os

Expand Down Expand Up @@ -118,7 +118,7 @@ def fetch_access_token(self) -> str:
def _upload_image_url(self, img_url, access_token):
logger.debug(f"[WX] start download image, img_url={img_url}")
response = requests.get(img_url)
suffix = file_util.get_path_suffix(img_url)
suffix = utils.get_path_suffix(img_url)
temp_name = str(uuid.uuid4()) + "." + suffix
if response.status_code == 200:
# 将图片内容保存为临时文件
Expand Down
4 changes: 2 additions & 2 deletions channel/feishu/feishu_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import requests
from common.log import logger
from common.tmp_dir import TmpDir
from utils import file_util
from common import utils


class FeishuMessage(ChatMessage):
Expand All @@ -28,7 +28,7 @@ def __init__(self, event: dict, is_group=False, access_token=None):
file_key = content.get("file_key")
file_name = content.get("file_name")

self.content = TmpDir().path() + file_key + "." + file_util.get_path_suffix(file_name)
self.content = TmpDir().path() + file_key + "." + utils.get_path_suffix(file_name)

def _download_file():
# 如果响应状态码是200,则将响应内容写入本地文件
Expand Down
8 changes: 0 additions & 8 deletions utils/file_util.py

This file was deleted.

0 comments on commit 21ad51f

Please sign in to comment.