Merge branch 'beta' into refactor-views

This commit is contained in:
Choco
2025-09-26 13:29:27 +08:00
9 changed files with 601 additions and 29 deletions

View File

@@ -127,7 +127,7 @@ class Basic(commands.Cog):
@app_commands.autocomplete(query=play_autocomplete)
@commands.dynamic_cooldown(cooldown_check, commands.BucketType.guild)
async def play(self, ctx: commands.Context, *, query: str, start: str = "0", end: str = "0") -> None:
"Loads your input into the queue"
"Loads your input into the queue."
player: voicelink.Player = ctx.guild.voice_client
if not player:
player = await voicelink.connect_channel(ctx)
@@ -222,7 +222,7 @@ class Basic(commands.Cog):
])
@commands.dynamic_cooldown(cooldown_check, commands.BucketType.guild)
async def search(self, ctx: commands.Context, *, query: str, platform: str = SearchType.YOUTUBE.name):
"Loads your search query and shows the results."
"Searches your query and displays the results."
player: voicelink.Player = ctx.guild.voice_client
if not player:
player = await voicelink.connect_channel(ctx)

View File

@@ -159,15 +159,6 @@ def check_roles() -> tuple[str, int, int]:
def truncate_string(text: str, length: int = 40) -> str:
return text[:length - 3] + "..." if len(text) > length else text
def get_lang_non_async(guild_id: int, *keys) -> Union[list[str], str]:
settings = SETTINGS_BUFFER.get(guild_id, {})
lang = settings.get("lang", "EN")
if lang in LANGS and not LANGS[lang]:
LANGS[lang] = open_json(os.path.join("langs", f"{lang}.json"))
if len(keys) == 1:
return LANGS.get(lang, {}).get(keys[0], "Not found!")
return [LANGS.get(lang, {}).get(key, "Not found!") for key in keys]
def format_bytes(bytes: int, unit: bool = False):
if bytes <= 1_000_000_000:
@@ -175,16 +166,23 @@ def format_bytes(bytes: int, unit: bool = False):
else:
return f"{bytes / (1024 ** 3):.1f}" + ("GB" if unit else "")
async def get_lang(guild_id:int, *keys) -> Optional[Union[list[str], str]]:
settings = await get_settings(guild_id)
lang = settings.get("lang", "EN")
if lang in LANGS and not LANGS[lang]:
def _get_lang(lang: str, *keys) -> Optional[Union[list[str], str]]:
if lang not in LANGS:
lang = "EN"
if not LANGS[lang]:
LANGS[lang] = open_json(os.path.join("langs", f"{lang}.json"))
lang_dict = LANGS[lang]
if len(keys) == 1:
return LANGS.get(lang, {}).get(keys[0])
return [LANGS.get(lang, {}).get(key) for key in keys]
return lang_dict.get(keys[0], "Not found!")
return [lang_dict.get(key, "Not found!") for key in keys]
async def get_lang(guild_id:int, *keys) -> Optional[Union[list[str], str]]:
settings = await get_settings(guild_id)
return _get_lang(settings.get("lang"), *keys)
async def send(
ctx: Union[commands.Context, discord.Interaction],

172
langs/ZHCN.json Normal file
View File

@@ -0,0 +1,172 @@
{
"unknownException": "⚠️ 执行命令时出错!请稍后再试,或加入我们的 Discord 服务器获取支持。",
"enabled": "已启用",
"disabled": "已禁用",
"nodeReconnect": "请在节点重连后再试!",
"noChannel": "未检测到语音频道,请提供一个或加入语音频道。",
"alreadyConnected": "已连接到语音频道。",
"noPermission": "抱歉!我没有权限加入或在您的语音频道中发言。",
"noCreatePermission": "抱歉!我没有权限创建点歌频道。",
"noPlaySource": "找不到可播放的资源!",
"noPlayer": "该服务器上没有找到播放器。",
"notVote": "该命令需要您先投票!输入 `/vote` 了解更多。",
"missingIntents": "抱歉,无法执行此命令,因为缺少所需的请求 intent`({0})`。",
"languageNotFound": "未找到语言包!请选择一个已有的语言包。",
"changedLanguage": "已成功切换为 `{0}` 语言包。",
"setPrefix": "完成!我在您服务器的前缀现在是 `{0}`。尝试运行 `{1}ping` 测试一下吧。",
"setDJ": "已将 DJ 设置为 {0}。",
"setQueue": "已将队列模式设置为 `{0}`。",
"247": "24/7 模式现已 `{0}`。",
"bypassVote": "您拥有 `{0}` 投票系统。",
"setVolume": "已将音量设置为 `{0}`%",
"toggleController": "您现在已 `{0}` 音乐控制器。",
"toggleDuplicateTrack": "您已 `{0}` 重复曲目预防功能。",
"toggleControllerMsg": "您现在已 `{0}` 来自音乐控制器的消息。",
"toggleSilentMsg": "您已 {0} 静默消息。",
"settingsMenu": "服务器设置 | {0}",
"settingsTitle": "❤️ 基本信息:",
"settingsValue": "```前缀: {0}\n语言: {1}\n音乐控制器: {2}\nDJ 角色: @{3}\n投票跳过: {4}\n24/7: {5}\n默认音量: {6}%\n播放时长: {7}```",
"settingsTitle2": "🔗 队列信息:",
"settingsValue2": "```队列模式: {0}\n最大歌曲数: {1}\n重复曲目: {2}```",
"settingsTitle3": "🎤 语音状态信息:",
"settingsPermTitle": "✨ 权限:",
"settingsPermValue": "```{0} 管理员\n{1} 管理服务器\n{2} 管理频道\n{3} 管理消息```",
"pingTitle1": "机器人信息:",
"pingTitle2": "播放器信息:",
"pingField1": "```分片 ID: {0}/{1}\n分片延迟: {2:.3f}s {3}\n区域: {4}```",
"pingField2": "```节点: {0} - {1:.3f}s\n播放器数: {2}\n语音区域: {3}```",
"addEffect": "已应用 `{0}` 音效。",
"clearEffect": "音效已清除!",
"filterTagAlreadyInUse": "该音效已在使用中!请使用 /cleareffect <标签> 移除。",
"playlistViewTitle": "📜 {0} 的所有播放列表",
"playlistViewHeaders": "ID:,时长:,名称:,曲目数:",
"playlistFooter": "输入 /playlist play [播放列表] 将其添加到队列中。",
"playlistNotFound": "未找到播放列表 [`{0}`]。输入 /playlist view 查看所有播放列表。",
"playlistNotAccess": "抱歉!您无权访问此播放列表!",
"playlistNoTrack": "抱歉!播放列表 [`{0}`] 中没有曲目。",
"playlistNotAllow": "该命令不支持已关联或共享的播放列表。",
"playlistPlay": "已将播放列表 [`{0}`] 的 `{1}` 首歌添加到队列中。",
"playlistOverText": "抱歉!播放列表名称不能超过 10 个字符。",
"playlistSameName": "抱歉!请为播放列表选择一个新名字。",
"playlistDeleteError": "不允许删除默认播放列表。",
"playlistRemove": "您已删除播放列表 [`{0}`]。",
"playlistSendErrorPlayer": "抱歉!您不能给自己发送邀请。",
"playlistSendErrorBot": "抱歉!您不能给机器人发送邀请。",
"playlistBelongs": "抱歉!此播放列表属于 <@{0}>。",
"playlistShare": "抱歉!此播放列表已与 {0} 共享。",
"playlistSent": "抱歉!您之前已经给该用户发送过邀请。",
"noPlaylistAcc": "{0} 还没有创建播放列表账号。",
"overPlaylistCreation": "您最多只能创建 `{0}` 个播放列表!",
"playlistExists": "播放列表 [`{0}`] 已存在。",
"playlistNotInvalidUrl": "请输入有效的公共 Spotify 或 YouTube 播放列表链接。",
"playlistCreated": "您已创建 `{0}` 播放列表。输入 /playlist view 查看详情。",
"playlistRenamed": "您已将 `{0}` 重命名为 `{1}`。",
"playlistLimitTrack": "已达到上限!每个播放列表最多只能添加 `{0}` 首歌。",
"playlistPlaylistLink": "不允许使用播放列表链接。",
"playlistStream": "不允许将流媒体视频添加到播放列表。",
"playlistPositionNotFound": "在播放列表 [`{1}`] 中找不到位置 `{0}`",
"playlistRemoved": "👋 已从 {1} 的播放列表 [`{2}`] 中移除 **{0}**。",
"playlistClear": "您已成功清空播放列表 [`{0}`]。",
"playlistView": "播放列表查看器",
"playlistViewDesc": "```名称 | ID: {0} | {1}\n总曲目: {2}\n拥有者: {3}\n类型: {4}\n```",
"playlistViewPermsValue": "📖 读取: ✓ ✍🏽 写入: {0} 🗑️ 删除: {1}",
"playlistViewPermsValue2": "📖 读取: {0}",
"playlistViewTrack": "曲目列表",
"playlistViewPage": "第 {0}/{1} 页 | 总时长: {2}",
"inboxFull": "抱歉!{0} 的收件箱已满。",
"inboxNoMsg": "您的收件箱中没有消息。",
"invitationSent": "邀请已发送给 {0}。",
"notInChannel": "{0},您必须在 {1} 才能使用语音命令。如果您已在频道,请重新加入!",
"noTrackPlaying": "当前没有正在播放的歌曲",
"noTrackFound": "未找到对应的歌曲,请提供有效链接。",
"noLinkSupport": "搜索命令不支持链接!",
"voted": "您已投票!",
"missingPosPerm": "只有 DJ 或管理员才能更改位置。",
"missingModePerm": "只有 DJ 或管理员才能切换循环模式。",
"missingQueuePerm": "只有 DJ 或管理员才能从队列中移除曲目。",
"missingAutoPlayPerm": "只有 DJ 或管理员才能启用或禁用自动播放!",
"missingFunctionPerm": "只有 DJ 或管理员才能使用此功能。",
"timeFormatError": "时间格式错误。示例: 2:42 或 12:39:31",
"lyricsNotFound": "未找到歌词。输入 /lyrics <歌曲名> <作者> 查找歌词。",
"missingTrackInfo": "部分曲目信息缺失。",
"noVoiceChannel": "未找到语音频道!",
"playlistAddError": "不允许将流媒体视频添加到播放列表!",
"playlistAddError2": "添加曲目到播放列表时出现问题!",
"playlistLimited": "已达到上限!您最多只能在播放列表中添加 {0} 首歌。",
"playlistRepeated": "该曲目已在播放列表中!",
"playlistAdded": "❤️ 已将 **{0}** 添加到 {1} 的播放列表 [`{2}`]",
"playerDropdown": "选择要跳转的歌曲 ...",
"playerFilter": "选择要应用的音效 ...",
"buttonBack": "上一首",
"buttonPause": "暂停",
"buttonResume": "继续",
"buttonSkip": "跳过",
"buttonLeave": "退出",
"buttonLoop": "循环",
"buttonVolumeUp": "音量+",
"buttonVolumeDown": "音量-",
"buttonVolumeMute": "静音",
"buttonVolumeUnmute": "取消静音",
"buttonAutoPlay": "自动播放",
"buttonShuffle": "随机播放",
"buttonForward": "快进",
"buttonRewind": "快退",
"buttonLyrics": "歌词",
"nowplayingDesc": "**正在播放:**\n```{0}```",
"nowplayingField": "即将播放:",
"nowplayingLink": "在 {0} 收听",
"connect": "已连接到 {0}",
"live": "直播",
"playlistLoad": " 🎶 已将播放列表 **{0}** 的 `{1}` 首歌添加到队列中。",
"trackLoad": "已添加 **[{0}](<{1}>)** - **{2}** (`{3}`) 并开始播放。\n",
"trackLoad_pos": "已添加 **[{0}](<{1}>)** - **{2}** (`{3}`) 到队列位置 **{4}**\n",
"searchTitle": "搜索关键词: {0}",
"searchDesc": "➥ 平台: {0} **{1}**\n➥ 结果数: **{2}**\n\n{3}",
"searchWait": "请选择要添加到队列的歌曲。",
"searchTimeout": "搜索超时,请稍后重试。",
"searchSuccess": "歌曲已添加到队列。",
"queueTitle": "即将播放队列:",
"historyTitle": "播放历史:",
"viewTitle": "音乐队列",
"viewDesc": "**正在播放: [点我]({0}) ⮯**\n{1}",
"viewFooter": "第 {0}/{1} 页 | 总时长: {2}",
"pauseError": "播放器已暂停。",
"pauseVote": "{0} 投票暂停了歌曲。[{1}/{2}]",
"paused": "`{0}` 已暂停播放器。",
"resumeError": "播放器未暂停。",
"resumeVote": "{0} 投票继续播放。[{1}/{2}]",
"resumed": "`{0}` 已继续播放。",
"shuffleError": "请在队列中添加更多歌曲后再随机播放。",
"shuffleVote": "{0} 投票随机播放队列。[{1}/{2}]",
"shuffled": "队列已随机排序。",
"skipError": "没有歌曲可跳过。",
"skipVote": "{0} 投票跳过歌曲。[{1}/{2}]",
"skipped": "`{0}` 已跳过歌曲。",
"backVote": "{0} 投票播放上一首歌。[{1}/{2}]",
"backed": "`{0}` 已切换到上一首歌曲。",
"leaveVote": "{0} 投票停止播放。[{1}/{2}]",
"left": "`{0}` 已停止播放器。",
"seek": "已将播放器定位到 **{0}**",
"repeat": "循环模式已设置为 `{0}`",
"cleared": "已清空 `{0}` 中的所有曲目",
"removed": "已从队列中移除 `{0}` 首歌。",
"forward": "已快进到 **{0}**",
"rewind": "已快退到 **{0}**",
"replay": "正在重播当前歌曲。",
"swapped": "`{0}` 和 `{1}` 已交换位置",
"moved": "已将 `{0}` 移动到 `{1}`",
"autoplay": "自动播放模式现已 **{0}**",
"notdj": "您不是 DJ。当前 DJ 是 {0}。",
"djToMe": "您不能将 DJ 身份转移给自己或机器人。",
"djNotInChannel": "`{0}` 不在语音频道中。",
"djswap": "您已将 DJ 身份转移给 `{0}`。",
"voicelinkQueueFull": "抱歉,队列已达到最大 `{0}` 首歌!",
"voicelinkOutofList": "请输入有效的曲目序号!",
"voicelinkDuplicateTrack": "抱歉,该曲目已在队列中。",
"decodeError": "解码文件时出错!",
"invalidStartTime": "无效的开始时间,必须在 `00:00` 和 `{0}` 之间",
"invalidEndTime": "无效的结束时间,必须在 `00:00` 和 `{0}` 之间",
"invalidTimeOrder": "结束时间不能小于或等于开始时间",
"setStageAnnounceTemplate": "完成!从现在起,您所在的语音状态将按照模板命名。几秒后即可看到更新。",
"createSongRequestChannel": "已创建点歌频道 ({0})!您可以在该频道输入歌曲名称或链接来点歌,无需使用机器人前缀。"
}

172
langs/ZHTW.json Normal file
View File

@@ -0,0 +1,172 @@
{
"unknownException": "⚠️ 執行指令時發生錯誤!請稍後再試,或加入我們的 Discord 伺服器取得協助。",
"enabled": "已啟用",
"disabled": "已停用",
"nodeReconnect": "請在節點重新連線後再試!",
"noChannel": "未偵測到語音頻道,請提供一個或先加入語音頻道。",
"alreadyConnected": "已連線至語音頻道。",
"noPermission": "抱歉!我沒有權限加入或在您的語音頻道中發言。",
"noCreatePermission": "抱歉!我沒有權限建立點歌頻道。",
"noPlaySource": "找不到可播放的來源!",
"noPlayer": "此伺服器上沒有找到播放器。",
"notVote": "此指令需要您先投票!輸入 `/vote` 了解更多。",
"missingIntents": "抱歉,無法執行此指令,因為缺少必要的請求 intent`({0})`。",
"languageNotFound": "未找到語言包!請選擇一個現有的語言包。",
"changedLanguage": "已成功切換為 `{0}` 語言包。",
"setPrefix": "完成!我在伺服器的前綴現在是 `{0}`。試著輸入 `{1}ping` 測試一下吧。",
"setDJ": "已將 DJ 設定為 {0}。",
"setQueue": "已將隊列模式設定為 `{0}`。",
"247": "24/7 模式現在是 `{0}`。",
"bypassVote": "您擁有 `{0}` 投票系統。",
"setVolume": "已將音量設定為 `{0}`%",
"toggleController": "您現在已 `{0}` 音樂控制器。",
"toggleDuplicateTrack": "您已 `{0}` 重複曲目防止功能。",
"toggleControllerMsg": "您現在已 `{0}` 來自音樂控制器的訊息。",
"toggleSilentMsg": "您已 {0} 靜音訊息。",
"settingsMenu": "伺服器設定 | {0}",
"settingsTitle": "❤️ 基本資訊:",
"settingsValue": "```前綴: {0}\n語言: {1}\n音樂控制器: {2}\nDJ 身分組: @{3}\n投票略過: {4}\n24/7: {5}\n預設音量: {6}%\n播放時長: {7}```",
"settingsTitle2": "🔗 隊列資訊:",
"settingsValue2": "```隊列模式: {0}\n最大歌曲數: {1}\n重複曲目: {2}```",
"settingsTitle3": "🎤 語音狀態資訊:",
"settingsPermTitle": "✨ 權限:",
"settingsPermValue": "```{0} 管理員\n{1} 管理伺服器\n{2} 管理頻道\n{3} 管理訊息```",
"pingTitle1": "機器人資訊:",
"pingTitle2": "播放器資訊:",
"pingField1": "```分片 ID: {0}/{1}\n分片延遲: {2:.3f}s {3}\n區域: {4}```",
"pingField2": "```節點: {0} - {1:.3f}s\n播放器數: {2}\n語音區域: {3}```",
"addEffect": "已套用 `{0}` 效果。",
"clearEffect": "音效已清除!",
"filterTagAlreadyInUse": "該音效已在使用中!請使用 /cleareffect <標籤> 移除。",
"playlistViewTitle": "📜 {0} 的所有播放清單",
"playlistViewHeaders": "ID:,時長:,名稱:,曲目數:",
"playlistFooter": "輸入 /playlist play [播放清單] 將其加入隊列。",
"playlistNotFound": "未找到播放清單 [`{0}`]。輸入 /playlist view 查看所有播放清單。",
"playlistNotAccess": "抱歉!您無法存取此播放清單!",
"playlistNoTrack": "抱歉!播放清單 [`{0}`] 中沒有曲目。",
"playlistNotAllow": "此指令不支援已連結或共享的播放清單。",
"playlistPlay": "已將播放清單 [`{0}`] 的 `{1}` 首歌曲加入隊列。",
"playlistOverText": "抱歉!播放清單名稱不能超過 10 個字元。",
"playlistSameName": "抱歉!請為播放清單選擇新名稱。",
"playlistDeleteError": "不允許刪除預設播放清單。",
"playlistRemove": "您已刪除播放清單 [`{0}`]。",
"playlistSendErrorPlayer": "抱歉!您不能邀請自己。",
"playlistSendErrorBot": "抱歉!您不能邀請機器人。",
"playlistBelongs": "抱歉!此播放清單屬於 <@{0}>。",
"playlistShare": "抱歉!此播放清單已與 {0} 分享。",
"playlistSent": "抱歉!您之前已經邀請過該使用者。",
"noPlaylistAcc": "{0} 尚未建立播放清單帳號。",
"overPlaylistCreation": "您最多只能建立 `{0}` 個播放清單!",
"playlistExists": "播放清單 [`{0}`] 已存在。",
"playlistNotInvalidUrl": "請輸入有效的公開 Spotify 或 YouTube 播放清單連結。",
"playlistCreated": "您已建立 `{0}` 播放清單。輸入 /playlist view 查看詳情。",
"playlistRenamed": "您已將 `{0}` 重新命名為 `{1}`。",
"playlistLimitTrack": "已達到上限!每個播放清單最多只能新增 `{0}` 首歌曲。",
"playlistPlaylistLink": "不允許使用播放清單連結。",
"playlistStream": "不允許將串流影片加入播放清單。",
"playlistPositionNotFound": "在播放清單 [`{1}`] 中找不到位置 `{0}`",
"playlistRemoved": "👋 已從 {1} 的播放清單 [`{2}`] 中移除 **{0}**。",
"playlistClear": "您已成功清空播放清單 [`{0}`]。",
"playlistView": "播放清單檢視器",
"playlistViewDesc": "```名稱 | ID: {0} | {1}\n總曲目: {2}\n擁有者: {3}\n類型: {4}\n```",
"playlistViewPermsValue": "📖 讀取: ✓ ✍🏽 寫入: {0} 🗑️ 移除: {1}",
"playlistViewPermsValue2": "📖 讀取: {0}",
"playlistViewTrack": "曲目列表",
"playlistViewPage": "第 {0}/{1} 頁 | 總時長: {2}",
"inboxFull": "抱歉!{0} 的收件匣已滿。",
"inboxNoMsg": "您的收件匣中沒有訊息。",
"invitationSent": "邀請已發送給 {0}。",
"notInChannel": "{0},您必須在 {1} 才能使用語音指令。如果您已在頻道,請重新加入!",
"noTrackPlaying": "目前沒有正在播放的歌曲",
"noTrackFound": "未找到對應的歌曲,請提供有效連結。",
"noLinkSupport": "搜尋指令不支援連結!",
"voted": "您已投票!",
"missingPosPerm": "只有 DJ 或管理員能更改位置。",
"missingModePerm": "只有 DJ 或管理員能切換循環模式。",
"missingQueuePerm": "只有 DJ 或管理員能從隊列中移除曲目。",
"missingAutoPlayPerm": "只有 DJ 或管理員能啟用或停用自動播放!",
"missingFunctionPerm": "只有 DJ 或管理員能使用此功能。",
"timeFormatError": "時間格式錯誤。範例: 2:42 或 12:39:31",
"lyricsNotFound": "未找到歌詞。輸入 /lyrics <歌曲名稱> <作者> 查找歌詞。",
"missingTrackInfo": "部分曲目資訊缺失。",
"noVoiceChannel": "未找到語音頻道!",
"playlistAddError": "不允許將串流影片加入播放清單!",
"playlistAddError2": "新增曲目到播放清單時發生問題!",
"playlistLimited": "已達到上限!播放清單最多只能新增 {0} 首歌曲。",
"playlistRepeated": "此曲目已在播放清單中!",
"playlistAdded": "❤️ 已將 **{0}** 加入 {1} 的播放清單 [`{2}`]",
"playerDropdown": "選擇要跳轉的歌曲 ...",
"playerFilter": "選擇要套用的音效 ...",
"buttonBack": "上一首",
"buttonPause": "暫停",
"buttonResume": "繼續",
"buttonSkip": "跳過",
"buttonLeave": "離開",
"buttonLoop": "循環",
"buttonVolumeUp": "音量+",
"buttonVolumeDown": "音量-",
"buttonVolumeMute": "靜音",
"buttonVolumeUnmute": "取消靜音",
"buttonAutoPlay": "自動播放",
"buttonShuffle": "隨機播放",
"buttonForward": "快轉",
"buttonRewind": "倒轉",
"buttonLyrics": "歌詞",
"nowplayingDesc": "**正在播放:**\n```{0}```",
"nowplayingField": "接下來:",
"nowplayingLink": "在 {0} 收聽",
"connect": "已連線至 {0}",
"live": "直播",
"playlistLoad": " 🎶 已將播放清單 **{0}** 的 `{1}` 首歌曲加入隊列。",
"trackLoad": "已新增 **[{0}](<{1}>)** - **{2}** (`{3}`) 並開始播放。\n",
"trackLoad_pos": "已新增 **[{0}](<{1}>)** - **{2}** (`{3}`) 到隊列位置 **{4}**\n",
"searchTitle": "搜尋關鍵字: {0}",
"searchDesc": "➥ 平台: {0} **{1}**\n➥ 結果數: **{2}**\n\n{3}",
"searchWait": "請選擇要加入隊列的歌曲。",
"searchTimeout": "搜尋逾時,請稍後再試。",
"searchSuccess": "歌曲已加入隊列。",
"queueTitle": "即將播放隊列:",
"historyTitle": "播放歷史:",
"viewTitle": "音樂隊列",
"viewDesc": "**正在播放: [點我]({0}) ⮯**\n{1}",
"viewFooter": "第 {0}/{1} 頁 | 總時長: {2}",
"pauseError": "播放器已暫停。",
"pauseVote": "{0} 投票暫停了歌曲。[{1}/{2}]",
"paused": "`{0}` 已暫停播放器。",
"resumeError": "播放器未暫停。",
"resumeVote": "{0} 投票繼續播放。[{1}/{2}]",
"resumed": "`{0}` 已繼續播放。",
"shuffleError": "請在隊列中新增更多歌曲後再隨機播放。",
"shuffleVote": "{0} 投票隨機播放隊列。[{1}/{2}]",
"shuffled": "隊列已隨機排序。",
"skipError": "沒有歌曲可跳過。",
"skipVote": "{0} 投票跳過歌曲。[{1}/{2}]",
"skipped": "`{0}` 已跳過歌曲。",
"backVote": "{0} 投票播放上一首歌。[{1}/{2}]",
"backed": "`{0}` 已切換到上一首歌曲。",
"leaveVote": "{0} 投票停止播放。[{1}/{2}]",
"left": "`{0}` 已停止播放器。",
"seek": "已將播放器定位至 **{0}**",
"repeat": "循環模式已設定為 `{0}`",
"cleared": "已清空 `{0}` 中的所有曲目",
"removed": "已從隊列中移除 `{0}` 首歌曲。",
"forward": "已快轉至 **{0}**",
"rewind": "已倒轉至 **{0}**",
"replay": "正在重播目前的歌曲。",
"swapped": "`{0}` 與 `{1}` 已交換位置",
"moved": "已將 `{0}` 移動到 `{1}`",
"autoplay": "自動播放模式現在是 **{0}**",
"notdj": "您不是 DJ。目前 DJ 是 {0}。",
"djToMe": "您不能將 DJ 身分轉移給自己或機器人。",
"djNotInChannel": "`{0}` 不在語音頻道中。",
"djswap": "您已將 DJ 身分轉移給 `{0}`。",
"voicelinkQueueFull": "抱歉,隊列已達最大 `{0}` 首歌曲!",
"voicelinkOutofList": "請輸入有效的曲目序號!",
"voicelinkDuplicateTrack": "抱歉,此曲目已在隊列中。",
"decodeError": "解碼檔案時發生錯誤!",
"invalidStartTime": "無效的開始時間,必須在 `00:00` 和 `{0}` 之間",
"invalidEndTime": "無效的結束時間,必須在 `00:00` 和 `{0}` 之間",
"invalidTimeOrder": "結束時間不能小於或等於開始時間",
"setStageAnnounceTemplate": "完成!從現在起,您所在的語音狀態將依照模板命名。幾秒後即可看到更新。",
"createSongRequestChannel": "已建立點歌頻道 ({0})!您可以在該頻道輸入歌曲名稱或連結來點歌,無需使用機器人前綴。"
}

View File

@@ -4,7 +4,7 @@
"channel": "canal",
"Provide a channel to connect.": "Proporciona un canal para conectar.",
"play": "reproducir",
"Loads your input into the queue": "Carga tu entrada en la cola.",
"Loads your input into the queue.": "Carga tu entrada en la cola.",
"Searches your query and displays the results.": "Busca tu consulta y muestra los resultados.",
"query": "consulta",
"Input a query or a searchable link.": "Ingresa una consulta o un enlace de búsqueda.",
@@ -93,7 +93,7 @@
"title": "titulo",
"Searches for your query and displays the reutned lyrics.": "Busca tu consulta y muestra la letra encontrada.",
"artist": "artista",
"swapdj": "cambiar_dj",
"swapdj": "cambiardj",
"Transfer dj to another.": "Transfiere el DJ a otro.",
"Choose a member to transfer the dj role.": "Elige un miembro para transferir el rol de DJ.",
"autoplay": "reproduccion_auto",

View File

@@ -93,7 +93,7 @@
"title": "titulo",
"Searches for your query and displays the reutned lyrics.": "Busca tu consulta y muestra la letra encontrada.",
"artist": "artista",
"swapdj": "cambiar_dj",
"swapdj": "cambiardj",
"Transfer dj to another.": "Transfiere el DJ a otro.",
"Choose a member to transfer the dj role.": "Elige un miembro para transferir el rol de DJ.",
"autoplay": "reproduccion_auto",

236
local_langs/zh-CN.json Normal file
View File

@@ -0,0 +1,236 @@
{
"connect": "连接",
"Connect to a voice channel.": "连接到语音频道。",
"channel": "频道",
"Provide a channel to connect.": "提供要连接的频道。",
"play": "播放",
"Loads your input into the queue.": "将您的输入加载到队列中。",
"Searches your query and displays the results.": "搜索您的查询并显示结果。",
"query": "查询",
"Input a query or a searchable link.": "输入查询或可搜索的链接。",
"search": "搜索",
"Input the name of the song.": "输入歌曲名称。",
"platform": "平台",
"Select the platform you want to search.": "选择您要搜索的平台。",
"Youtube": "YouTube",
"Youtube Music": "YouTube 音乐",
"Spotify": "Spotify",
"SoundCloud": "SoundCloud",
"Apple Music": "Apple 音乐",
"playtop": "顶部播放",
"Adds a song with the given url or query on the top of the queue.": "将指定的 URL 或查询加入队列顶部。",
"forceplay": "强制播放",
"Enforce playback using the given URL or query.": "使用指定的 URL 或查询强制播放。",
"pause": "暂停",
"Pause the music.": "暂停音乐。",
"resume": "继续",
"Resume the music.": "继续音乐。",
"skip": "跳过",
"Skips to the next song or skips to the specified song.": "跳到下一首歌曲或跳到指定歌曲。",
"index": "索引",
"Enter a index that you want to skip to.": "输入您要跳转到的索引。",
"back": "返回",
"Skips back to the previous song or skips to the specified previous song.": "返回上一首歌曲或返回到指定的上一首歌曲。",
"Enter a index that you want to skip back to.": "输入您要返回到的索引。",
"seek": "定位",
"Change the player position.": "更改播放器位置。",
"position": "位置",
"Input position. Exmaple: 1:20.": "输入位置。例如1:20。",
"queue": "队列",
"Display the players queue songs in your queue.": "显示队列中的歌曲。",
"export": "导出",
"Exports the entire queue to a text file": "将整个队列导出为文本文件。",
"import": "导入",
"Imports the text file and adds the track to the current queue.": "导入文本文件并将歌曲加入当前队列。",
"attachment": "附件",
"history": "历史",
"Display the players queue songs in your history queue.": "显示历史队列中的歌曲。",
"leave": "离开",
"Disconnects the bot from your voice channel and chears the queue.": "断开机器人与语音频道的连接并清空队列。",
"nowplaying": "正在播放",
"Shows details of the current track.": "显示当前歌曲的详细信息。",
"loop": "循环",
"Changes Loop mode.": "更改循环模式。",
"mode": "模式",
"Choose a looping mode.": "选择循环模式。",
"Off": "关闭",
"Track": "单曲",
"Queue": "队列",
"clear": "清空",
"Remove all the tracks in your queue or history queue.": "清空队列或历史队列中的所有歌曲。",
"Choose a queue that you want to clear.": "选择要清空的队列。",
"History": "历史",
"remove": "移除",
"Removes specified track or a range of tracks from the queue.": "删除队列中的指定歌曲或一系列歌曲。",
"position1": "位置1",
"Input a position from the queue to be removed.": "输入要删除的歌曲位置。",
"position2": "位置2",
"Set the range of the queue to be removed.": "设置要删除的队列范围。",
"member": "成员",
"Remove tracks requested by a specific member.": "删除指定成员点的歌曲。",
"forward": "快进",
"Forwards by a certain amount of time in the current track. The default is 10 seconds.": "在当前歌曲中快进指定时间,默认 10 秒。",
"Input an amount that you to forward to. Exmaple: 1:20": "输入要快进的时间。例如1:20",
"rewind": "后退",
"Rewind by a certain amount of time in the current track. The default is 10 seconds.": "在当前歌曲中后退指定时间,默认 10 秒。",
"Input an amount that you to rewind to. Exmaple: 1:20": "输入要后退的时间。例如1:20",
"replay": "重播",
"Reset the progress of the current song.": "重置当前歌曲进度。",
"shuffle": "随机播放",
"Randomizes the tracks in the queue.": "随机打乱队列中的歌曲。",
"swap": "交换",
"Swaps the specified song to the specified song.": "交换队列中两首歌曲的位置。",
"The track to swap. Example: 2": "要交换的歌曲。例如2",
"The track to swap with position1. Exmaple: 1": "与位置1交换的歌曲。例如1",
"move": "移动",
"Moves the specified song to the specified position.": "将指定歌曲移动到指定位置。",
"target": "目标",
"The track to move. Example: 2": "要移动的歌曲。例如2",
"to": "到",
"The new position to move the track to. Exmaple: 1": "要移动到的新位置。例如1",
"lyrics": "歌词",
"Displays lyrics for the playing track.": "显示正在播放歌曲的歌词。",
"title": "标题",
"Searches for your query and displays the reutned lyrics.": "搜索您的查询并显示返回的歌词。",
"artist": "歌手",
"swapdj": "转移dj",
"Transfer dj to another.": "将 DJ 转移给其他人。",
"Choose a member to transfer the dj role.": "选择要转移 DJ 身份的成员。",
"autoplay": "自动播放",
"Toggles autoplay mode, it will automatically queue the best songs to play.": "切换自动播放模式,将自动推荐歌曲加入队列。",
"help": "帮助",
"Lists all the commands in Vocard.": "列出 Vocard 的所有命令。",
"category": "分类",
"Test if the bot is alive, and see the delay between your commands and my response.": "测试机器人是否运行,并查看您的命令与我的响应之间的延迟。",
"playlist": "播放列表",
"Play all songs from your favorite playlist.": "播放您最喜欢的播放列表中的所有歌曲。",
"name": "名称",
"Input the name of your custom playlist": "输入您自定义播放列表的名称",
"value": "值",
"Play the specific track from your custom playlist.": "播放您自定义播放列表中的指定歌曲。",
"view": "查看",
"List all your playlist and all songs in your favourite playlist.": "列出您所有的播放列表和最喜欢的播放列表中的所有歌曲。",
"create": "创建",
"Create your custom playlist.": "创建自定义播放列表。",
"Give a name to your playlist.": "为您的播放列表命名。",
"link": "链接",
"Provide a playlist link if you are creating link playlist.": "如果您正在创建链接播放列表,请提供播放列表链接。",
"delete": "删除",
"Delete your custom playlist.": "删除自定义播放列表。",
"The name of the playlist.": "播放列表名称。",
"share": "分享",
"Share your custom playlist with your friends.": "与好友分享自定义播放列表。",
"The user id of your friend.": "您好友的用户 ID。",
"The name of the playlist that you want to share.": "您想分享的播放列表名称。",
"rename": "重命名",
"Rename your custom playlist.": "重命名自定义播放列表。",
"The name of your playlist.": "您的播放列表名称。",
"newname": "新名称",
"The new name of your playlist.": "您的播放列表新名称。",
"inbox": "收件箱",
"Show your playlist invitation.": "显示播放列表邀请。",
"add": "添加",
"Add tracks in to your custom playlist.": "将歌曲添加到自定义播放列表。",
"Remove song from your favorite playlist.": "从最喜欢的播放列表中删除歌曲。",
"Input a position from the playlist to be removed.": "输入要删除的歌曲位置。",
"Remove all songs from your favorite playlist.": "删除最喜欢的播放列表中的所有歌曲。",
"Exports the entire playlist to a text file": "将整个播放列表导出为文本文件。",
"settings": "设置",
"prefix": "前缀",
"Change the default prefix for message commands.": "更改消息命令的默认前缀。",
"language": "语言",
"You can choose your preferred language, the bot message will change to the language you set.": "您可以选择偏好的语言,机器人消息将切换为您设置的语言。",
"Set a DJ role or remove DJ role.": "设置或移除 DJ 身份。",
"role": "角色",
"Change to another type of queue mode.": "更改为另一种队列模式。",
"FairQueue": "公平队列",
"Toggles 24/7 mode, which disables automatic inactivity-based disconnects.": "切换 24/7 模式,禁用自动闲置断开。",
"bypassvote": "跳过投票",
"Toggles voting system.": "切换投票系统。",
"Show all the bot settings in your server.": "显示机器人在服务器中的所有设置。",
"volume": "音量",
"Set the player's volume.": "设置播放器音量。",
"Input a integer.": "输入一个整数。",
"toggleController": "切换控制器",
"Toggles the music controller.": "切换音乐控制器。",
"duplicatetrack": "重复歌曲",
"Toggle Vocard to prevent duplicate songs from queuing.": "切换以防止重复歌曲加入队列。",
"customcontroller": "自定义控制器",
"Customizes music controller embeds.": "自定义音乐控制器嵌入。",
"controllermsg": "控制器消息",
"silentmsg": "静默消息",
"Toggles to send a message when clicking the button in the music controller.": "切换在点击音乐控制器按钮时是否发送消息。",
"Toggle silent messaging to send discreet messages without alerting recipients.": "切换静默消息以私密发送,不提醒接收者。",
"debug": "调试",
"speed": "速度",
"Sets the player's playback speed": "设置播放器播放速度。",
"The value to set the speed to. Default is `1.0`": "设置速度值,默认 `1.0`。",
"karaoke": "卡拉ok",
"Uses equalization to eliminate part of a band, usually targeting vocals.": "使用均衡器消除部分频带,通常针对人声。",
"level": "级别",
"The level of the karaoke. Default is `1.0`": "卡拉OK级别默认 `1.0`。",
"monolevel": "单声道级别",
"The monolevel of the karaoke. Default is `1.0`": "卡拉OK单声道级别默认 `1.0`。",
"filterband": "滤波频带",
"The filter band of the karaoke. Default is `220.0`": "卡拉OK滤波频带默认 `220.0`。",
"filterwidth": "滤波宽度",
"The filter band of the karaoke. Default is `100.0`": "卡拉OK滤波宽度默认 `100.0`。",
"tremolo": "颤音",
"Uses amplification to create a shuddering effect, where the volume quickly oscillates.": "通过放大制造颤音效果,音量快速振荡。",
"frequency": "频率",
"The frequency of the tremolo. Default is `2.0`": "颤音频率,默认 `2.0`。",
"depth": "深度",
"The depth of the tremolo. Default is `0.5`": "颤音深度,默认 `0.5`。",
"vibrato": "颤音高低",
"Similar to tremolo. While tremolo oscillates the volume, vibrato oscillates the pitch.": "与颤音相似。颤音影响音量,颤音高低影响音高。",
"The frequency of the vibrato. Default is `2.0`": "颤音高低的频率,默认 `2.0`。",
"The Depth of the vibrato. Default is `0.5`": "颤音高低的深度,默认 `0.5`。",
"rotation": "旋转",
"Rotates the sound around the stereo channels/user headphones aka Audio Panning.": "让声音在立体声/耳机中旋转,也叫声像。",
"hertz": "赫兹",
"The hertz of the rotation. Default is `0.2`": "旋转赫兹,默认 `0.2`。",
"distortion": "失真",
"Distortion effect. It can generate some pretty unique audio effects.": "失真效果,可以产生独特的音效。",
"lowpass": "低通",
"Filter which supresses higher frequencies and allows lower frequencies to pass.": "低通滤波器,抑制高频,让低频通过。",
"smoothing": "平滑",
"The level of the lowPass. Default is `20.0`": "低通平滑级别,默认 `20.0`。",
"channelmix": "声道混合",
"Filter which manually adjusts the panning of the audio.": "手动调整音频声像的滤波器。",
"left_to_left": "左到左",
"Sounds from left to left. Default is `1.0`": "左声道到左声道,默认 `1.0`。",
"right_to_right": "右到右",
"Sounds from right to right. Default is `1.0`": "右声道到右声道,默认 `1.0`。",
"left_to_right": "左到右",
"Sounds from left to right. Default is `0.0`": "左声道到右声道,默认 `0.0`。",
"right_to_left": "右到左",
"Sounds from right to left. Default is `0.0`": "右声道到左声道,默认 `0.0`。",
"nightcore": "夜核",
"Add nightcore filter into your player.": "为播放器添加夜核滤波器。",
"Add 8D filter into your player.": "为播放器添加 8D 滤波器。",
"vaporwave": "蒸汽波",
"Add vaporwave filter into your player.": "为播放器添加蒸汽波滤波器。",
"cleareffect": "清除效果",
"Clear all or specific sound effects.": "清除所有或指定音效。",
"effect": "效果",
"Remove a specific sound effects.": "删除指定音效。",
"start": "开始",
"end": "结束",
"Specify a time you would like to start, e.g. 1:00": "指定开始时间例如1:00。",
"Specify a time you would like to end, e.g. 4:00": "指定结束时间例如4:00。",
"list": "列表",
"Customize the channel topic template": "自定义频道主题模板",
"template": "模板",
"setupchannel": "设置频道",
"Sets up a dedicated channel for song requests in your server.": "在服务器中设置专用点歌频道。",
"Provide a request channel. If not, a text channel will be generated.": "提供点歌频道。如果没有,将生成文本频道。",
"ping": "ping",
"…": "...",
"8d": "8d",
"dj": "dj",
"247": "247",
"stageannounce": "舞台公告",
"Soundcloud": "SoundCloud",
"Fairqueue": "公平队列",
"togglecontroller": "切换控制器"
}

View File

@@ -207,13 +207,7 @@ class CommandCheck(discord.app_commands.CommandTree):
async def get_prefix(bot: commands.Bot, message: discord.Message) -> str:
settings = await func.get_settings(message.guild.id)
prefix = settings.get("prefix", func.settings.bot_prefix)
# Allow owner to use the bot without a prefix
if prefix and not message.content.startswith(prefix) and (await bot.is_owner(message.author) or message.author.id in func.settings.bot_access_user):
return ""
return prefix
return settings.get("prefix", func.settings.bot_prefix)
# Loading settings and logger
func.settings = Settings(func.open_json("settings.json"))

View File

@@ -258,7 +258,7 @@ class Player(VoiceProtocol):
"""Retrieves a localized message or list of messages based on the given keys
for the guild associated with this player.
"""
return func.get_lang_non_async(self.guild.id, *keys)
return func._get_lang(self.settings.get("lang"), *keys)
def required(self, leave=False):
"""