Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions nonebot-plugin-random/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ def is_image_file(path:Path) -> bool:
return path.suffix in [".gif",".png",".jpg",".jpeg"]

def is_record_file(path:Path) -> bool:
return path.suffix in [".mp3",".wav",".ogg"]
return path.suffix in [".mp3",".wav",".ogg",".flac"]

def is_video_file(path:Path) -> bool:
return path.suffix in [".mp4",".avi",".flv",".wmv",".mov",".mpg",".mpeg"]
Expand All @@ -21,4 +21,4 @@ def is_file(type:str,path:Path) -> bool:

def replace_message(msg:str,path:Path) -> str:
return msg.replace("{filename}",path.name) \
.replace("{filestem}",path.stem)
.replace("{filestem}",path.stem)