mirror of
https://github.com/kirameki-cafe/Yumi.git
synced 2026-09-13 10:49:20 +00:00
Formatted code
This commit is contained in:
+1
-1
@@ -10,4 +10,4 @@
|
||||
"bracketSpacing": true,
|
||||
"jsxBracketSameLine": false,
|
||||
"semi": true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
[
|
||||
{
|
||||
"type": "ping",
|
||||
"type": "ping",
|
||||
"title": "☁️ Internet | ",
|
||||
"host": "1.1.1.1"
|
||||
},
|
||||
{
|
||||
"type": "discordwebsocket",
|
||||
"type": "discordwebsocket",
|
||||
"title": "🚀 Discord Websocket | "
|
||||
},
|
||||
{
|
||||
"type": "discordhttp",
|
||||
"type": "discordhttp",
|
||||
"title": "🏓 Discord HTTP | "
|
||||
}
|
||||
]
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
"title": "📰 Newsletter",
|
||||
"description": "\u200B\n**{bot_username} has been super-charged and upgraded!**\nThe long-awaited update is now here, running latest and greatest version!\n\n**What's new?**\n\u200B\n",
|
||||
"fields": [
|
||||
{
|
||||
{
|
||||
"name": "🔥 Feature 1!",
|
||||
"value": "\u200B\nSuch wow! New feature so cool 10/10!!!!\n\u200B\n",
|
||||
"inline": false
|
||||
},
|
||||
{
|
||||
{
|
||||
"name": "✨ Shiny and new feature!",
|
||||
"value": "\u200B\nNow brighter than ever!\n\u200B\n",
|
||||
"inline": false
|
||||
@@ -29,8 +29,8 @@
|
||||
"title": "🔧 Maintenance",
|
||||
"description": "{bot_username} will be down for maintenance\nThe maintenance includes feature improvement to bug fixes\n\nDuring the maintenance, {bot_username}'s commands and features will be unavailable",
|
||||
"fields": [
|
||||
{ "name": "Start", "value": "<t:1812519286:R>", "inline": true},
|
||||
{ "name": "End", "value": "<t:3390442486:R>", "inline": true}
|
||||
{ "name": "Start", "value": "<t:1812519286:R>", "inline": true },
|
||||
{ "name": "End", "value": "<t:3390442486:R>", "inline": true }
|
||||
],
|
||||
"thumbnail": {
|
||||
"url": "bot_avatar"
|
||||
@@ -52,4 +52,4 @@
|
||||
"url": "bot_avatar"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+171
-171
@@ -1,172 +1,172 @@
|
||||
{
|
||||
"common": {
|
||||
"available_args": "Available arguments",
|
||||
"member_no_permissions": "Access denied (O_O;)",
|
||||
"member_no_permissions_description": "You need ``{{PERMISSIONS}}`` permissions on this guild",
|
||||
"bot_no_permissions": "I don't have permission (O_O;)",
|
||||
"bot_no_permissions_description": "I need ``{{PERMISSIONS}}`` permissions",
|
||||
"processing": "Please wait a moment~",
|
||||
"processing_description": "Getting it done right now! (งᓀ‸ᓂ)ง"
|
||||
},
|
||||
"stats": {
|
||||
"title": "Stats",
|
||||
"info": "Statistical data of me",
|
||||
"users": "Users",
|
||||
"x_servers": "{{COUNT}} servers",
|
||||
"x_users": "{{COUNT}} users",
|
||||
"uptime_since": "Uptime since",
|
||||
"server_uptime_x": "Server | {{{TIME}}}",
|
||||
"process_uptime_x": "Process | {{{TIME}}}"
|
||||
},
|
||||
"userinfo": {
|
||||
"title": "User Information",
|
||||
"info": "Show information of a specific user, such as status, activities, and more",
|
||||
"valid_args": "(``@Mention or User ID``)",
|
||||
"user_not_found": "I cannot find that user, is your information correct?",
|
||||
"online": "Online",
|
||||
"idle": "Idle",
|
||||
"dnd": "Do not disturb",
|
||||
"offline": "Recently Offline",
|
||||
"unknown": "Offline / Unknown",
|
||||
"user_guild_info": "Information on this guild",
|
||||
"join_date_unknown": "Unknown join date",
|
||||
"join_date": "Joined {{{TIME}}}",
|
||||
"guild_owner": "Owner of this guild",
|
||||
"custom_status": "Custom Status",
|
||||
"playing_x": "Playing {{NAME}}",
|
||||
"streaming_x": "Streaming {{NAME}}",
|
||||
"listening_x": "Listening to {{NAME}}",
|
||||
"watching_x": "Watching {{NAME}}",
|
||||
"competing_x": "Competing {{NAME}}",
|
||||
"since": "Since {{{TIME}}}",
|
||||
"end": "Ending {{{TIME}}}"
|
||||
},
|
||||
"say": {
|
||||
"title": "Say",
|
||||
"info": "Make me say something that you want~",
|
||||
"valid_args": "``(Text message)``",
|
||||
"success": "Done~, I posted a message with your content!",
|
||||
"error": "An error occurred while trying to post the message with your content!"
|
||||
},
|
||||
"invite": {
|
||||
"title": "Invite",
|
||||
"info": "[Invite {{BOT_NAME}} to your server!]({{{LINK}}})",
|
||||
"private": "{{BOT_NAME}}'s invite is currently private. Only the developers can add me to another server"
|
||||
},
|
||||
"help": {
|
||||
"title": "Help - {{BOT_NAME}}",
|
||||
"prefix_title": "Prefix",
|
||||
"prefix_description": "You can call me using ``{{{PREFIX}}}``, {{{PREFIX_MENTION}}} or ``/slash command``",
|
||||
"available_commands": "Available commands",
|
||||
"general": "General",
|
||||
"music": "Music",
|
||||
"games": "Games",
|
||||
"admin": "Admin",
|
||||
"developer": "Developer",
|
||||
"footer": "Made with 💖 and [open source]"
|
||||
},
|
||||
"musicplayer": {
|
||||
"now_playing": "Now playing",
|
||||
"now_playing_repeating": "Now playing (Repeating)",
|
||||
"no_music_playing": "There are no music playing (ᴗ˳ᴗ);",
|
||||
"not_in_voice": "You need to be in the voice channel first~",
|
||||
"different_voice_channel": "You are not in the same voice channel as me!",
|
||||
"track_error": "Error while playing music, skipping this track"
|
||||
},
|
||||
"musicplayer_join": {
|
||||
"success": "Successfully joined the voice channel, I'm here now~",
|
||||
"error": "Unable to join the voice channel",
|
||||
"disconnected": "Disconnected",
|
||||
"disconnected_reason_disconnected": "I got disconnected from the voice channel",
|
||||
"in_use": "I can't join mutiple voice channel on the same guild.\n There are also somebody listening to the music in the voice channel I'm currently in.",
|
||||
"in_use_wait": "Wait until I finish playing there or I'm alone there. Better yet, join them!",
|
||||
"can_force_move": "\n\n**Or... just (ab)use your admin permissions and move me to where you want!**",
|
||||
"already_joined_title": "I'm already here~ (* ^ ω ^)",
|
||||
"already_joined_description": "Already in the voice channel you are currently connected to"
|
||||
},
|
||||
"musicplayer_leave": {
|
||||
"success": "Successfully left the voice channel, see ya!"
|
||||
},
|
||||
"musicplayer_loop": {
|
||||
"info": "Current loop mode is {{MODE}}",
|
||||
"valid_args": "Available loop mode: ``None`` ``Current``",
|
||||
"invalid": "Invalid loop mode",
|
||||
"loop_set": "Loop mode is now set to {{MODE}}"
|
||||
},
|
||||
"musicplayer_pause": {
|
||||
"paused": "Paused",
|
||||
"already_paused": "Already paused (´。• ω •。`)"
|
||||
},
|
||||
"musicplayer_resume": {
|
||||
"resumed": "Resumed",
|
||||
"not_paused": "The music is already playing (´。• ᵕ •。`)"
|
||||
},
|
||||
"musicplayer_play": {
|
||||
"title": "Play",
|
||||
"info": "Play a song",
|
||||
"valid_args": "``(Search query or Link)``",
|
||||
"queue_added_song": "Song added to queue! ヽ(>∀<☆)ノ",
|
||||
"queue_added_songs": "Songs added to queue! ヽ(>∀<☆)ノ",
|
||||
"queue_added_songs_description": "Added {{COUNT}} songs to the queue",
|
||||
"error": "Error while looking up the song"
|
||||
},
|
||||
"musicplayer_playmy": {
|
||||
"not_detected": "You don't seem to be listening to any music currently according to your activity"
|
||||
},
|
||||
"musicplayer_queue": {
|
||||
"title": "Queue",
|
||||
"valid_args": "``Clear`` ``Shuffle``",
|
||||
"empty": "The queue is empty! (っ˘ω˘ς )",
|
||||
"now_playing": "Now playing",
|
||||
"upcoming_song": "Upcoming song",
|
||||
"looping_current": "(Looping current)",
|
||||
"song_x_in_queue": "There are {{COUNT}} song in the queue!",
|
||||
"cleared": "Queue cleared~ (。•ˇ‸ˇ•。)",
|
||||
"shuffled": "Queue shuffled"
|
||||
},
|
||||
"musicplayer_search": {
|
||||
"title": "Search",
|
||||
"info": "Search for a song",
|
||||
"valid_args": "``(Search query)``",
|
||||
"title_result": "Search result",
|
||||
"x_results_found": "{{COUNT}} results found"
|
||||
},
|
||||
"musicplayer_skip": {
|
||||
"skipped": "Skipped",
|
||||
"skipped_last_song": "Skipped, that was the last song"
|
||||
},
|
||||
"settings": {
|
||||
"title": "Settings",
|
||||
"description": "Change how {{BOT_NAME}} behave on **{{{GUILD_NAME}}}**",
|
||||
"valid_args": "``Prefix`` ``Language`` ``EnableServiceAnnouncement`` ``ServiceAnnouncementChannel``"
|
||||
},
|
||||
"settings_prefix": {
|
||||
"info": "Current prefix is {{{PREFIX}}}",
|
||||
"info_description": "Provide a new prefix to change",
|
||||
"prefix_too_long": "Prefix too long",
|
||||
"prefix_too_long_description": "Can you even remember that? 😆",
|
||||
"prefix_is_mention": "Prefix cannot be @Mention of me",
|
||||
"prefix_is_mention_description": "You can already call me by mentioning me. I got that covered, don't worry",
|
||||
"prefix_updated": "Prefix updated",
|
||||
"prefix_updated_description": "From now onwards, I shall be called by using ``{{{PREFIX}}}``"
|
||||
},
|
||||
"settings_language": {
|
||||
"info": "Current language is {{LANGUAGE}}",
|
||||
"info_description": "Provide a new language to change\n**Available languages**: ``{{LANGUAGES}}``",
|
||||
"language_invalid": "Invalid language",
|
||||
"language_invalid_description": "The language code is invalid or not supported yet",
|
||||
"language_updated": "Language updated",
|
||||
"language_updated_description": "I will be using {{LANGUAGE}} from now on"
|
||||
},
|
||||
"ping": {
|
||||
"title": "Network performance",
|
||||
"title_processing": "Measuring network performance ( ◕▿◕ )",
|
||||
"running_on": "Running on {{HOST}}",
|
||||
"development_environment": "Development Environment"
|
||||
},
|
||||
"support": {
|
||||
"title": "Support",
|
||||
"info": "[Join {{BOT_NAME}}'s support server]({{{LINK}}})",
|
||||
"not_available": "{{BOT_NAME}}'s support server is currently unavailable"
|
||||
}
|
||||
}
|
||||
"common": {
|
||||
"available_args": "Available arguments",
|
||||
"member_no_permissions": "Access denied (O_O;)",
|
||||
"member_no_permissions_description": "You need ``{{PERMISSIONS}}`` permissions on this guild",
|
||||
"bot_no_permissions": "I don't have permission (O_O;)",
|
||||
"bot_no_permissions_description": "I need ``{{PERMISSIONS}}`` permissions",
|
||||
"processing": "Please wait a moment~",
|
||||
"processing_description": "Getting it done right now! (งᓀ‸ᓂ)ง"
|
||||
},
|
||||
"stats": {
|
||||
"title": "Stats",
|
||||
"info": "Statistical data of me",
|
||||
"users": "Users",
|
||||
"x_servers": "{{COUNT}} servers",
|
||||
"x_users": "{{COUNT}} users",
|
||||
"uptime_since": "Uptime since",
|
||||
"server_uptime_x": "Server | {{{TIME}}}",
|
||||
"process_uptime_x": "Process | {{{TIME}}}"
|
||||
},
|
||||
"userinfo": {
|
||||
"title": "User Information",
|
||||
"info": "Show information of a specific user, such as status, activities, and more",
|
||||
"valid_args": "(``@Mention or User ID``)",
|
||||
"user_not_found": "I cannot find that user, is your information correct?",
|
||||
"online": "Online",
|
||||
"idle": "Idle",
|
||||
"dnd": "Do not disturb",
|
||||
"offline": "Recently Offline",
|
||||
"unknown": "Offline / Unknown",
|
||||
"user_guild_info": "Information on this guild",
|
||||
"join_date_unknown": "Unknown join date",
|
||||
"join_date": "Joined {{{TIME}}}",
|
||||
"guild_owner": "Owner of this guild",
|
||||
"custom_status": "Custom Status",
|
||||
"playing_x": "Playing {{NAME}}",
|
||||
"streaming_x": "Streaming {{NAME}}",
|
||||
"listening_x": "Listening to {{NAME}}",
|
||||
"watching_x": "Watching {{NAME}}",
|
||||
"competing_x": "Competing {{NAME}}",
|
||||
"since": "Since {{{TIME}}}",
|
||||
"end": "Ending {{{TIME}}}"
|
||||
},
|
||||
"say": {
|
||||
"title": "Say",
|
||||
"info": "Make me say something that you want~",
|
||||
"valid_args": "``(Text message)``",
|
||||
"success": "Done~, I posted a message with your content!",
|
||||
"error": "An error occurred while trying to post the message with your content!"
|
||||
},
|
||||
"invite": {
|
||||
"title": "Invite",
|
||||
"info": "[Invite {{BOT_NAME}} to your server!]({{{LINK}}})",
|
||||
"private": "{{BOT_NAME}}'s invite is currently private. Only the developers can add me to another server"
|
||||
},
|
||||
"help": {
|
||||
"title": "Help - {{BOT_NAME}}",
|
||||
"prefix_title": "Prefix",
|
||||
"prefix_description": "You can call me using ``{{{PREFIX}}}``, {{{PREFIX_MENTION}}} or ``/slash command``",
|
||||
"available_commands": "Available commands",
|
||||
"general": "General",
|
||||
"music": "Music",
|
||||
"games": "Games",
|
||||
"admin": "Admin",
|
||||
"developer": "Developer",
|
||||
"footer": "Made with 💖 and [open source]"
|
||||
},
|
||||
"musicplayer": {
|
||||
"now_playing": "Now playing",
|
||||
"now_playing_repeating": "Now playing (Repeating)",
|
||||
"no_music_playing": "There are no music playing (ᴗ˳ᴗ);",
|
||||
"not_in_voice": "You need to be in the voice channel first~",
|
||||
"different_voice_channel": "You are not in the same voice channel as me!",
|
||||
"track_error": "Error while playing music, skipping this track"
|
||||
},
|
||||
"musicplayer_join": {
|
||||
"success": "Successfully joined the voice channel, I'm here now~",
|
||||
"error": "Unable to join the voice channel",
|
||||
"disconnected": "Disconnected",
|
||||
"disconnected_reason_disconnected": "I got disconnected from the voice channel",
|
||||
"in_use": "I can't join mutiple voice channel on the same guild.\n There are also somebody listening to the music in the voice channel I'm currently in.",
|
||||
"in_use_wait": "Wait until I finish playing there or I'm alone there. Better yet, join them!",
|
||||
"can_force_move": "\n\n**Or... just (ab)use your admin permissions and move me to where you want!**",
|
||||
"already_joined_title": "I'm already here~ (* ^ ω ^)",
|
||||
"already_joined_description": "Already in the voice channel you are currently connected to"
|
||||
},
|
||||
"musicplayer_leave": {
|
||||
"success": "Successfully left the voice channel, see ya!"
|
||||
},
|
||||
"musicplayer_loop": {
|
||||
"info": "Current loop mode is {{MODE}}",
|
||||
"valid_args": "Available loop mode: ``None`` ``Current``",
|
||||
"invalid": "Invalid loop mode",
|
||||
"loop_set": "Loop mode is now set to {{MODE}}"
|
||||
},
|
||||
"musicplayer_pause": {
|
||||
"paused": "Paused",
|
||||
"already_paused": "Already paused (´。• ω •。`)"
|
||||
},
|
||||
"musicplayer_resume": {
|
||||
"resumed": "Resumed",
|
||||
"not_paused": "The music is already playing (´。• ᵕ •。`)"
|
||||
},
|
||||
"musicplayer_play": {
|
||||
"title": "Play",
|
||||
"info": "Play a song",
|
||||
"valid_args": "``(Search query or Link)``",
|
||||
"queue_added_song": "Song added to queue! ヽ(>∀<☆)ノ",
|
||||
"queue_added_songs": "Songs added to queue! ヽ(>∀<☆)ノ",
|
||||
"queue_added_songs_description": "Added {{COUNT}} songs to the queue",
|
||||
"error": "Error while looking up the song"
|
||||
},
|
||||
"musicplayer_playmy": {
|
||||
"not_detected": "You don't seem to be listening to any music currently according to your activity"
|
||||
},
|
||||
"musicplayer_queue": {
|
||||
"title": "Queue",
|
||||
"valid_args": "``Clear`` ``Shuffle``",
|
||||
"empty": "The queue is empty! (っ˘ω˘ς )",
|
||||
"now_playing": "Now playing",
|
||||
"upcoming_song": "Upcoming song",
|
||||
"looping_current": "(Looping current)",
|
||||
"song_x_in_queue": "There are {{COUNT}} song in the queue!",
|
||||
"cleared": "Queue cleared~ (。•ˇ‸ˇ•。)",
|
||||
"shuffled": "Queue shuffled"
|
||||
},
|
||||
"musicplayer_search": {
|
||||
"title": "Search",
|
||||
"info": "Search for a song",
|
||||
"valid_args": "``(Search query)``",
|
||||
"title_result": "Search result",
|
||||
"x_results_found": "{{COUNT}} results found"
|
||||
},
|
||||
"musicplayer_skip": {
|
||||
"skipped": "Skipped",
|
||||
"skipped_last_song": "Skipped, that was the last song"
|
||||
},
|
||||
"settings": {
|
||||
"title": "Settings",
|
||||
"description": "Change how {{BOT_NAME}} behave on **{{{GUILD_NAME}}}**",
|
||||
"valid_args": "``Prefix`` ``Language`` ``EnableServiceAnnouncement`` ``ServiceAnnouncementChannel``"
|
||||
},
|
||||
"settings_prefix": {
|
||||
"info": "Current prefix is {{{PREFIX}}}",
|
||||
"info_description": "Provide a new prefix to change",
|
||||
"prefix_too_long": "Prefix too long",
|
||||
"prefix_too_long_description": "Can you even remember that? 😆",
|
||||
"prefix_is_mention": "Prefix cannot be @Mention of me",
|
||||
"prefix_is_mention_description": "You can already call me by mentioning me. I got that covered, don't worry",
|
||||
"prefix_updated": "Prefix updated",
|
||||
"prefix_updated_description": "From now onwards, I shall be called by using ``{{{PREFIX}}}``"
|
||||
},
|
||||
"settings_language": {
|
||||
"info": "Current language is {{LANGUAGE}}",
|
||||
"info_description": "Provide a new language to change\n**Available languages**: ``{{LANGUAGES}}``",
|
||||
"language_invalid": "Invalid language",
|
||||
"language_invalid_description": "The language code is invalid or not supported yet",
|
||||
"language_updated": "Language updated",
|
||||
"language_updated_description": "I will be using {{LANGUAGE}} from now on"
|
||||
},
|
||||
"ping": {
|
||||
"title": "Network performance",
|
||||
"title_processing": "Measuring network performance ( ◕▿◕ )",
|
||||
"running_on": "Running on {{HOST}}",
|
||||
"development_environment": "Development Environment"
|
||||
},
|
||||
"support": {
|
||||
"title": "Support",
|
||||
"info": "[Join {{BOT_NAME}}'s support server]({{{LINK}}})",
|
||||
"not_available": "{{BOT_NAME}}'s support server is currently unavailable"
|
||||
}
|
||||
}
|
||||
|
||||
+171
-171
@@ -1,172 +1,172 @@
|
||||
{
|
||||
"common": {
|
||||
"available_args": "Available arguments",
|
||||
"member_no_permissions": "許可していない (O_O;)",
|
||||
"member_no_permissions_description": "このギルドでは ``{{PERMISSIONS}}`` の許可が必要です!",
|
||||
"bot_no_permissions": "許可がない (O_O;)",
|
||||
"bot_no_permissions_description": "そのためには、あたしの``{{PERMISSIONS}}``の権限が必要です",
|
||||
"processing": "アクションの実行",
|
||||
"processing_description": "今これを成し遂げています (งᓀ‸ᓂ)ง"
|
||||
},
|
||||
"stats": {
|
||||
"title": "統計情報",
|
||||
"info": "現在のボットの統計情報",
|
||||
"users": "ユーザー",
|
||||
"x_servers": "{{COUNT}} サーヴァーズ",
|
||||
"x_users": "{{COUNT}} ユーザー",
|
||||
"uptime_since": "アップタイム",
|
||||
"server_uptime_x": "サーヴァーズ | {{{TIME}}}",
|
||||
"process_uptime_x": "プロセス | {{{TIME}}}"
|
||||
},
|
||||
"userinfo": {
|
||||
"title": "ユーザー情報",
|
||||
"info": "ステータス、アクティビティなど、特定のユーザーの情報を表示します",
|
||||
"valid_args": "(``@メンションまたはユーザーID``)",
|
||||
"user_not_found": "ユーザーが見つかりません。あなたの情報は正しいですか?",
|
||||
"online": "オンライン",
|
||||
"idle": "アイドル",
|
||||
"dnd": "起こさないで",
|
||||
"offline": "最近のオフライン",
|
||||
"unknown": "オフライン/不明",
|
||||
"user_guild_info": "このギルドの情報",
|
||||
"join_date_unknown": "このギルドの加入日が特定できない",
|
||||
"join_date": "加入 {{{TIME}}}",
|
||||
"guild_owner": "このギルドのオーナー",
|
||||
"custom_status": "カスタムステータス",
|
||||
"playing_x": "{{NAME}}をプレイ中",
|
||||
"streaming_x": "{{NAME}}をストリーミング中",
|
||||
"listening_x": "{{NAME}}を再生中",
|
||||
"watching_x": "{{NAME}}鑑賞中",
|
||||
"competing_x": "{{NAME}}に参戦中です",
|
||||
"since": "{{{TIME}}}から",
|
||||
"end": "{{{TIME}}}で終了"
|
||||
},
|
||||
"say": {
|
||||
"title": "言うこと",
|
||||
"info": "ボットとしてメッセージを送信する",
|
||||
"valid_args": "``(テキストメッセージ)``",
|
||||
"success": "メッセージの送信に成功しました",
|
||||
"error": "メッセージを送信できない"
|
||||
},
|
||||
"invite": {
|
||||
"title": "招待状リンク",
|
||||
"info": "[あなたのサーバに{{BOT_NAME}}を招待してください]({{{LINK}}})",
|
||||
"private": "{{BOT_NAME}}の招待は現在非公開です。開発者だけが私を別のサーバーに追加することができます"
|
||||
},
|
||||
"help": {
|
||||
"title": "ヘルプ - {{BOT_NAME}}",
|
||||
"prefix_title": "プリフィクス",
|
||||
"prefix_description": "{{{PREFIX}}}、{{{PREFIX_MENTION}}}、``/スラッシュコマンド`` で呼び出すことができます",
|
||||
"available_commands": "使用可能なコマンド",
|
||||
"general": "一般",
|
||||
"music": "音楽",
|
||||
"games": "ゲーム",
|
||||
"admin": "管理者",
|
||||
"developer": "デベロッパー",
|
||||
"footer": "💖 を込めて作りました、[オープンソース]"
|
||||
},
|
||||
"musicplayer": {
|
||||
"now_playing": "再生中",
|
||||
"now_playing_repeating": "再生中(リピート再生)",
|
||||
"no_music_playing": "音楽が流れていない (ᴗ˳ᴗ);",
|
||||
"not_in_voice": "まず音声チャンネルに入る必要がある!",
|
||||
"different_voice_channel": "音声チャンネルが違うぞ!",
|
||||
"track_error": "音楽再生中にエラーが発生し、このトラックをスキップしています。"
|
||||
},
|
||||
"musicplayer_join": {
|
||||
"success": "音声チャネルへの参加に成功",
|
||||
"error": "音声チャネルに参加できない",
|
||||
"disconnected": "ディスコネクト",
|
||||
"disconnected_reason_disconnected": "音声チャネルから切断された",
|
||||
"in_use": "同じギルドで複数のボイスチャンネルに参加することができません。\n今入っているボイスチャンネルで音楽を聴いている人がいます。",
|
||||
"in_use_wait": "そこで遊び終わるか、そこで一人になるまで待ってください。いっそのこと、参加しちゃいましょう",
|
||||
"can_force_move": "\n\n**もしくは...管理者権限を悪用して、私を好きな場所に移動させてください!**",
|
||||
"already_joined_title": "もうここにいる",
|
||||
"already_joined_description": "現在接続している音声チャンネルですでに (* ^ ω ^)"
|
||||
},
|
||||
"musicplayer_leave": {
|
||||
"success": "音声チャネルからの離脱に成功"
|
||||
},
|
||||
"musicplayer_loop": {
|
||||
"info": "現在のループモードは「{{MODE}}」です。",
|
||||
"valid_args": "使用可能なループモード: ``None`` ``Current``",
|
||||
"invalid": "ループモードが正しくない",
|
||||
"loop_set": "ループモードが「{{MODE}}」になりました。"
|
||||
},
|
||||
"musicplayer_pause": {
|
||||
"paused": "一時停止",
|
||||
"already_paused": "すでに一時停止中 (´。• ω •。`)"
|
||||
},
|
||||
"musicplayer_resume": {
|
||||
"resumed": "再開しました",
|
||||
"not_paused": "現在、音楽は一時停止していません (´。• ᵕ •。`)"
|
||||
},
|
||||
"musicplayer_play": {
|
||||
"title": "プレイ",
|
||||
"info": "曲を再生する",
|
||||
"valid_args": "``(検索クエリまたはリンク)``",
|
||||
"queue_added_song": "キューに曲を追加しました ヽ(>∀<☆)ノ",
|
||||
"queue_added_songs": "たくさんの曲をキューに追加しました ヽ(>∀<☆)ノ",
|
||||
"queue_added_songs_description": "キューに{{COUNT}}曲を追加",
|
||||
"error": "曲の検索中にエラーが発生"
|
||||
},
|
||||
"musicplayer_playmy": {
|
||||
"not_detected": "あなたの活動状況を見ると、現在、音楽を聴いていないようですね"
|
||||
},
|
||||
"musicplayer_queue": {
|
||||
"title": "キュー",
|
||||
"valid_args": "``Clear`` ``Shuffle``",
|
||||
"empty": "キューは空です! (っ˘ω˘ς )",
|
||||
"now_playing": "再生中",
|
||||
"upcoming_song": "次の曲",
|
||||
"looping_current": "(この曲の繰り返し)",
|
||||
"song_x_in_queue": "{{COUNT}}曲も並んでいますよ。",
|
||||
"cleared": "キューがクリアされました (。•ˇ‸ˇ•。)",
|
||||
"shuffled": "キューがシャッフルされました"
|
||||
},
|
||||
"musicplayer_search": {
|
||||
"title": "検索",
|
||||
"info": "楽曲を検索する",
|
||||
"valid_args": "``(検索クエリ)``",
|
||||
"title_result": "検索結果",
|
||||
"x_results_found": "{{COUNT}}件見つかりました。"
|
||||
},
|
||||
"musicplayer_skip": {
|
||||
"skipped": "スキップした",
|
||||
"skipped_last_song": "スキップした、それは最後の曲だった"
|
||||
},
|
||||
"settings": {
|
||||
"title": "設定",
|
||||
"description": "**{{{GUILD_NAME}}}**サーバでの{{BOT_NAME}}の動作変更",
|
||||
"valid_args": "``Prefix`` ``Language`` ``EnableServiceAnnouncement`` ``ServiceAnnouncementChannel``"
|
||||
},
|
||||
"settings_prefix": {
|
||||
"info": "現在の接頭辞は「{{{PREFIX}}}」です。",
|
||||
"info_description": "変更する新しいプレフィックスを提供する",
|
||||
"prefix_too_long": "プリフィックスが長すぎる",
|
||||
"prefix_too_long_description": "そんな情報まで覚えているんですか 😆",
|
||||
"prefix_is_mention": "プレフィックスを@メンションにすることはできません",
|
||||
"prefix_is_mention_description": "それはもう、私を@メンションすることで可能です。心配しないでください",
|
||||
"prefix_updated": "プレフィックスを更新",
|
||||
"prefix_updated_description": "これ以降、私は 「``{{{PREFIX}}}``」 を使って呼び出されることになります。"
|
||||
},
|
||||
"settings_language": {
|
||||
"info": "現在の言語は{{LANGUAGE}}です",
|
||||
"info_description": "変更する新しい言語を提供する\n**利用可能な言語**: ``{{LANGUAGES}}``",
|
||||
"language_invalid": "無効な言語",
|
||||
"language_invalid_description": "言語コードが無効であるか、まだサポートされていません",
|
||||
"language_updated": "言語が変更されました",
|
||||
"language_updated_description": "これからは{{LANGUAGE}}を使います"
|
||||
},
|
||||
"ping": {
|
||||
"title": "ネットワークパフォーマンス",
|
||||
"title_processing": "ネットワーク性能の測定 ( ◕▿◕ )",
|
||||
"running_on": "{{HOST}}で実行中",
|
||||
"development_environment": "開発環境"
|
||||
},
|
||||
"support": {
|
||||
"title": "サポート",
|
||||
"info": "[{{BOT_NAME}}のサポートサーバーに参加する]({{{LINK}}})",
|
||||
"not_available": "{{BOT_NAME}}のサポートサーバーは現在利用できません"
|
||||
}
|
||||
}
|
||||
"common": {
|
||||
"available_args": "Available arguments",
|
||||
"member_no_permissions": "許可していない (O_O;)",
|
||||
"member_no_permissions_description": "このギルドでは ``{{PERMISSIONS}}`` の許可が必要です!",
|
||||
"bot_no_permissions": "許可がない (O_O;)",
|
||||
"bot_no_permissions_description": "そのためには、あたしの``{{PERMISSIONS}}``の権限が必要です",
|
||||
"processing": "アクションの実行",
|
||||
"processing_description": "今これを成し遂げています (งᓀ‸ᓂ)ง"
|
||||
},
|
||||
"stats": {
|
||||
"title": "統計情報",
|
||||
"info": "現在のボットの統計情報",
|
||||
"users": "ユーザー",
|
||||
"x_servers": "{{COUNT}} サーヴァーズ",
|
||||
"x_users": "{{COUNT}} ユーザー",
|
||||
"uptime_since": "アップタイム",
|
||||
"server_uptime_x": "サーヴァーズ | {{{TIME}}}",
|
||||
"process_uptime_x": "プロセス | {{{TIME}}}"
|
||||
},
|
||||
"userinfo": {
|
||||
"title": "ユーザー情報",
|
||||
"info": "ステータス、アクティビティなど、特定のユーザーの情報を表示します",
|
||||
"valid_args": "(``@メンションまたはユーザーID``)",
|
||||
"user_not_found": "ユーザーが見つかりません。あなたの情報は正しいですか?",
|
||||
"online": "オンライン",
|
||||
"idle": "アイドル",
|
||||
"dnd": "起こさないで",
|
||||
"offline": "最近のオフライン",
|
||||
"unknown": "オフライン/不明",
|
||||
"user_guild_info": "このギルドの情報",
|
||||
"join_date_unknown": "このギルドの加入日が特定できない",
|
||||
"join_date": "加入 {{{TIME}}}",
|
||||
"guild_owner": "このギルドのオーナー",
|
||||
"custom_status": "カスタムステータス",
|
||||
"playing_x": "{{NAME}}をプレイ中",
|
||||
"streaming_x": "{{NAME}}をストリーミング中",
|
||||
"listening_x": "{{NAME}}を再生中",
|
||||
"watching_x": "{{NAME}}鑑賞中",
|
||||
"competing_x": "{{NAME}}に参戦中です",
|
||||
"since": "{{{TIME}}}から",
|
||||
"end": "{{{TIME}}}で終了"
|
||||
},
|
||||
"say": {
|
||||
"title": "言うこと",
|
||||
"info": "ボットとしてメッセージを送信する",
|
||||
"valid_args": "``(テキストメッセージ)``",
|
||||
"success": "メッセージの送信に成功しました",
|
||||
"error": "メッセージを送信できない"
|
||||
},
|
||||
"invite": {
|
||||
"title": "招待状リンク",
|
||||
"info": "[あなたのサーバに{{BOT_NAME}}を招待してください]({{{LINK}}})",
|
||||
"private": "{{BOT_NAME}}の招待は現在非公開です。開発者だけが私を別のサーバーに追加することができます"
|
||||
},
|
||||
"help": {
|
||||
"title": "ヘルプ - {{BOT_NAME}}",
|
||||
"prefix_title": "プリフィクス",
|
||||
"prefix_description": "{{{PREFIX}}}、{{{PREFIX_MENTION}}}、``/スラッシュコマンド`` で呼び出すことができます",
|
||||
"available_commands": "使用可能なコマンド",
|
||||
"general": "一般",
|
||||
"music": "音楽",
|
||||
"games": "ゲーム",
|
||||
"admin": "管理者",
|
||||
"developer": "デベロッパー",
|
||||
"footer": "💖 を込めて作りました、[オープンソース]"
|
||||
},
|
||||
"musicplayer": {
|
||||
"now_playing": "再生中",
|
||||
"now_playing_repeating": "再生中(リピート再生)",
|
||||
"no_music_playing": "音楽が流れていない (ᴗ˳ᴗ);",
|
||||
"not_in_voice": "まず音声チャンネルに入る必要がある!",
|
||||
"different_voice_channel": "音声チャンネルが違うぞ!",
|
||||
"track_error": "音楽再生中にエラーが発生し、このトラックをスキップしています。"
|
||||
},
|
||||
"musicplayer_join": {
|
||||
"success": "音声チャネルへの参加に成功",
|
||||
"error": "音声チャネルに参加できない",
|
||||
"disconnected": "ディスコネクト",
|
||||
"disconnected_reason_disconnected": "音声チャネルから切断された",
|
||||
"in_use": "同じギルドで複数のボイスチャンネルに参加することができません。\n今入っているボイスチャンネルで音楽を聴いている人がいます。",
|
||||
"in_use_wait": "そこで遊び終わるか、そこで一人になるまで待ってください。いっそのこと、参加しちゃいましょう",
|
||||
"can_force_move": "\n\n**もしくは...管理者権限を悪用して、私を好きな場所に移動させてください!**",
|
||||
"already_joined_title": "もうここにいる",
|
||||
"already_joined_description": "現在接続している音声チャンネルですでに (* ^ ω ^)"
|
||||
},
|
||||
"musicplayer_leave": {
|
||||
"success": "音声チャネルからの離脱に成功"
|
||||
},
|
||||
"musicplayer_loop": {
|
||||
"info": "現在のループモードは「{{MODE}}」です。",
|
||||
"valid_args": "使用可能なループモード: ``None`` ``Current``",
|
||||
"invalid": "ループモードが正しくない",
|
||||
"loop_set": "ループモードが「{{MODE}}」になりました。"
|
||||
},
|
||||
"musicplayer_pause": {
|
||||
"paused": "一時停止",
|
||||
"already_paused": "すでに一時停止中 (´。• ω •。`)"
|
||||
},
|
||||
"musicplayer_resume": {
|
||||
"resumed": "再開しました",
|
||||
"not_paused": "現在、音楽は一時停止していません (´。• ᵕ •。`)"
|
||||
},
|
||||
"musicplayer_play": {
|
||||
"title": "プレイ",
|
||||
"info": "曲を再生する",
|
||||
"valid_args": "``(検索クエリまたはリンク)``",
|
||||
"queue_added_song": "キューに曲を追加しました ヽ(>∀<☆)ノ",
|
||||
"queue_added_songs": "たくさんの曲をキューに追加しました ヽ(>∀<☆)ノ",
|
||||
"queue_added_songs_description": "キューに{{COUNT}}曲を追加",
|
||||
"error": "曲の検索中にエラーが発生"
|
||||
},
|
||||
"musicplayer_playmy": {
|
||||
"not_detected": "あなたの活動状況を見ると、現在、音楽を聴いていないようですね"
|
||||
},
|
||||
"musicplayer_queue": {
|
||||
"title": "キュー",
|
||||
"valid_args": "``Clear`` ``Shuffle``",
|
||||
"empty": "キューは空です! (っ˘ω˘ς )",
|
||||
"now_playing": "再生中",
|
||||
"upcoming_song": "次の曲",
|
||||
"looping_current": "(この曲の繰り返し)",
|
||||
"song_x_in_queue": "{{COUNT}}曲も並んでいますよ。",
|
||||
"cleared": "キューがクリアされました (。•ˇ‸ˇ•。)",
|
||||
"shuffled": "キューがシャッフルされました"
|
||||
},
|
||||
"musicplayer_search": {
|
||||
"title": "検索",
|
||||
"info": "楽曲を検索する",
|
||||
"valid_args": "``(検索クエリ)``",
|
||||
"title_result": "検索結果",
|
||||
"x_results_found": "{{COUNT}}件見つかりました。"
|
||||
},
|
||||
"musicplayer_skip": {
|
||||
"skipped": "スキップした",
|
||||
"skipped_last_song": "スキップした、それは最後の曲だった"
|
||||
},
|
||||
"settings": {
|
||||
"title": "設定",
|
||||
"description": "**{{{GUILD_NAME}}}**サーバでの{{BOT_NAME}}の動作変更",
|
||||
"valid_args": "``Prefix`` ``Language`` ``EnableServiceAnnouncement`` ``ServiceAnnouncementChannel``"
|
||||
},
|
||||
"settings_prefix": {
|
||||
"info": "現在の接頭辞は「{{{PREFIX}}}」です。",
|
||||
"info_description": "変更する新しいプレフィックスを提供する",
|
||||
"prefix_too_long": "プリフィックスが長すぎる",
|
||||
"prefix_too_long_description": "そんな情報まで覚えているんですか 😆",
|
||||
"prefix_is_mention": "プレフィックスを@メンションにすることはできません",
|
||||
"prefix_is_mention_description": "それはもう、私を@メンションすることで可能です。心配しないでください",
|
||||
"prefix_updated": "プレフィックスを更新",
|
||||
"prefix_updated_description": "これ以降、私は 「``{{{PREFIX}}}``」 を使って呼び出されることになります。"
|
||||
},
|
||||
"settings_language": {
|
||||
"info": "現在の言語は{{LANGUAGE}}です",
|
||||
"info_description": "変更する新しい言語を提供する\n**利用可能な言語**: ``{{LANGUAGES}}``",
|
||||
"language_invalid": "無効な言語",
|
||||
"language_invalid_description": "言語コードが無効であるか、まだサポートされていません",
|
||||
"language_updated": "言語が変更されました",
|
||||
"language_updated_description": "これからは{{LANGUAGE}}を使います"
|
||||
},
|
||||
"ping": {
|
||||
"title": "ネットワークパフォーマンス",
|
||||
"title_processing": "ネットワーク性能の測定 ( ◕▿◕ )",
|
||||
"running_on": "{{HOST}}で実行中",
|
||||
"development_environment": "開発環境"
|
||||
},
|
||||
"support": {
|
||||
"title": "サポート",
|
||||
"info": "[{{BOT_NAME}}のサポートサーバーに参加する]({{{LINK}}})",
|
||||
"not_available": "{{BOT_NAME}}のサポートサーバーは現在利用できません"
|
||||
}
|
||||
}
|
||||
|
||||
+171
-171
@@ -1,172 +1,172 @@
|
||||
{
|
||||
"common": {
|
||||
"available_args": "อาร์กิวเมนต์ ตัวเลือกที่ใช้ได้",
|
||||
"member_no_permissions": "คุณไม่มีสิทธิ์เข้าถึง (O_O;)",
|
||||
"member_no_permissions_description": "คุณต้องมีสิทธิ์เข้าถึง ``{{PERMISSIONS}}`` ในกิลด์นี้!",
|
||||
"bot_no_permissions": "ฉันไม่มีสิทธิ์เข้าถึง (O_O;)",
|
||||
"bot_no_permissions_description": "ฉันต้องการสิทธิ์เข้าถึง ``{{PERMISSIONS}}``",
|
||||
"processing": "รอแปปนึงน้า",
|
||||
"processing_description": "ฉันกำลังดำเนินการให้อยู่ (งᓀ‸ᓂ)ง"
|
||||
},
|
||||
"stats": {
|
||||
"title": "สถิติ",
|
||||
"info": "ข้อมูลสถิติของฉัน",
|
||||
"users": "ผู้ใช้",
|
||||
"x_servers": "{{COUNT}} เซิร์ฟเวอร์",
|
||||
"x_users": "{{COUNT}} ผู้ใช้",
|
||||
"uptime_since": "ออนไลน์ตั้งแต่",
|
||||
"server_uptime_x": "เซิร์ฟเวอร์ | {{{TIME}}}",
|
||||
"process_uptime_x": "โปรแกรม | {{{TIME}}}"
|
||||
},
|
||||
"userinfo": {
|
||||
"title": "ข้อมูลผู้ใช้",
|
||||
"info": "แสดงข้อมูลของผู้ใช้นั้น เช่นสถานะ กิจกรรมและอื่นๆ",
|
||||
"valid_args": "(``@กล่าวถึง หรือ ID ผู้ใช้``)",
|
||||
"user_not_found": "ไม่พบผู้ใช้รายนั้นนะ ลองตรวจสอบข้อมูลของคุณดูว่าถูกต้องรีป่าว",
|
||||
"online": "ออนไลน์",
|
||||
"idle": "ไม่อยู่",
|
||||
"dnd": "ห้ามรบกวน",
|
||||
"offline": "ออฟไลน์ได้เมื่อไม่นานนี้",
|
||||
"unknown": "ออฟไลน์ / ไม่ทราบ",
|
||||
"user_guild_info": "ข้อมูลในกิลด์นี้",
|
||||
"join_date_unknown": "ไม่ทราบวันที่เข้าร่วม",
|
||||
"join_date": "เข้าร่วมเมื่อ {{{TIME}}}",
|
||||
"guild_owner": "เจ้าของกิลด์นี้",
|
||||
"custom_status": "สถานะกำหนดเอง",
|
||||
"playing_x": "กำลังเล่น {{NAME}}",
|
||||
"streaming_x": "กำลังสตรีม {{NAME}}",
|
||||
"listening_x": "กำลังฟัง {{NAME}}",
|
||||
"watching_x": "กำลังดู {{NAME}}",
|
||||
"competing_x": "กำลังแข่งขัน {{NAME}}",
|
||||
"since": "ตั้งแต่ {{{TIME}}}",
|
||||
"end": "สิ้นสุดใน {{{TIME}}}"
|
||||
},
|
||||
"say": {
|
||||
"title": "สั่งพูด",
|
||||
"info": "สั่งให้ฉันพูดอะไรที่คุณต้องการ~",
|
||||
"valid_args": "``(ข้อความ)``",
|
||||
"success": "เรียบร้อย~ ฉันโพสต์ข้อความพร้อมเนื้อหาของคุณแล้วนะ",
|
||||
"error": "เกิดข้อผิดพลาดขณะพยายามโพสต์ข้อความพร้อมเนื้อหาของคุณ!"
|
||||
},
|
||||
"invite": {
|
||||
"title": "เชิญชวน",
|
||||
"info": "[เชิญ {{BOT_NAME}} เข้าสู่เซิร์ฟเวอร์ของคุณ!]({{{LINK}}})",
|
||||
"private": "ขณะนี้การเชิญของ {{BOT_NAME}} เป็นการเชิญแบบส่วนตัว เฉพาะนักพัฒนาเท่านั้นที่สามารถเพิ่มฉันไปยังเซิร์ฟเวอร์อื่นได้"
|
||||
},
|
||||
"help": {
|
||||
"title": "ช่วยเหลือ - {{BOT_NAME}}",
|
||||
"prefix_title": "คำนำหน้า",
|
||||
"prefix_description": "คุณสามารถเรียกฉันโดยใช้ ``{{{PREFIX}}}``, {{{PREFIX_MENTION}}} หรือ ``/สแลชคอมมานด์``",
|
||||
"available_commands": "คำสั่งที่ใช้ได้",
|
||||
"general": "ทั่วไป",
|
||||
"music": "ดนตรี",
|
||||
"games": "เกม",
|
||||
"admin": "สำหรับแอดมิน",
|
||||
"developer": "สำหรับนักพัฒนา",
|
||||
"footer": "สร้างด้วย 💖 และ [โอเพ่นซอร์ส]"
|
||||
},
|
||||
"musicplayer": {
|
||||
"now_playing": "กำลังเล่น",
|
||||
"now_playing_repeating": "กำลังเล่น (วนซ้ำเพลงนี้)",
|
||||
"no_music_playing": "ตอนนี้ไม่ได้มีเพลงเล่นอยู่ (ᴗ˳ᴗ);",
|
||||
"not_in_voice": "คุณต้องอยู่ในช่องเสียงก่อนน้า~",
|
||||
"different_voice_channel": "คุณไม่ได้อยู่ในช่องเสียงเดียวกันกับฉันนะ!",
|
||||
"track_error": "เกิดข้อผิดพลาดขณะเล่นเพลง กำลังข้ามแทร็กนี้"
|
||||
},
|
||||
"musicplayer_join": {
|
||||
"success": "เข้าร่วมช่องเสียงเรียบร้อยละ ฉันมาแล้ว~",
|
||||
"error": "ฉันไม่สามารถเข้าร่วมช่องเสียงได้",
|
||||
"disconnected": "ออกจากช่องเสียงแล้ว",
|
||||
"disconnected_reason_disconnected": "ฉันถูกตัดการเชื่อมต่อจากช่องเสียงนั้น",
|
||||
"in_use": "ฉันไม่สามารถเข้าร่วมหลายช่องเสียงในกิลด์เดียวกันได้\n แล้วก็ยังมีคนกำลังฟังเพลงในช่องเสียงที่ฉันอยู่ด้วย",
|
||||
"in_use_wait": "รอจนกว่าฉันจะเล่นเสร็จที่นั่น หรือฉันจะอยู่คนเดียวที่นั่น หรือที่ดีกว่านั้น เธอก็เข้าร่วมกับพวกนั้นเลยสิ!",
|
||||
"can_force_move": "\n\n**หรือ... แค่ใช้สิทธิ์ของแอดมิน(ในทางที่ผิด... รึป่าว) แล้วย้ายฉันไปยังที่ที่คุณต้องการเลย**",
|
||||
"already_joined_title": "ฉันก็อยู่ที่นี่แล้วนะ (* ^ ω ^)",
|
||||
"already_joined_description": "ฉันอยู่ในช่องเสียงเดียวกับคุณอยู่แล้วจ้า"
|
||||
},
|
||||
"musicplayer_leave": {
|
||||
"success": "ออกจากช่องเสียงเรียบร้อยแล้วละ แล้วเจอกันนะ!"
|
||||
},
|
||||
"musicplayer_loop": {
|
||||
"info": "โหมดวนซ้ำปัจจุบันคือ {{MODE}}",
|
||||
"valid_args": "โหมดวนซ้ำที่มี: ``None`` ``Current``",
|
||||
"invalid": "โหมดวนซ้ำไม่ถูกต้อง",
|
||||
"loop_set": "ตอนนี้ตั้งค่าโหมดวนซ้ำเป็น {{MODE}}"
|
||||
},
|
||||
"musicplayer_pause": {
|
||||
"paused": "หยุดเพลงชั่วคราวเรียบร้อย",
|
||||
"already_paused": "เพลงหยุดอยู่แล้วนะ (´。• ω •。`)"
|
||||
},
|
||||
"musicplayer_resume": {
|
||||
"resumed": "เล่นเพลงต่อเรียบร้อย",
|
||||
"not_paused": "เพลงไม่ได้หยุดอยู่แล้วนะ (´。• ᵕ •。`)"
|
||||
},
|
||||
"musicplayer_play": {
|
||||
"title": "เล่น",
|
||||
"info": "เล่นเพลง",
|
||||
"valid_args": "``(คำค้นหาหรือลิงก์)``",
|
||||
"queue_added_song": "เพิ่มเพลงเข้าคิวแล้ว! ヽ(>∀<☆)ノ",
|
||||
"queue_added_songs": "เพิ่มเพลงทั้งหมดเข้าคิวแล้ว! ヽ(>∀<☆)ノ",
|
||||
"queue_added_songs_description": "เพิ่ม {{COUNT}} เพลงในคิว",
|
||||
"error": "เกิดข้อผิดพลาดขณะค้นหาเพลง"
|
||||
},
|
||||
"musicplayer_playmy": {
|
||||
"not_detected": "เท่าที่ดูจากกิจกรรมของคุณ เหมือนว่าตอนนี้คุณไม่ได้เล่นเพลงอะไรอยู่นะ"
|
||||
},
|
||||
"musicplayer_queue": {
|
||||
"title": "คิวเพลง",
|
||||
"valid_args": "``Clear`` ``Shuffle``",
|
||||
"empty": "ตอนนี้คิวว่างนะ (っ˘ω˘ς )",
|
||||
"now_playing": "กำลังเล่น",
|
||||
"upcoming_song": "เพลงต่อไป",
|
||||
"looping_current": "(กำลังวนซ้ำเพลงนี้)",
|
||||
"song_x_in_queue": "ตอนนี้มี {{COUNT}} เพลงอยู่ในคิว!",
|
||||
"cleared": "เคลียร์คิวเรียบร้อยละ~ (。•ˇ‸ˇ•。)",
|
||||
"shuffled": "สุ่มคิวเรียบร้อยละ"
|
||||
},
|
||||
"musicplayer_search": {
|
||||
"title": "ค้นหา",
|
||||
"info": "ค้นหาเพลง",
|
||||
"valid_args": "``(คำค้นหา)``",
|
||||
"title_result": "ผลการค้นหา",
|
||||
"x_results_found": "พบผลลัพธ์ {{COUNT}} เพลง"
|
||||
},
|
||||
"musicplayer_skip": {
|
||||
"skipped": "ข้ามเพลงเรียบร้อยละ",
|
||||
"skipped_last_song": "ข้ามละ แล้วนั่นก็เป็นเพลงสุดท้ายด้วยนะ"
|
||||
},
|
||||
"settings": {
|
||||
"title": "การตั้งค่า",
|
||||
"description": "เปลี่ยนพฤติกรรมของ {{BOT_NAME}} บน **{{{GUILD_NAME}}}**",
|
||||
"valid_args": "``Prefix`` ``Language`` ``EnableServiceAnnouncement`` ``ServiceAnnouncementChannel``"
|
||||
},
|
||||
"settings_prefix": {
|
||||
"info": "คำนำหน้าปัจจุบันคือ {{{PREFIX}}}",
|
||||
"info_description": "ระบุคำนำหน้าใหม่เพื่อเปลี่ยน",
|
||||
"prefix_too_long": "คำนำหน้ายาวเกินไป",
|
||||
"prefix_too_long_description": "คุณจะจำมันได้หรอ 😆",
|
||||
"prefix_is_mention": "คำนำหน้าไม่สามารถเป็น @กล่าวถึง ของฉันได้",
|
||||
"prefix_is_mention_description": "คุณสามารถเรียกฉันด้วยการ @กล่าวถึง ฉันได้อยู่แล้วไม่ต้องห่วง",
|
||||
"prefix_updated": "อัปเดตคำนำหน้าแล้ว",
|
||||
"prefix_updated_description": "จากนี้ไป คุณสามารถเรียกฉันโดยใช้ ``{{{PREFIX}}}`` นะ"
|
||||
},
|
||||
"settings_language": {
|
||||
"info": "ภาษาปัจจุบันตอนนี้คือ {{LANGUAGE}}",
|
||||
"info_description": "ระบุภาษาใหม่เพื่อเปลี่ยน\n**ภาษาที่ใช้ได้**: ``{{LANGUAGES}}``",
|
||||
"language_invalid": "ภาษาไม่ถูกต้อง",
|
||||
"language_invalid_description": "รหัสภาษาไม่ถูกต้องหรือยังไม่รองรับ",
|
||||
"language_updated": "เปลี่ยนภาษาเรียบร้อย",
|
||||
"language_updated_description": "ตั้งแต่นี้ไปฉันจะใช้ภาษา {{LANGUAGE}}"
|
||||
},
|
||||
"ping": {
|
||||
"title": "ประสิทธิภาพของเครือข่าย",
|
||||
"title_processing": "กำลังวัดประสิทธิภาพของเครือข่าย ( ◕▿◕ )",
|
||||
"running_on": "ทำงานอยู่บน {{HOST}}",
|
||||
"development_environment": "โหมดกำลังพัฒนา"
|
||||
},
|
||||
"support": {
|
||||
"title": "ติดต่อฝ่ายสนับสนุน",
|
||||
"info": "[เข้าร่วมเซิร์ฟเวอร์สนับสนุนของ {{BOT_NAME}}]({{{LINK}}})",
|
||||
"not_available": "เซิร์ฟเวอร์สนับสนุนของ {{BOT_NAME}} ไม่พร้อมใช้งานในขณะนี้"
|
||||
}
|
||||
}
|
||||
"common": {
|
||||
"available_args": "อาร์กิวเมนต์ ตัวเลือกที่ใช้ได้",
|
||||
"member_no_permissions": "คุณไม่มีสิทธิ์เข้าถึง (O_O;)",
|
||||
"member_no_permissions_description": "คุณต้องมีสิทธิ์เข้าถึง ``{{PERMISSIONS}}`` ในกิลด์นี้!",
|
||||
"bot_no_permissions": "ฉันไม่มีสิทธิ์เข้าถึง (O_O;)",
|
||||
"bot_no_permissions_description": "ฉันต้องการสิทธิ์เข้าถึง ``{{PERMISSIONS}}``",
|
||||
"processing": "รอแปปนึงน้า",
|
||||
"processing_description": "ฉันกำลังดำเนินการให้อยู่ (งᓀ‸ᓂ)ง"
|
||||
},
|
||||
"stats": {
|
||||
"title": "สถิติ",
|
||||
"info": "ข้อมูลสถิติของฉัน",
|
||||
"users": "ผู้ใช้",
|
||||
"x_servers": "{{COUNT}} เซิร์ฟเวอร์",
|
||||
"x_users": "{{COUNT}} ผู้ใช้",
|
||||
"uptime_since": "ออนไลน์ตั้งแต่",
|
||||
"server_uptime_x": "เซิร์ฟเวอร์ | {{{TIME}}}",
|
||||
"process_uptime_x": "โปรแกรม | {{{TIME}}}"
|
||||
},
|
||||
"userinfo": {
|
||||
"title": "ข้อมูลผู้ใช้",
|
||||
"info": "แสดงข้อมูลของผู้ใช้นั้น เช่นสถานะ กิจกรรมและอื่นๆ",
|
||||
"valid_args": "(``@กล่าวถึง หรือ ID ผู้ใช้``)",
|
||||
"user_not_found": "ไม่พบผู้ใช้รายนั้นนะ ลองตรวจสอบข้อมูลของคุณดูว่าถูกต้องรีป่าว",
|
||||
"online": "ออนไลน์",
|
||||
"idle": "ไม่อยู่",
|
||||
"dnd": "ห้ามรบกวน",
|
||||
"offline": "ออฟไลน์ได้เมื่อไม่นานนี้",
|
||||
"unknown": "ออฟไลน์ / ไม่ทราบ",
|
||||
"user_guild_info": "ข้อมูลในกิลด์นี้",
|
||||
"join_date_unknown": "ไม่ทราบวันที่เข้าร่วม",
|
||||
"join_date": "เข้าร่วมเมื่อ {{{TIME}}}",
|
||||
"guild_owner": "เจ้าของกิลด์นี้",
|
||||
"custom_status": "สถานะกำหนดเอง",
|
||||
"playing_x": "กำลังเล่น {{NAME}}",
|
||||
"streaming_x": "กำลังสตรีม {{NAME}}",
|
||||
"listening_x": "กำลังฟัง {{NAME}}",
|
||||
"watching_x": "กำลังดู {{NAME}}",
|
||||
"competing_x": "กำลังแข่งขัน {{NAME}}",
|
||||
"since": "ตั้งแต่ {{{TIME}}}",
|
||||
"end": "สิ้นสุดใน {{{TIME}}}"
|
||||
},
|
||||
"say": {
|
||||
"title": "สั่งพูด",
|
||||
"info": "สั่งให้ฉันพูดอะไรที่คุณต้องการ~",
|
||||
"valid_args": "``(ข้อความ)``",
|
||||
"success": "เรียบร้อย~ ฉันโพสต์ข้อความพร้อมเนื้อหาของคุณแล้วนะ",
|
||||
"error": "เกิดข้อผิดพลาดขณะพยายามโพสต์ข้อความพร้อมเนื้อหาของคุณ!"
|
||||
},
|
||||
"invite": {
|
||||
"title": "เชิญชวน",
|
||||
"info": "[เชิญ {{BOT_NAME}} เข้าสู่เซิร์ฟเวอร์ของคุณ!]({{{LINK}}})",
|
||||
"private": "ขณะนี้การเชิญของ {{BOT_NAME}} เป็นการเชิญแบบส่วนตัว เฉพาะนักพัฒนาเท่านั้นที่สามารถเพิ่มฉันไปยังเซิร์ฟเวอร์อื่นได้"
|
||||
},
|
||||
"help": {
|
||||
"title": "ช่วยเหลือ - {{BOT_NAME}}",
|
||||
"prefix_title": "คำนำหน้า",
|
||||
"prefix_description": "คุณสามารถเรียกฉันโดยใช้ ``{{{PREFIX}}}``, {{{PREFIX_MENTION}}} หรือ ``/สแลชคอมมานด์``",
|
||||
"available_commands": "คำสั่งที่ใช้ได้",
|
||||
"general": "ทั่วไป",
|
||||
"music": "ดนตรี",
|
||||
"games": "เกม",
|
||||
"admin": "สำหรับแอดมิน",
|
||||
"developer": "สำหรับนักพัฒนา",
|
||||
"footer": "สร้างด้วย 💖 และ [โอเพ่นซอร์ส]"
|
||||
},
|
||||
"musicplayer": {
|
||||
"now_playing": "กำลังเล่น",
|
||||
"now_playing_repeating": "กำลังเล่น (วนซ้ำเพลงนี้)",
|
||||
"no_music_playing": "ตอนนี้ไม่ได้มีเพลงเล่นอยู่ (ᴗ˳ᴗ);",
|
||||
"not_in_voice": "คุณต้องอยู่ในช่องเสียงก่อนน้า~",
|
||||
"different_voice_channel": "คุณไม่ได้อยู่ในช่องเสียงเดียวกันกับฉันนะ!",
|
||||
"track_error": "เกิดข้อผิดพลาดขณะเล่นเพลง กำลังข้ามแทร็กนี้"
|
||||
},
|
||||
"musicplayer_join": {
|
||||
"success": "เข้าร่วมช่องเสียงเรียบร้อยละ ฉันมาแล้ว~",
|
||||
"error": "ฉันไม่สามารถเข้าร่วมช่องเสียงได้",
|
||||
"disconnected": "ออกจากช่องเสียงแล้ว",
|
||||
"disconnected_reason_disconnected": "ฉันถูกตัดการเชื่อมต่อจากช่องเสียงนั้น",
|
||||
"in_use": "ฉันไม่สามารถเข้าร่วมหลายช่องเสียงในกิลด์เดียวกันได้\n แล้วก็ยังมีคนกำลังฟังเพลงในช่องเสียงที่ฉันอยู่ด้วย",
|
||||
"in_use_wait": "รอจนกว่าฉันจะเล่นเสร็จที่นั่น หรือฉันจะอยู่คนเดียวที่นั่น หรือที่ดีกว่านั้น เธอก็เข้าร่วมกับพวกนั้นเลยสิ!",
|
||||
"can_force_move": "\n\n**หรือ... แค่ใช้สิทธิ์ของแอดมิน(ในทางที่ผิด... รึป่าว) แล้วย้ายฉันไปยังที่ที่คุณต้องการเลย**",
|
||||
"already_joined_title": "ฉันก็อยู่ที่นี่แล้วนะ (* ^ ω ^)",
|
||||
"already_joined_description": "ฉันอยู่ในช่องเสียงเดียวกับคุณอยู่แล้วจ้า"
|
||||
},
|
||||
"musicplayer_leave": {
|
||||
"success": "ออกจากช่องเสียงเรียบร้อยแล้วละ แล้วเจอกันนะ!"
|
||||
},
|
||||
"musicplayer_loop": {
|
||||
"info": "โหมดวนซ้ำปัจจุบันคือ {{MODE}}",
|
||||
"valid_args": "โหมดวนซ้ำที่มี: ``None`` ``Current``",
|
||||
"invalid": "โหมดวนซ้ำไม่ถูกต้อง",
|
||||
"loop_set": "ตอนนี้ตั้งค่าโหมดวนซ้ำเป็น {{MODE}}"
|
||||
},
|
||||
"musicplayer_pause": {
|
||||
"paused": "หยุดเพลงชั่วคราวเรียบร้อย",
|
||||
"already_paused": "เพลงหยุดอยู่แล้วนะ (´。• ω •。`)"
|
||||
},
|
||||
"musicplayer_resume": {
|
||||
"resumed": "เล่นเพลงต่อเรียบร้อย",
|
||||
"not_paused": "เพลงไม่ได้หยุดอยู่แล้วนะ (´。• ᵕ •。`)"
|
||||
},
|
||||
"musicplayer_play": {
|
||||
"title": "เล่น",
|
||||
"info": "เล่นเพลง",
|
||||
"valid_args": "``(คำค้นหาหรือลิงก์)``",
|
||||
"queue_added_song": "เพิ่มเพลงเข้าคิวแล้ว! ヽ(>∀<☆)ノ",
|
||||
"queue_added_songs": "เพิ่มเพลงทั้งหมดเข้าคิวแล้ว! ヽ(>∀<☆)ノ",
|
||||
"queue_added_songs_description": "เพิ่ม {{COUNT}} เพลงในคิว",
|
||||
"error": "เกิดข้อผิดพลาดขณะค้นหาเพลง"
|
||||
},
|
||||
"musicplayer_playmy": {
|
||||
"not_detected": "เท่าที่ดูจากกิจกรรมของคุณ เหมือนว่าตอนนี้คุณไม่ได้เล่นเพลงอะไรอยู่นะ"
|
||||
},
|
||||
"musicplayer_queue": {
|
||||
"title": "คิวเพลง",
|
||||
"valid_args": "``Clear`` ``Shuffle``",
|
||||
"empty": "ตอนนี้คิวว่างนะ (っ˘ω˘ς )",
|
||||
"now_playing": "กำลังเล่น",
|
||||
"upcoming_song": "เพลงต่อไป",
|
||||
"looping_current": "(กำลังวนซ้ำเพลงนี้)",
|
||||
"song_x_in_queue": "ตอนนี้มี {{COUNT}} เพลงอยู่ในคิว!",
|
||||
"cleared": "เคลียร์คิวเรียบร้อยละ~ (。•ˇ‸ˇ•。)",
|
||||
"shuffled": "สุ่มคิวเรียบร้อยละ"
|
||||
},
|
||||
"musicplayer_search": {
|
||||
"title": "ค้นหา",
|
||||
"info": "ค้นหาเพลง",
|
||||
"valid_args": "``(คำค้นหา)``",
|
||||
"title_result": "ผลการค้นหา",
|
||||
"x_results_found": "พบผลลัพธ์ {{COUNT}} เพลง"
|
||||
},
|
||||
"musicplayer_skip": {
|
||||
"skipped": "ข้ามเพลงเรียบร้อยละ",
|
||||
"skipped_last_song": "ข้ามละ แล้วนั่นก็เป็นเพลงสุดท้ายด้วยนะ"
|
||||
},
|
||||
"settings": {
|
||||
"title": "การตั้งค่า",
|
||||
"description": "เปลี่ยนพฤติกรรมของ {{BOT_NAME}} บน **{{{GUILD_NAME}}}**",
|
||||
"valid_args": "``Prefix`` ``Language`` ``EnableServiceAnnouncement`` ``ServiceAnnouncementChannel``"
|
||||
},
|
||||
"settings_prefix": {
|
||||
"info": "คำนำหน้าปัจจุบันคือ {{{PREFIX}}}",
|
||||
"info_description": "ระบุคำนำหน้าใหม่เพื่อเปลี่ยน",
|
||||
"prefix_too_long": "คำนำหน้ายาวเกินไป",
|
||||
"prefix_too_long_description": "คุณจะจำมันได้หรอ 😆",
|
||||
"prefix_is_mention": "คำนำหน้าไม่สามารถเป็น @กล่าวถึง ของฉันได้",
|
||||
"prefix_is_mention_description": "คุณสามารถเรียกฉันด้วยการ @กล่าวถึง ฉันได้อยู่แล้วไม่ต้องห่วง",
|
||||
"prefix_updated": "อัปเดตคำนำหน้าแล้ว",
|
||||
"prefix_updated_description": "จากนี้ไป คุณสามารถเรียกฉันโดยใช้ ``{{{PREFIX}}}`` นะ"
|
||||
},
|
||||
"settings_language": {
|
||||
"info": "ภาษาปัจจุบันตอนนี้คือ {{LANGUAGE}}",
|
||||
"info_description": "ระบุภาษาใหม่เพื่อเปลี่ยน\n**ภาษาที่ใช้ได้**: ``{{LANGUAGES}}``",
|
||||
"language_invalid": "ภาษาไม่ถูกต้อง",
|
||||
"language_invalid_description": "รหัสภาษาไม่ถูกต้องหรือยังไม่รองรับ",
|
||||
"language_updated": "เปลี่ยนภาษาเรียบร้อย",
|
||||
"language_updated_description": "ตั้งแต่นี้ไปฉันจะใช้ภาษา {{LANGUAGE}}"
|
||||
},
|
||||
"ping": {
|
||||
"title": "ประสิทธิภาพของเครือข่าย",
|
||||
"title_processing": "กำลังวัดประสิทธิภาพของเครือข่าย ( ◕▿◕ )",
|
||||
"running_on": "ทำงานอยู่บน {{HOST}}",
|
||||
"development_environment": "โหมดกำลังพัฒนา"
|
||||
},
|
||||
"support": {
|
||||
"title": "ติดต่อฝ่ายสนับสนุน",
|
||||
"info": "[เข้าร่วมเซิร์ฟเวอร์สนับสนุนของ {{BOT_NAME}}]({{{LINK}}})",
|
||||
"not_available": "เซิร์ฟเวอร์สนับสนุนของ {{BOT_NAME}} ไม่พร้อมใช้งานในขณะนี้"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +1,24 @@
|
||||
import HTTP_STATUS from "../../../libs/HTTPStatus";
|
||||
import Environment from "../../../providers/Environment";
|
||||
import App from "../../../providers/App";
|
||||
import HTTP_STATUS from '../../../libs/HTTPStatus';
|
||||
import Environment from '../../../providers/Environment';
|
||||
import App from '../../../providers/App';
|
||||
|
||||
class HealthCheck {
|
||||
public static async perform(req: any, res: any, next: any) {
|
||||
Promise.resolve().then(async () => {
|
||||
return res.status(HTTP_STATUS.OK).json({
|
||||
status: "OK",
|
||||
environment: Environment.get().NODE_ENV,
|
||||
version: App.versionNumber,
|
||||
uptime: process.uptime(),
|
||||
memoryUsage: process.memoryUsage(),
|
||||
cpuUsage: process.cpuUsage(),
|
||||
pid: process.pid,
|
||||
ppid: process.ppid
|
||||
});
|
||||
}).catch(next);
|
||||
Promise.resolve()
|
||||
.then(async () => {
|
||||
return res.status(HTTP_STATUS.OK).json({
|
||||
status: 'OK',
|
||||
environment: Environment.get().NODE_ENV,
|
||||
version: App.versionNumber,
|
||||
uptime: process.uptime(),
|
||||
memoryUsage: process.memoryUsage(),
|
||||
cpuUsage: process.cpuUsage(),
|
||||
pid: process.pid,
|
||||
ppid: process.ppid
|
||||
});
|
||||
})
|
||||
.catch(next);
|
||||
}
|
||||
}
|
||||
|
||||
export default HealthCheck;
|
||||
export default HealthCheck;
|
||||
|
||||
@@ -9,11 +9,7 @@ import {
|
||||
} from 'discord.js';
|
||||
|
||||
import DiscordModule, { HybridInteractionMessage } from '../../utils/DiscordModule';
|
||||
import {
|
||||
makeInfoEmbed,
|
||||
makeErrorEmbed,
|
||||
sendHybridInteractionMessageResponse
|
||||
} from '../../utils/DiscordMessage';
|
||||
import { makeInfoEmbed, makeErrorEmbed, sendHybridInteractionMessageResponse } from '../../utils/DiscordMessage';
|
||||
|
||||
import DiscordMusicPlayer from '../../providers/DiscordMusicPlayer';
|
||||
import Users from '../../services/Users';
|
||||
@@ -140,34 +136,26 @@ export default class Debug extends DiscordModule {
|
||||
},
|
||||
activeMusicPlayer: async (data: HybridInteractionMessage) => {
|
||||
await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [
|
||||
EMBEDS.ACTIVE_MUSIC_PLAYERS(data, DiscordMusicPlayer.GuildQueue)
|
||||
]
|
||||
embeds: [EMBEDS.ACTIVE_MUSIC_PLAYERS(data, DiscordMusicPlayer.GuildQueue)]
|
||||
});
|
||||
},
|
||||
myData: async (data: HybridInteractionMessage) => {
|
||||
const userData = await Cache.getCachedUser(user.id);
|
||||
await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [
|
||||
EMBEDS.YOUR_USER_DATA(data, userData)
|
||||
]
|
||||
embeds: [EMBEDS.YOUR_USER_DATA(data, userData)]
|
||||
});
|
||||
},
|
||||
guildData: async (data: HybridInteractionMessage) => {
|
||||
const guildData = await Cache.getCachedGuild(guild.id);
|
||||
await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [
|
||||
EMBEDS.GUILD_DATA(data, guildData)
|
||||
]
|
||||
embeds: [EMBEDS.GUILD_DATA(data, guildData)]
|
||||
});
|
||||
},
|
||||
invalidInteraction: async (data: HybridInteractionMessage) => {
|
||||
const row = new ActionRowBuilder<ButtonBuilder>().addComponents([
|
||||
new ButtonBuilder()
|
||||
.setEmoji('😥')
|
||||
.setLabel(
|
||||
' Make invalid interaction (Wait 7 seconds, check error in console or logs)'
|
||||
)
|
||||
.setLabel(' Make invalid interaction (Wait 7 seconds, check error in console or logs)')
|
||||
.setCustomId('dev_make_invalid_interaction')
|
||||
.setStyle(ButtonStyle.Primary)
|
||||
]);
|
||||
|
||||
@@ -53,17 +53,14 @@ const EMBEDS = {
|
||||
|
||||
if (!payload.timestamp) payload.timestamp = Date.now();
|
||||
|
||||
if (payload.thumbnail?.url === 'bot_avatar')
|
||||
payload.thumbnail.url = `${user?.displayAvatarURL()}?size=4096`;
|
||||
if (payload.thumbnail?.url === 'bot_avatar') payload.thumbnail.url = `${user?.displayAvatarURL()}?size=4096`;
|
||||
|
||||
if (payload.image?.url === 'bot_avatar')
|
||||
payload.image.url = `${user?.displayAvatarURL()}?size=4096`;
|
||||
if (payload.image?.url === 'bot_avatar') payload.image.url = `${user?.displayAvatarURL()}?size=4096`;
|
||||
|
||||
if (payload.description)
|
||||
payload.description = payload.description.replaceAll('{bot_username}', user?.username!);
|
||||
|
||||
if (payload.color && isNaN(payload.color))
|
||||
payload.color = hexToDecimal(payload.color.toString());
|
||||
if (payload.color && isNaN(payload.color)) payload.color = hexToDecimal(payload.color.toString());
|
||||
|
||||
return new EmbedBuilder(payload);
|
||||
},
|
||||
@@ -145,9 +142,7 @@ export default class ServiceAnnouncement extends DiscordModule {
|
||||
async Init() {
|
||||
if (fs.existsSync(path.join(process.cwd(), 'configs/ServiceAnnouncement.json'))) {
|
||||
try {
|
||||
const rawData = fs.readFileSync(
|
||||
path.join(process.cwd(), 'configs/ServiceAnnouncement.json')
|
||||
);
|
||||
const rawData = fs.readFileSync(path.join(process.cwd(), 'configs/ServiceAnnouncement.json'));
|
||||
const jsonData = JSON.parse(rawData.toString());
|
||||
Announcements = jsonData;
|
||||
} catch (err) {
|
||||
@@ -177,9 +172,7 @@ export default class ServiceAnnouncement extends DiscordModule {
|
||||
reload: async (data: HybridInteractionMessage) => {
|
||||
if (fs.existsSync(path.join(process.cwd(), 'configs/ServiceAnnouncement.json'))) {
|
||||
try {
|
||||
const rawData = fs.readFileSync(
|
||||
path.join(process.cwd(), 'configs/ServiceAnnouncement.json')
|
||||
);
|
||||
const rawData = fs.readFileSync(path.join(process.cwd(), 'configs/ServiceAnnouncement.json'));
|
||||
const jsonData = JSON.parse(rawData.toString());
|
||||
Announcements = jsonData;
|
||||
} catch (err: any) {
|
||||
@@ -264,9 +257,7 @@ export default class ServiceAnnouncement extends DiscordModule {
|
||||
let Guild: Guild = element[0];
|
||||
let Channel: TextChannel = element[1];
|
||||
try {
|
||||
const guildObject = DiscordProvider.client.guilds.cache.get(
|
||||
Guild.id
|
||||
);
|
||||
const guildObject = DiscordProvider.client.guilds.cache.get(Guild.id);
|
||||
if (!guildObject) throw new Error('Guild not found');
|
||||
Logger.info(
|
||||
`Sending Service Announcement to ${guildObject?.name} (${guildObject.id}) #${Channel.name} (${Channel.id})`
|
||||
@@ -276,9 +267,7 @@ export default class ServiceAnnouncement extends DiscordModule {
|
||||
});
|
||||
} catch (err) {
|
||||
withError = true;
|
||||
const guildObject = DiscordProvider.client.guilds.cache.get(
|
||||
Guild.id
|
||||
);
|
||||
const guildObject = DiscordProvider.client.guilds.cache.get(Guild.id);
|
||||
if (guildObject)
|
||||
Logger.info(
|
||||
`Unable to send Service Announcement to ${guildObject?.name} (${guildObject.id}) #${Channel.name} (${Channel.id})`
|
||||
@@ -296,28 +285,20 @@ export default class ServiceAnnouncement extends DiscordModule {
|
||||
|
||||
if (withError) {
|
||||
if (data && data.isMessage() && placeholder && placeholder.isMessage())
|
||||
return placeholder
|
||||
.getMessage()
|
||||
.edit({
|
||||
embeds: [
|
||||
EMBEDS.SERVICE_ANNOUNCEMENT_SENT_WITH_ERRORS(data)
|
||||
]
|
||||
});
|
||||
return placeholder.getMessage().edit({
|
||||
embeds: [EMBEDS.SERVICE_ANNOUNCEMENT_SENT_WITH_ERRORS(data)]
|
||||
});
|
||||
else if (data.isApplicationCommand())
|
||||
return await sendHybridInteractionMessageResponse(
|
||||
data,
|
||||
{
|
||||
embeds: [
|
||||
EMBEDS.SERVICE_ANNOUNCEMENT_SENT_WITH_ERRORS(data)
|
||||
]
|
||||
embeds: [EMBEDS.SERVICE_ANNOUNCEMENT_SENT_WITH_ERRORS(data)]
|
||||
},
|
||||
true
|
||||
);
|
||||
} else {
|
||||
if (data && data.isMessage() && placeholder && placeholder.isMessage())
|
||||
return placeholder
|
||||
.getMessage()
|
||||
.edit({ embeds: [EMBEDS.SERVICE_ANNOUNCEMENT_SENT(data)] });
|
||||
return placeholder.getMessage().edit({ embeds: [EMBEDS.SERVICE_ANNOUNCEMENT_SENT(data)] });
|
||||
else if (data.isApplicationCommand())
|
||||
return await sendHybridInteractionMessageResponse(
|
||||
data,
|
||||
|
||||
+4
-4
@@ -17,10 +17,10 @@ const EMBEDS = {
|
||||
let _e = makeInfoEmbed({
|
||||
icon: '💌',
|
||||
title: locale.__('help.title', { BOT_NAME: bot.username }),
|
||||
description: `\u200b\n🏷️ **${locale.__('help.prefix_title')}**\n${locale.__(
|
||||
'help.prefix_description',
|
||||
{PREFIX: prefix.replaceAll('`', '`'), PREFIX_MENTION: `<@${bot.id}>`}
|
||||
)}\n\n💻 **${locale.__('help.available_commands')}**`,
|
||||
description: `\u200b\n🏷️ **${locale.__('help.prefix_title')}**\n${locale.__('help.prefix_description', {
|
||||
PREFIX: prefix.replaceAll('`', '`'),
|
||||
PREFIX_MENTION: `<@${bot.id}>`
|
||||
})}\n\n💻 **${locale.__('help.available_commands')}**`,
|
||||
fields: [
|
||||
{
|
||||
name: `☕ ${locale.__('help.general')}`,
|
||||
|
||||
@@ -108,9 +108,7 @@ export default class InteractionManager extends DiscordModule {
|
||||
await unregisterAllGuildsCommands();
|
||||
|
||||
if (data && data.isMessage() && placeholder && placeholder.isMessage())
|
||||
return placeholder
|
||||
.getMessage()
|
||||
.edit({ embeds: [EMBEDS.UNLOADALL_SUCCESS(data)] });
|
||||
return placeholder.getMessage().edit({ embeds: [EMBEDS.UNLOADALL_SUCCESS(data)] });
|
||||
else if (data.isApplicationCommand())
|
||||
return await sendHybridInteractionMessageResponse(
|
||||
data,
|
||||
@@ -119,9 +117,7 @@ export default class InteractionManager extends DiscordModule {
|
||||
);
|
||||
} catch (err) {
|
||||
if (data && data.isMessage() && placeholder && placeholder.isMessage())
|
||||
return placeholder
|
||||
.getMessage()
|
||||
.edit({ embeds: [EMBEDS.UNLOADALL_ERROR(data, err)] });
|
||||
return placeholder.getMessage().edit({ embeds: [EMBEDS.UNLOADALL_ERROR(data, err)] });
|
||||
else if (data.isApplicationCommand())
|
||||
return await sendHybridInteractionMessageResponse(
|
||||
data,
|
||||
@@ -143,9 +139,7 @@ export default class InteractionManager extends DiscordModule {
|
||||
await registerAllGlobalCommands();
|
||||
|
||||
if (data && data.isMessage() && placeholder && placeholder.isMessage())
|
||||
return placeholder
|
||||
.getMessage()
|
||||
.edit({ embeds: [EMBEDS.RELOADALL_SUCCESS(data)] });
|
||||
return placeholder.getMessage().edit({ embeds: [EMBEDS.RELOADALL_SUCCESS(data)] });
|
||||
else if (data.isApplicationCommand())
|
||||
return await sendHybridInteractionMessageResponse(
|
||||
data,
|
||||
@@ -154,9 +148,7 @@ export default class InteractionManager extends DiscordModule {
|
||||
);
|
||||
} catch (err) {
|
||||
if (data && data.isMessage() && placeholder && placeholder.isMessage())
|
||||
return placeholder
|
||||
.getMessage()
|
||||
.edit({ embeds: [EMBEDS.RELOADALL_ERROR(data, err)] });
|
||||
return placeholder.getMessage().edit({ embeds: [EMBEDS.RELOADALL_ERROR(data, err)] });
|
||||
else if (data.isApplicationCommand())
|
||||
return await sendHybridInteractionMessageResponse(
|
||||
data,
|
||||
@@ -178,9 +170,7 @@ export default class InteractionManager extends DiscordModule {
|
||||
await registerAllGuildsCommands();
|
||||
|
||||
if (data && data.isMessage() && placeholder && placeholder.isMessage())
|
||||
return placeholder
|
||||
.getMessage()
|
||||
.edit({ embeds: [EMBEDS.RELOADALL_SUCCESS(data)] });
|
||||
return placeholder.getMessage().edit({ embeds: [EMBEDS.RELOADALL_SUCCESS(data)] });
|
||||
else if (data.isApplicationCommand())
|
||||
return await sendHybridInteractionMessageResponse(
|
||||
data,
|
||||
@@ -189,9 +179,7 @@ export default class InteractionManager extends DiscordModule {
|
||||
);
|
||||
} catch (err) {
|
||||
if (data && data.isMessage() && placeholder && placeholder.isMessage())
|
||||
return placeholder
|
||||
.getMessage()
|
||||
.edit({ embeds: [EMBEDS.RELOADALL_ERROR(data, err)] });
|
||||
return placeholder.getMessage().edit({ embeds: [EMBEDS.RELOADALL_ERROR(data, err)] });
|
||||
else if (data.isApplicationCommand())
|
||||
return await sendHybridInteractionMessageResponse(
|
||||
data,
|
||||
|
||||
@@ -21,7 +21,7 @@ const EMBEDS = {
|
||||
|
||||
return makeInfoEmbed({
|
||||
title: `Invite`,
|
||||
description: message || locale.__('invite.private', { BOT_NAME: DiscordProvider.client.user!.username}),
|
||||
description: message || locale.__('invite.private', { BOT_NAME: DiscordProvider.client.user!.username }),
|
||||
user
|
||||
});
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
PermissionsBitField,
|
||||
EmbedBuilder,
|
||||
ButtonStyle,
|
||||
ActionRowBuilder,
|
||||
ActionRowBuilder
|
||||
} from 'discord.js';
|
||||
|
||||
import DiscordProvider from '../providers/Discord';
|
||||
@@ -114,16 +114,14 @@ const EMBEDS = {
|
||||
MANAGED_ROLE: (data: Message | BaseInteraction, role: Role) => {
|
||||
return makeErrorEmbed({
|
||||
title: 'You cannot use this role',
|
||||
description:
|
||||
'``' + role.name + '``' + ' is managed by external service and cannot be used',
|
||||
description: '``' + role.name + '``' + ' is managed by external service and cannot be used',
|
||||
user: data instanceof BaseInteraction ? data.user : data.author
|
||||
});
|
||||
},
|
||||
CONFIGURED_ROLE: (data: Message | BaseInteraction, role: Role) => {
|
||||
return makeSuccessEmbed({
|
||||
title: 'Configured Membership Screening Role',
|
||||
description:
|
||||
'New member will be given a ' + '``' + role.name + '``' + ' role after approval',
|
||||
description: 'New member will be given a ' + '``' + role.name + '``' + ' role after approval',
|
||||
user: data instanceof BaseInteraction ? data.user : data.author
|
||||
});
|
||||
},
|
||||
@@ -146,17 +144,10 @@ const EMBEDS = {
|
||||
user: data instanceof BaseInteraction ? data.user : data.author
|
||||
});
|
||||
},
|
||||
INVALID_CHANNEL_THREAD: (
|
||||
data: Message | BaseInteraction,
|
||||
channel: GuildChannel | ThreadChannel
|
||||
) => {
|
||||
INVALID_CHANNEL_THREAD: (data: Message | BaseInteraction, channel: GuildChannel | ThreadChannel) => {
|
||||
return makeErrorEmbed({
|
||||
title: 'Thread channel is not supported',
|
||||
description:
|
||||
'``' +
|
||||
channel.name +
|
||||
'``' +
|
||||
' is a thread channel. Please use a regular text channel',
|
||||
description: '``' + channel.name + '``' + ' is a thread channel. Please use a regular text channel',
|
||||
user: data instanceof BaseInteraction ? data.user : data.author
|
||||
});
|
||||
},
|
||||
@@ -225,11 +216,7 @@ export default class MembershipScreening extends DiscordModule {
|
||||
if (!this.isJsonValid(interaction.customId)) return;
|
||||
const payload = JSON.parse(interaction.customId);
|
||||
|
||||
if (
|
||||
typeof payload.m === 'undefined' ||
|
||||
typeof payload.a === 'undefined' ||
|
||||
payload.m !== 'MembershipScreening'
|
||||
)
|
||||
if (typeof payload.m === 'undefined' || typeof payload.a === 'undefined' || payload.m !== 'MembershipScreening')
|
||||
return;
|
||||
|
||||
const message = await channel.messages.fetch(interaction.message.id);
|
||||
@@ -261,9 +248,7 @@ export default class MembershipScreening extends DiscordModule {
|
||||
const role = (await guild.roles.fetch()).find(
|
||||
(role) => role.id === PrismaGuild.MembershipScreening_GivenRole
|
||||
);
|
||||
const requesterMember = (await guild.members.fetch()).find(
|
||||
(member) => member.id === payload.d.requester
|
||||
);
|
||||
const requesterMember = (await guild.members.fetch()).find((member) => member.id === payload.d.requester);
|
||||
|
||||
if (!role)
|
||||
return await interaction.reply({
|
||||
@@ -466,7 +451,8 @@ export default class MembershipScreening extends DiscordModule {
|
||||
});
|
||||
|
||||
if (
|
||||
!guild.members.me?.permissionsIn(TargetChannel)
|
||||
!guild.members.me
|
||||
?.permissionsIn(TargetChannel)
|
||||
.has([PermissionsBitField.Flags.SendMessages, PermissionsBitField.Flags.ViewChannel])
|
||||
)
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
@@ -556,58 +542,54 @@ export default class MembershipScreening extends DiscordModule {
|
||||
fields: [
|
||||
{
|
||||
name: 'Account Information',
|
||||
value: `Account age: <t:${Math.round(
|
||||
member.user.createdAt.getTime() / 1000
|
||||
)}:R>`
|
||||
value: `Account age: <t:${Math.round(member.user.createdAt.getTime() / 1000)}:R>`
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
embed.setThumbnail(`${member.user.displayAvatarURL()}?size=4096`);
|
||||
|
||||
const row = new ActionRowBuilder<ButtonBuilder>()
|
||||
.addComponents([
|
||||
new ButtonBuilder()
|
||||
.setCustomId(
|
||||
JSON.stringify({
|
||||
m: 'MembershipScreening',
|
||||
a: 'approve',
|
||||
d: {
|
||||
requester: member.id
|
||||
}
|
||||
})
|
||||
)
|
||||
.setEmoji('✅')
|
||||
.setLabel(' Approve')
|
||||
.setStyle(ButtonStyle.Success),
|
||||
new ButtonBuilder()
|
||||
.setCustomId(
|
||||
JSON.stringify({
|
||||
m: 'MembershipScreening',
|
||||
a: 'deny',
|
||||
d: {
|
||||
requester: member.id
|
||||
}
|
||||
})
|
||||
)
|
||||
.setEmoji('⛔')
|
||||
.setLabel(' Deny and kick')
|
||||
.setStyle(ButtonStyle.Danger),
|
||||
new ButtonBuilder()
|
||||
.setCustomId(
|
||||
JSON.stringify({
|
||||
m: 'MembershipScreening',
|
||||
a: 'ban',
|
||||
d: {
|
||||
requester: member.id
|
||||
}
|
||||
})
|
||||
)
|
||||
.setEmoji('🔪')
|
||||
.setLabel(' Vision Hunt Decree (Ban)')
|
||||
.setStyle(ButtonStyle.Danger)
|
||||
]
|
||||
);
|
||||
const row = new ActionRowBuilder<ButtonBuilder>().addComponents([
|
||||
new ButtonBuilder()
|
||||
.setCustomId(
|
||||
JSON.stringify({
|
||||
m: 'MembershipScreening',
|
||||
a: 'approve',
|
||||
d: {
|
||||
requester: member.id
|
||||
}
|
||||
})
|
||||
)
|
||||
.setEmoji('✅')
|
||||
.setLabel(' Approve')
|
||||
.setStyle(ButtonStyle.Success),
|
||||
new ButtonBuilder()
|
||||
.setCustomId(
|
||||
JSON.stringify({
|
||||
m: 'MembershipScreening',
|
||||
a: 'deny',
|
||||
d: {
|
||||
requester: member.id
|
||||
}
|
||||
})
|
||||
)
|
||||
.setEmoji('⛔')
|
||||
.setLabel(' Deny and kick')
|
||||
.setStyle(ButtonStyle.Danger),
|
||||
new ButtonBuilder()
|
||||
.setCustomId(
|
||||
JSON.stringify({
|
||||
m: 'MembershipScreening',
|
||||
a: 'ban',
|
||||
d: {
|
||||
requester: member.id
|
||||
}
|
||||
})
|
||||
)
|
||||
.setEmoji('🔪')
|
||||
.setLabel(' Vision Hunt Decree (Ban)')
|
||||
.setStyle(ButtonStyle.Danger)
|
||||
]);
|
||||
|
||||
await channel.send({ content: '\u200b', embeds: [embed], components: [row] });
|
||||
}
|
||||
|
||||
@@ -80,7 +80,6 @@ const EMBEDS = {
|
||||
});
|
||||
},
|
||||
NOW_PLAYING: async (data: HybridInteractionMessage, locale: I18n, track: ValidTracks) => {
|
||||
|
||||
const title = TrackUtils.getTitle(track);
|
||||
const thumbnails = await TrackUtils.getThumbnails(track);
|
||||
|
||||
@@ -97,7 +96,6 @@ const EMBEDS = {
|
||||
return embed;
|
||||
},
|
||||
NOW_REPEATING: async (data: HybridInteractionMessage, locale: I18n, track: ValidTracks) => {
|
||||
|
||||
const title = TrackUtils.getTitle(track);
|
||||
const thumbnails = await TrackUtils.getThumbnails(track);
|
||||
|
||||
@@ -141,8 +139,17 @@ export async function joinVoiceChannelProcedure(
|
||||
if (!bot) return;
|
||||
|
||||
const locale = await Locale.getGuildLocale(guild.id);
|
||||
|
||||
if(!await checkBotPermissionsInChannel({ guild, data, locale, channel: memberVoiceChannel, permissions: [PermissionsBitField.Flags.ViewChannel, PermissionsBitField.Flags.Connect]})) return;
|
||||
|
||||
if (
|
||||
!(await checkBotPermissionsInChannel({
|
||||
guild,
|
||||
data,
|
||||
locale,
|
||||
channel: memberVoiceChannel,
|
||||
permissions: [PermissionsBitField.Flags.ViewChannel, PermissionsBitField.Flags.Connect]
|
||||
}))
|
||||
)
|
||||
return;
|
||||
|
||||
// If already in VoiceChannel
|
||||
if (bot.voice.channelId) {
|
||||
@@ -231,7 +238,7 @@ export async function joinVoiceChannelProcedure(
|
||||
else if (event.instance.queue.track[0] === previousTrack && isLoopMessageSent) return;
|
||||
|
||||
const row = new ActionRowBuilder<ButtonBuilder>();
|
||||
if(event.instance.queue.track[0] instanceof SpotifyTrack)
|
||||
if (event.instance.queue.track[0] instanceof SpotifyTrack)
|
||||
row.addComponents([
|
||||
new ButtonBuilder()
|
||||
.setEmoji('🟢')
|
||||
@@ -239,14 +246,21 @@ export async function joinVoiceChannelProcedure(
|
||||
.setURL(encodeURI(`https://open.spotify.com/track/${event.instance.queue.track[0].id}`))
|
||||
.setStyle(ButtonStyle.Link)
|
||||
]);
|
||||
if(event.instance.queue.track[0] instanceof YouTubeVideo || event.instance.queue.track[0] instanceof SpotifyTrack) {
|
||||
if (
|
||||
event.instance.queue.track[0] instanceof YouTubeVideo ||
|
||||
event.instance.queue.track[0] instanceof SpotifyTrack
|
||||
) {
|
||||
const actualPlaybackURL = event.instance.getActualPlaybackURL();
|
||||
if(event.instance.queue.track[0] instanceof SpotifyTrack && !actualPlaybackURL) return;
|
||||
if (event.instance.queue.track[0] instanceof SpotifyTrack && !actualPlaybackURL) return;
|
||||
row.addComponents([
|
||||
new ButtonBuilder()
|
||||
.setEmoji('🔴')
|
||||
.setLabel(' Open in YouTube')
|
||||
.setURL(event.instance.queue.track[0] instanceof YouTubeVideo ? encodeURI(`https://www.youtube.com/watch?v=${event.instance.queue.track[0].id}`) : encodeURI(event.instance.getActualPlaybackURL()!))
|
||||
.setURL(
|
||||
event.instance.queue.track[0] instanceof YouTubeVideo
|
||||
? encodeURI(`https://www.youtube.com/watch?v=${event.instance.queue.track[0].id}`)
|
||||
: encodeURI(event.instance.getActualPlaybackURL()!)
|
||||
)
|
||||
.setStyle(ButtonStyle.Link)
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { I18n } from "i18n";
|
||||
import { Message, CommandInteraction } from "discord.js";
|
||||
import { I18n } from 'i18n';
|
||||
import { Message, CommandInteraction } from 'discord.js';
|
||||
|
||||
import DiscordMusicPlayer from "../../providers/DiscordMusicPlayer";
|
||||
import Locale from "../../services/Locale";
|
||||
import DiscordMusicPlayer from '../../providers/DiscordMusicPlayer';
|
||||
import Locale from '../../services/Locale';
|
||||
|
||||
import { makeSuccessEmbed, makeErrorEmbed, sendHybridInteractionMessageResponse } from "../../utils/DiscordMessage";
|
||||
import DiscordModule, { HybridInteractionMessage } from "../../utils/DiscordModule";
|
||||
import { makeSuccessEmbed, makeErrorEmbed, sendHybridInteractionMessageResponse } from '../../utils/DiscordMessage';
|
||||
import DiscordModule, { HybridInteractionMessage } from '../../utils/DiscordModule';
|
||||
|
||||
const EMBEDS = {
|
||||
VOICECHANNEL_LEFT: (data: HybridInteractionMessage, locale: I18n) => {
|
||||
@@ -32,46 +32,49 @@ const EMBEDS = {
|
||||
user: data.getUser()
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default class Leave extends DiscordModule {
|
||||
|
||||
public id = "Discord_MusicPlayer_Leave";
|
||||
public commands = ["leave", "disconnect", "dc"];
|
||||
public commandInteractionName = "leave";
|
||||
public id = 'Discord_MusicPlayer_Leave';
|
||||
public commands = ['leave', 'disconnect', 'dc'];
|
||||
public commandInteractionName = 'leave';
|
||||
|
||||
async GuildOnModuleCommand(args: any, message: Message) {
|
||||
await this.run(new HybridInteractionMessage(message), args);
|
||||
}
|
||||
|
||||
async GuildModuleCommandInteractionCreate(interaction: CommandInteraction) {
|
||||
async GuildModuleCommandInteractionCreate(interaction: CommandInteraction) {
|
||||
await this.run(new HybridInteractionMessage(interaction), interaction.options);
|
||||
}
|
||||
|
||||
async run(data: HybridInteractionMessage, args: any) {
|
||||
|
||||
const guild = data.getGuild();
|
||||
const member = data.getMember();
|
||||
|
||||
if(!guild || !member) return;
|
||||
if (!guild || !member) return;
|
||||
|
||||
const locale = await Locale.getGuildLocale(guild.id);
|
||||
const voiceChannel = member.voice.channel;
|
||||
|
||||
if (!voiceChannel)
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.USER_NOT_IN_VOICECHANNEL(data, locale)] });
|
||||
|
||||
let instance = DiscordMusicPlayer.getGuildInstance(guild.id);
|
||||
if(!instance)
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.NO_MUSIC_PLAYING(data, locale)] });
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [EMBEDS.USER_NOT_IN_VOICECHANNEL(data, locale)]
|
||||
});
|
||||
|
||||
if(instance.voiceChannel.id !== voiceChannel.id)
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.USER_NOT_IN_SAME_VOICECHANNEL(data, locale)] });
|
||||
|
||||
let instance = DiscordMusicPlayer.getGuildInstance(guild.id);
|
||||
if (!instance)
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [EMBEDS.NO_MUSIC_PLAYING(data, locale)]
|
||||
});
|
||||
|
||||
if (instance.voiceChannel.id !== voiceChannel.id)
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [EMBEDS.USER_NOT_IN_SAME_VOICECHANNEL(data, locale)]
|
||||
});
|
||||
|
||||
DiscordMusicPlayer.destoryGuildInstance(guild.id);
|
||||
await sendHybridInteractionMessageResponse(data, { embeds:[EMBEDS.VOICECHANNEL_LEFT(data, locale)] });
|
||||
await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.VOICECHANNEL_LEFT(data, locale)] });
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
import { I18n } from "i18n";
|
||||
import { Message, CommandInteraction } from "discord.js";
|
||||
import { I18n } from 'i18n';
|
||||
import { Message, CommandInteraction } from 'discord.js';
|
||||
|
||||
import DiscordMusicPlayer, { DiscordMusicPlayerLoopMode } from "../../providers/DiscordMusicPlayer";
|
||||
import Locale from "../../services/Locale";
|
||||
import DiscordMusicPlayer, { DiscordMusicPlayerLoopMode } from '../../providers/DiscordMusicPlayer';
|
||||
import Locale from '../../services/Locale';
|
||||
|
||||
import DiscordModule, { HybridInteractionMessage } from "../../utils/DiscordModule";
|
||||
import { makeErrorEmbed, makeSuccessEmbed, sendHybridInteractionMessageResponse, makeInfoEmbed } from "../../utils/DiscordMessage";
|
||||
import DiscordModule, { HybridInteractionMessage } from '../../utils/DiscordModule';
|
||||
import {
|
||||
makeErrorEmbed,
|
||||
makeSuccessEmbed,
|
||||
sendHybridInteractionMessageResponse,
|
||||
makeInfoEmbed
|
||||
} from '../../utils/DiscordMessage';
|
||||
const EMBEDS = {
|
||||
INVALID_LOOP_MODE: (data: HybridInteractionMessage, locale: I18n) => {
|
||||
return makeErrorEmbed({
|
||||
@@ -50,12 +55,11 @@ const EMBEDS = {
|
||||
user: data.getUser()
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
export default class Loop extends DiscordModule {
|
||||
|
||||
public id = "Discord_MusicPlayer_Loop";
|
||||
public commands = ["loop", "repeat"];
|
||||
public commandInteractionName = "loop";
|
||||
public id = 'Discord_MusicPlayer_Loop';
|
||||
public commands = ['loop', 'repeat'];
|
||||
public commandInteractionName = 'loop';
|
||||
|
||||
async GuildOnModuleCommand(args: any, message: Message) {
|
||||
await this.run(new HybridInteractionMessage(message), args);
|
||||
@@ -66,7 +70,6 @@ export default class Loop extends DiscordModule {
|
||||
}
|
||||
|
||||
async run(data: HybridInteractionMessage, args: any) {
|
||||
|
||||
const guild = data.getGuild();
|
||||
const user = data.getUser();
|
||||
const member = data.getMember();
|
||||
@@ -78,39 +81,52 @@ export default class Loop extends DiscordModule {
|
||||
let query;
|
||||
|
||||
if (data.isMessage()) {
|
||||
if (args.length !== 0)
|
||||
query = args.join(' ');
|
||||
}
|
||||
else if (data.isApplicationCommand())
|
||||
query = args.getSubcommand();
|
||||
if (args.length !== 0) query = args.join(' ');
|
||||
} else if (data.isApplicationCommand()) query = args.getSubcommand();
|
||||
|
||||
const voiceChannel = member.voice.channel;
|
||||
|
||||
if (!voiceChannel)
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.USER_NOT_IN_VOICECHANNEL(data, locale)] });
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [EMBEDS.USER_NOT_IN_VOICECHANNEL(data, locale)]
|
||||
});
|
||||
|
||||
const instance = DiscordMusicPlayer.getGuildInstance(guild.id);
|
||||
|
||||
if (!instance)
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.NO_MUSIC_PLAYING(data, locale)] });
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [EMBEDS.NO_MUSIC_PLAYING(data, locale)]
|
||||
});
|
||||
|
||||
if (instance.voiceChannel.id !== voiceChannel.id)
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.USER_NOT_IN_SAME_VOICECHANNEL(data, locale)] }, true);
|
||||
return await sendHybridInteractionMessageResponse(
|
||||
data,
|
||||
{ embeds: [EMBEDS.USER_NOT_IN_SAME_VOICECHANNEL(data, locale)] },
|
||||
true
|
||||
);
|
||||
|
||||
if (instance.queue.track.length === 0)
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.NO_MUSIC_PLAYING(data, locale)] });
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [EMBEDS.NO_MUSIC_PLAYING(data, locale)]
|
||||
});
|
||||
|
||||
if (!query)
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.LOOP_STATUS(data, locale, instance.getLoopMode())] });
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [EMBEDS.LOOP_STATUS(data, locale, instance.getLoopMode())]
|
||||
});
|
||||
|
||||
let enumKey = Object.keys(DiscordMusicPlayerLoopMode)[Object.values(DiscordMusicPlayerLoopMode).indexOf(query.toLowerCase())];
|
||||
let enumKey =
|
||||
Object.keys(DiscordMusicPlayerLoopMode)[
|
||||
Object.values(DiscordMusicPlayerLoopMode).indexOf(query.toLowerCase())
|
||||
];
|
||||
|
||||
if(enumKey) {
|
||||
if (enumKey) {
|
||||
instance.setLoopMode(DiscordMusicPlayerLoopMode[enumKey as keyof typeof DiscordMusicPlayerLoopMode]);
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.LOOP_SET(data, locale, instance.getLoopMode())] });
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [EMBEDS.LOOP_SET(data, locale, instance.getLoopMode())]
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.INVALID_LOOP_MODE(data, locale)] });
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
import { Message, CommandInteraction, ActionRowBuilder, ButtonBuilder, ButtonStyle } from "discord.js";
|
||||
import { I18n } from "i18n";
|
||||
import { SpotifyTrack, YouTubeVideo } from "play-dl";
|
||||
import { Message, CommandInteraction, ActionRowBuilder, ButtonBuilder, ButtonStyle } from 'discord.js';
|
||||
import { I18n } from 'i18n';
|
||||
import { SpotifyTrack, YouTubeVideo } from 'play-dl';
|
||||
|
||||
import DiscordProvider from "../../providers/Discord";
|
||||
import DiscordMusicPlayer, { TrackUtils, ValidTracks } from "../../providers/DiscordMusicPlayer";
|
||||
import Locale from "../../services/Locale";
|
||||
import DiscordProvider from '../../providers/Discord';
|
||||
import DiscordMusicPlayer, { TrackUtils, ValidTracks } from '../../providers/DiscordMusicPlayer';
|
||||
import Locale from '../../services/Locale';
|
||||
|
||||
import { makeErrorEmbed, makeInfoEmbed, sendHybridInteractionMessageResponse } from "../../utils/DiscordMessage";
|
||||
import DiscordModule, { HybridInteractionMessage } from "../../utils/DiscordModule";
|
||||
import { makeErrorEmbed, makeInfoEmbed, sendHybridInteractionMessageResponse } from '../../utils/DiscordMessage';
|
||||
import DiscordModule, { HybridInteractionMessage } from '../../utils/DiscordModule';
|
||||
|
||||
const EMBEDS = {
|
||||
NOW_PLAYING: async (data: HybridInteractionMessage, locale: I18n, track: ValidTracks) => {
|
||||
|
||||
const title = TrackUtils.getTitle(track);
|
||||
const thumbnails = await TrackUtils.getThumbnails(track);
|
||||
|
||||
@@ -24,7 +23,7 @@ const EMBEDS = {
|
||||
|
||||
if (TrackUtils.getHighestResolutionThumbnail(thumbnails))
|
||||
embed.setImage(TrackUtils.getHighestResolutionThumbnail(thumbnails).url);
|
||||
|
||||
|
||||
return embed;
|
||||
},
|
||||
NO_MUSIC_PLAYING: (data: HybridInteractionMessage, locale: I18n) => {
|
||||
@@ -33,14 +32,13 @@ const EMBEDS = {
|
||||
user: data.getUser()
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default class NowPlaying extends DiscordModule {
|
||||
public id = 'Discord_MusicPlayer_NowPlaying';
|
||||
public commands = ['nowplaying', 'np'];
|
||||
public commandInteractionName = 'nowplaying';
|
||||
|
||||
public id = "Discord_MusicPlayer_NowPlaying";
|
||||
public commands = ["nowplaying", "np"];
|
||||
public commandInteractionName = "nowplaying";
|
||||
|
||||
async GuildOnModuleCommand(args: any, message: Message) {
|
||||
await this.run(new HybridInteractionMessage(message), args);
|
||||
}
|
||||
@@ -50,35 +48,44 @@ export default class NowPlaying extends DiscordModule {
|
||||
}
|
||||
|
||||
async run(data: HybridInteractionMessage, args: any) {
|
||||
|
||||
const guild = data.getGuild();
|
||||
if(!guild) return;
|
||||
|
||||
if (!guild) return;
|
||||
|
||||
const locale = await Locale.getGuildLocale(guild.id);
|
||||
const instance = DiscordMusicPlayer.getGuildInstance(guild.id);
|
||||
if(!instance || !instance.queue.track[0]) return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.NO_MUSIC_PLAYING(data, locale)] });
|
||||
if (!instance || !instance.queue.track[0])
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [EMBEDS.NO_MUSIC_PLAYING(data, locale)]
|
||||
});
|
||||
|
||||
const row = new ActionRowBuilder<ButtonBuilder>();
|
||||
|
||||
if(instance.queue.track[0] instanceof SpotifyTrack)
|
||||
if (instance.queue.track[0] instanceof SpotifyTrack)
|
||||
row.addComponents([
|
||||
new ButtonBuilder()
|
||||
.setEmoji('🟢')
|
||||
.setLabel(' Open in Spotify')
|
||||
.setURL(encodeURI(`https://open.spotify.com/track/${instance.queue.track[0].id}`))
|
||||
.setStyle(ButtonStyle.Link),
|
||||
.setStyle(ButtonStyle.Link)
|
||||
]);
|
||||
if(instance.queue.track[0] instanceof YouTubeVideo || instance.queue.track[0] instanceof SpotifyTrack) {
|
||||
const actualPlaybackURL = instance.getActualPlaybackURL();
|
||||
if(instance.queue.track[0] instanceof SpotifyTrack && !actualPlaybackURL) return;
|
||||
row.addComponents([
|
||||
new ButtonBuilder()
|
||||
.setEmoji('🔴')
|
||||
.setLabel(' Open in YouTube')
|
||||
.setURL(instance.queue.track[0] instanceof YouTubeVideo ? encodeURI(`https://www.youtube.com/watch?v=${instance.queue.track[0].id}`) : encodeURI(instance.getActualPlaybackURL()!))
|
||||
.setStyle(ButtonStyle.Link),
|
||||
]);
|
||||
}
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [await EMBEDS.NOW_PLAYING(data, locale, instance.queue.track[0])], components: [row] });
|
||||
if (instance.queue.track[0] instanceof YouTubeVideo || instance.queue.track[0] instanceof SpotifyTrack) {
|
||||
const actualPlaybackURL = instance.getActualPlaybackURL();
|
||||
if (instance.queue.track[0] instanceof SpotifyTrack && !actualPlaybackURL) return;
|
||||
row.addComponents([
|
||||
new ButtonBuilder()
|
||||
.setEmoji('🔴')
|
||||
.setLabel(' Open in YouTube')
|
||||
.setURL(
|
||||
instance.queue.track[0] instanceof YouTubeVideo
|
||||
? encodeURI(`https://www.youtube.com/watch?v=${instance.queue.track[0].id}`)
|
||||
: encodeURI(instance.getActualPlaybackURL()!)
|
||||
)
|
||||
.setStyle(ButtonStyle.Link)
|
||||
]);
|
||||
}
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [await EMBEDS.NOW_PLAYING(data, locale, instance.queue.track[0])],
|
||||
components: [row]
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
import { Message, CommandInteraction, Interaction } from "discord.js";
|
||||
import { I18n } from "i18n";
|
||||
import { Message, CommandInteraction, Interaction } from 'discord.js';
|
||||
import { I18n } from 'i18n';
|
||||
|
||||
import DiscordMusicPlayer from "../../providers/DiscordMusicPlayer";
|
||||
import Locale from "../../services/Locale";
|
||||
import DiscordMusicPlayer from '../../providers/DiscordMusicPlayer';
|
||||
import Locale from '../../services/Locale';
|
||||
|
||||
import DiscordModule, { HybridInteractionMessage } from "../../utils/DiscordModule";
|
||||
import DiscordModule, { HybridInteractionMessage } from '../../utils/DiscordModule';
|
||||
|
||||
import { makeSuccessEmbed, makeInfoEmbed, makeErrorEmbed, sendHybridInteractionMessageResponse } from "../../utils/DiscordMessage";
|
||||
import {
|
||||
makeSuccessEmbed,
|
||||
makeInfoEmbed,
|
||||
makeErrorEmbed,
|
||||
sendHybridInteractionMessageResponse
|
||||
} from '../../utils/DiscordMessage';
|
||||
|
||||
const EMBEDS = {
|
||||
PAUSED: (data: HybridInteractionMessage, locale: I18n) => {
|
||||
@@ -39,24 +44,22 @@ const EMBEDS = {
|
||||
user: data.getUser()
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default class Pause extends DiscordModule{
|
||||
|
||||
public id = "Discord_MusicPlayer_Pause";
|
||||
public commands = ["pause"];
|
||||
public commandInteractionName = "pause";
|
||||
export default class Pause extends DiscordModule {
|
||||
public id = 'Discord_MusicPlayer_Pause';
|
||||
public commands = ['pause'];
|
||||
public commandInteractionName = 'pause';
|
||||
|
||||
async GuildOnModuleCommand(args: any, message: Message) {
|
||||
await this.run(new HybridInteractionMessage(message), args);
|
||||
}
|
||||
|
||||
async GuildModuleCommandInteractionCreate(interaction: CommandInteraction) {
|
||||
async GuildModuleCommandInteractionCreate(interaction: CommandInteraction) {
|
||||
await this.run(new HybridInteractionMessage(interaction), interaction.options);
|
||||
}
|
||||
|
||||
async run(data: HybridInteractionMessage, args: any) {
|
||||
|
||||
const guild = data.getGuild();
|
||||
const member = data.getMember();
|
||||
|
||||
@@ -66,23 +69,33 @@ export default class Pause extends DiscordModule{
|
||||
const voiceChannel = member.voice.channel;
|
||||
|
||||
if (!voiceChannel)
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.USER_NOT_IN_VOICECHANNEL(data, locale)] });
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [EMBEDS.USER_NOT_IN_VOICECHANNEL(data, locale)]
|
||||
});
|
||||
|
||||
const instance = DiscordMusicPlayer.getGuildInstance(guild.id);
|
||||
|
||||
if(!instance)
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.NO_MUSIC_PLAYING(data, locale)] });
|
||||
if (!instance)
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [EMBEDS.NO_MUSIC_PLAYING(data, locale)]
|
||||
});
|
||||
|
||||
if(instance.voiceChannel.id !== voiceChannel.id)
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.USER_NOT_IN_SAME_VOICECHANNEL(data, locale)] }, true);
|
||||
if (instance.voiceChannel.id !== voiceChannel.id)
|
||||
return await sendHybridInteractionMessageResponse(
|
||||
data,
|
||||
{ embeds: [EMBEDS.USER_NOT_IN_SAME_VOICECHANNEL(data, locale)] },
|
||||
true
|
||||
);
|
||||
|
||||
if(instance.queue.track.length === 0)
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.NO_MUSIC_PLAYING(data, locale)] });
|
||||
if (instance.queue.track.length === 0)
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [EMBEDS.NO_MUSIC_PLAYING(data, locale)]
|
||||
});
|
||||
|
||||
if(instance.isPaused())
|
||||
if (instance.isPaused())
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.ALREADY_PAUSED(data, locale)] });
|
||||
|
||||
|
||||
instance.pausePlayer();
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.PAUSED(data, locale)] });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,6 @@ const EMBEDS = {
|
||||
});
|
||||
},
|
||||
ADDED_QUEUE: async (data: HybridInteractionMessage, locale: I18n, track: ValidTracks) => {
|
||||
|
||||
const title = TrackUtils.getTitle(track);
|
||||
const thumbnails = await TrackUtils.getThumbnails(track);
|
||||
|
||||
@@ -354,7 +353,15 @@ export default class Play extends DiscordModule {
|
||||
|
||||
if (!result) return;
|
||||
|
||||
if (data.isMessage() && data.getMessage().embeds.length > 0 && await checkBotPermissionsInChannel({ guild, channel, permissions: [PermissionsBitField.Flags.ManageMessages]})) {
|
||||
if (
|
||||
data.isMessage() &&
|
||||
data.getMessage().embeds.length > 0 &&
|
||||
(await checkBotPermissionsInChannel({
|
||||
guild,
|
||||
channel,
|
||||
permissions: [PermissionsBitField.Flags.ManageMessages]
|
||||
}))
|
||||
) {
|
||||
data.getMessage().suppressEmbeds(true);
|
||||
}
|
||||
|
||||
@@ -373,8 +380,7 @@ export default class Play extends DiscordModule {
|
||||
)
|
||||
.setLabel(' Add the remaining songs in the playlist')
|
||||
.setStyle(ButtonStyle.Primary)
|
||||
]
|
||||
);
|
||||
]);
|
||||
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [await EMBEDS.ADDED_QUEUE(data, locale, result)],
|
||||
@@ -389,11 +395,15 @@ export default class Play extends DiscordModule {
|
||||
|
||||
if (linkData.type === 'playlist' || linkData.type === 'album') {
|
||||
let playlist = await DiscordMusicPlayer.getSpotifySongsInPlayList(query).catch((err) => {
|
||||
sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.LOOKUP_ERROR(data, locale, err)] }, true);
|
||||
sendHybridInteractionMessageResponse(
|
||||
data,
|
||||
{ embeds: [EMBEDS.LOOKUP_ERROR(data, locale, err)] },
|
||||
true
|
||||
);
|
||||
return null;
|
||||
});
|
||||
|
||||
if(!playlist) return;
|
||||
|
||||
if (!playlist) return;
|
||||
const songs = await playlist.all_tracks();
|
||||
|
||||
for (const song of songs) {
|
||||
@@ -414,7 +424,15 @@ export default class Play extends DiscordModule {
|
||||
|
||||
if (!result) return;
|
||||
|
||||
if (data.isMessage() && data.getMessage().embeds.length > 0 && await checkBotPermissionsInChannel({ guild, channel, permissions: [PermissionsBitField.Flags.ManageMessages]})) {
|
||||
if (
|
||||
data.isMessage() &&
|
||||
data.getMessage().embeds.length > 0 &&
|
||||
(await checkBotPermissionsInChannel({
|
||||
guild,
|
||||
channel,
|
||||
permissions: [PermissionsBitField.Flags.ManageMessages]
|
||||
}))
|
||||
) {
|
||||
data.getMessage().suppressEmbeds(true);
|
||||
}
|
||||
|
||||
@@ -423,7 +441,6 @@ export default class Play extends DiscordModule {
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [await EMBEDS.ADDED_QUEUE(data, locale, result)]
|
||||
});
|
||||
|
||||
} else {
|
||||
let result = await DiscordMusicPlayer.searchYouTubeByQuery(query);
|
||||
|
||||
@@ -461,7 +478,7 @@ export default class Play extends DiscordModule {
|
||||
)
|
||||
.setLabel(' Not this? Search!')
|
||||
.setStyle(ButtonStyle.Primary)
|
||||
]);
|
||||
]);
|
||||
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [await EMBEDS.ADDED_QUEUE(data, locale, result[0])],
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { I18n } from "i18n";
|
||||
import { Message, CommandInteraction, ActivityType, ActionRowBuilder, ButtonBuilder, ButtonStyle } from "discord.js";
|
||||
import { I18n } from 'i18n';
|
||||
import { Message, CommandInteraction, ActivityType, ActionRowBuilder, ButtonBuilder, ButtonStyle } from 'discord.js';
|
||||
|
||||
import DiscordMusicPlayer, { TrackUtils, ValidTracks } from "../../providers/DiscordMusicPlayer";
|
||||
import Locale from "../../services/Locale";
|
||||
import DiscordMusicPlayer, { TrackUtils, ValidTracks } from '../../providers/DiscordMusicPlayer';
|
||||
import Locale from '../../services/Locale';
|
||||
|
||||
import { makeSuccessEmbed, makeErrorEmbed, sendHybridInteractionMessageResponse } from "../../utils/DiscordMessage";
|
||||
import DiscordModule, { HybridInteractionMessage } from "../../utils/DiscordModule";
|
||||
import { joinVoiceChannelProcedure } from "./Join";
|
||||
import { makeSuccessEmbed, makeErrorEmbed, sendHybridInteractionMessageResponse } from '../../utils/DiscordMessage';
|
||||
import DiscordModule, { HybridInteractionMessage } from '../../utils/DiscordModule';
|
||||
import { joinVoiceChannelProcedure } from './Join';
|
||||
|
||||
const EMBEDS = {
|
||||
NOT_DETECTED: (data: HybridInteractionMessage, locale: I18n) => {
|
||||
@@ -28,7 +28,6 @@ const EMBEDS = {
|
||||
});
|
||||
},
|
||||
ADDED_QUEUE: async (data: HybridInteractionMessage, locale: I18n, track: ValidTracks) => {
|
||||
|
||||
const title = TrackUtils.getTitle(track);
|
||||
const thumbnails = await TrackUtils.getThumbnails(track);
|
||||
|
||||
@@ -43,28 +42,26 @@ const EMBEDS = {
|
||||
|
||||
return embed;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default class PlayMy extends DiscordModule {
|
||||
|
||||
public id = "Discord_MusicPlayer_PlayMy";
|
||||
public commands = ["playmy"];
|
||||
public commandInteractionName = "playmy";
|
||||
public id = 'Discord_MusicPlayer_PlayMy';
|
||||
public commands = ['playmy'];
|
||||
public commandInteractionName = 'playmy';
|
||||
|
||||
async GuildOnModuleCommand(args: any, message: Message) {
|
||||
await this.run(new HybridInteractionMessage(message), args);
|
||||
}
|
||||
|
||||
async GuildModuleCommandInteractionCreate(interaction: CommandInteraction) {
|
||||
async GuildModuleCommandInteractionCreate(interaction: CommandInteraction) {
|
||||
await this.run(new HybridInteractionMessage(interaction), interaction.options);
|
||||
}
|
||||
|
||||
async run(data: HybridInteractionMessage, args: any) {
|
||||
|
||||
const guild = data.getGuild();
|
||||
const member = data.getMember();
|
||||
|
||||
if(!guild || !member) return;
|
||||
if (!guild || !member) return;
|
||||
|
||||
const locale = await Locale.getGuildLocale(guild.id);
|
||||
|
||||
@@ -94,22 +91,20 @@ export default class PlayMy extends DiscordModule {
|
||||
instance = DiscordMusicPlayer.getGuildInstance(guild.id);
|
||||
}
|
||||
|
||||
if(!instance) return;
|
||||
if(!member.presence) return;
|
||||
if(!member.presence.activities) return;
|
||||
if (!instance) return;
|
||||
if (!member.presence) return;
|
||||
if (!member.presence.activities) return;
|
||||
|
||||
let query;
|
||||
let found = false;
|
||||
for (const activity of member.presence.activities) {
|
||||
if(activity.type === ActivityType.Listening) {
|
||||
if(!activity.details) continue;
|
||||
if (activity.type === ActivityType.Listening) {
|
||||
if (!activity.details) continue;
|
||||
found = true;
|
||||
|
||||
if(activity.name == "Spotify")
|
||||
query = `${activity.state} - ${activity.details}`
|
||||
else
|
||||
query = `${activity.state} - ${activity.details}` // TODO: Find better query formula
|
||||
|
||||
if (activity.name == 'Spotify') query = `${activity.state} - ${activity.details}`;
|
||||
else query = `${activity.state} - ${activity.details}`; // TODO: Find better query formula
|
||||
|
||||
const result = await DiscordMusicPlayer.searchYouTubeByQuery(query);
|
||||
if (!result) continue;
|
||||
instance.addTrackToQueue(result[0]);
|
||||
@@ -120,10 +115,10 @@ export default class PlayMy extends DiscordModule {
|
||||
// If the first result title is exact match with the query or first title contains half the space of the query, it's probably a sentence
|
||||
// then we don't need to show the search results
|
||||
// if(result[0].title === query || result[0].title && (Math.ceil((result[0].title.split(" ").length - 1) / 2) === Math.ceil((query.split(" ").length - 1) / 2))) return;
|
||||
|
||||
|
||||
// The query length is too long to fit in json
|
||||
if (query.length > 100 - 51) return;
|
||||
|
||||
|
||||
row = new ActionRowBuilder<ButtonBuilder>().addComponents([
|
||||
new ButtonBuilder()
|
||||
.setEmoji('🔎')
|
||||
@@ -138,10 +133,10 @@ export default class PlayMy extends DiscordModule {
|
||||
)
|
||||
.setLabel(' Not this? Search!')
|
||||
.setStyle(ButtonStyle.Primary)
|
||||
]);
|
||||
]);
|
||||
}
|
||||
|
||||
if(!row)
|
||||
if (!row)
|
||||
await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [await EMBEDS.ADDED_QUEUE(data, locale, result[0])]
|
||||
});
|
||||
@@ -153,9 +148,8 @@ export default class PlayMy extends DiscordModule {
|
||||
}
|
||||
}
|
||||
|
||||
if(!found)
|
||||
await sendHybridInteractionMessageResponse(data, { embeds:[EMBEDS.NOT_DETECTED(data, locale)] });
|
||||
if (!found) await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.NOT_DETECTED(data, locale)] });
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,10 +133,14 @@ export default class QueueCommand extends DiscordModule {
|
||||
switch (query.toLowerCase()) {
|
||||
case 'clear':
|
||||
instance.clearQueue();
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.QUEUE_CLEARED(data, locale)] });
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [EMBEDS.QUEUE_CLEARED(data, locale)]
|
||||
});
|
||||
case 'shuffle':
|
||||
instance.shuffleQueue();
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.QUEUE_SHUFFLED(data, locale)] });
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [EMBEDS.QUEUE_SHUFFLED(data, locale)]
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
import { Message, CommandInteraction, Interaction } from "discord.js";
|
||||
import { I18n } from "i18n";
|
||||
import { Message, CommandInteraction, Interaction } from 'discord.js';
|
||||
import { I18n } from 'i18n';
|
||||
|
||||
import DiscordMusicPlayer from "../../providers/DiscordMusicPlayer";
|
||||
import DiscordMusicPlayer from '../../providers/DiscordMusicPlayer';
|
||||
|
||||
import DiscordModule, { HybridInteractionMessage } from "../../utils/DiscordModule";
|
||||
import { makeSuccessEmbed, makeInfoEmbed, makeErrorEmbed, sendHybridInteractionMessageResponse } from "../../utils/DiscordMessage";
|
||||
import Locale from "../../services/Locale";
|
||||
import DiscordModule, { HybridInteractionMessage } from '../../utils/DiscordModule';
|
||||
import {
|
||||
makeSuccessEmbed,
|
||||
makeInfoEmbed,
|
||||
makeErrorEmbed,
|
||||
sendHybridInteractionMessageResponse
|
||||
} from '../../utils/DiscordMessage';
|
||||
import Locale from '../../services/Locale';
|
||||
|
||||
const EMBEDS = {
|
||||
RESUMED: (data: HybridInteractionMessage, locale: I18n) => {
|
||||
@@ -38,24 +43,22 @@ const EMBEDS = {
|
||||
user: data.getUser()
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default class Resume extends DiscordModule{
|
||||
|
||||
public id = "Discord_MusicPlayer_Resume";
|
||||
public commands = ["resume"];
|
||||
public commandInteractionName = "resume";
|
||||
export default class Resume extends DiscordModule {
|
||||
public id = 'Discord_MusicPlayer_Resume';
|
||||
public commands = ['resume'];
|
||||
public commandInteractionName = 'resume';
|
||||
|
||||
async GuildOnModuleCommand(args: any, message: Message) {
|
||||
await this.run(new HybridInteractionMessage(message), args);
|
||||
}
|
||||
|
||||
async GuildModuleCommandInteractionCreate(interaction: CommandInteraction) {
|
||||
async GuildModuleCommandInteractionCreate(interaction: CommandInteraction) {
|
||||
await this.run(new HybridInteractionMessage(interaction), interaction.options);
|
||||
}
|
||||
|
||||
async run(data: HybridInteractionMessage, args: any) {
|
||||
|
||||
const guild = data.getGuild();
|
||||
const member = data.getMember();
|
||||
|
||||
@@ -66,23 +69,33 @@ export default class Resume extends DiscordModule{
|
||||
const voiceChannel = member.voice.channel;
|
||||
|
||||
if (!voiceChannel)
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.USER_NOT_IN_VOICECHANNEL(data, locale)] });
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [EMBEDS.USER_NOT_IN_VOICECHANNEL(data, locale)]
|
||||
});
|
||||
|
||||
const instance = DiscordMusicPlayer.getGuildInstance(guild.id);
|
||||
|
||||
if(!instance)
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.NO_MUSIC_PLAYING(data, locale)] });
|
||||
if (!instance)
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [EMBEDS.NO_MUSIC_PLAYING(data, locale)]
|
||||
});
|
||||
|
||||
if(instance.voiceChannel.id !== voiceChannel.id)
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.USER_NOT_IN_SAME_VOICECHANNEL(data, locale)] }, true);
|
||||
if (instance.voiceChannel.id !== voiceChannel.id)
|
||||
return await sendHybridInteractionMessageResponse(
|
||||
data,
|
||||
{ embeds: [EMBEDS.USER_NOT_IN_SAME_VOICECHANNEL(data, locale)] },
|
||||
true
|
||||
);
|
||||
|
||||
if(instance.queue.track.length === 0)
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.NO_MUSIC_PLAYING(data, locale)] });
|
||||
if (instance.queue.track.length === 0)
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [EMBEDS.NO_MUSIC_PLAYING(data, locale)]
|
||||
});
|
||||
|
||||
if(!instance.isPaused())
|
||||
if (!instance.isPaused())
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.NOT_PAUSED(data, locale)] });
|
||||
|
||||
instance.resumePlayer();
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.RESUMED(data, locale)] });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,20 @@
|
||||
import { Message, CommandInteraction, ActionRowBuilder, ButtonInteraction, SelectMenuBuilder, SelectMenuComponentOptionData } from "discord.js";
|
||||
import { I18n } from "i18n";
|
||||
import {
|
||||
Message,
|
||||
CommandInteraction,
|
||||
ActionRowBuilder,
|
||||
ButtonInteraction,
|
||||
SelectMenuBuilder,
|
||||
SelectMenuComponentOptionData
|
||||
} from 'discord.js';
|
||||
import { I18n } from 'i18n';
|
||||
|
||||
import { joinVoiceChannelProcedure } from "./Join";
|
||||
import { joinVoiceChannelProcedure } from './Join';
|
||||
|
||||
import DiscordMusicPlayer, { TrackUtils, ValidTracks } from "../../providers/DiscordMusicPlayer";
|
||||
import Locale from "../../services/Locale";
|
||||
import DiscordMusicPlayer, { TrackUtils, ValidTracks } from '../../providers/DiscordMusicPlayer';
|
||||
import Locale from '../../services/Locale';
|
||||
|
||||
import DiscordModule, { HybridInteractionMessage } from "../../utils/DiscordModule";
|
||||
import { makeErrorEmbed, sendHybridInteractionMessageResponse, makeInfoEmbed } from "../../utils/DiscordMessage";
|
||||
import DiscordModule, { HybridInteractionMessage } from '../../utils/DiscordModule';
|
||||
import { makeErrorEmbed, sendHybridInteractionMessageResponse, makeInfoEmbed } from '../../utils/DiscordMessage';
|
||||
|
||||
const EMBEDS = {
|
||||
SEARCH_INFO: (data: HybridInteractionMessage, locale: I18n) => {
|
||||
@@ -17,7 +24,7 @@ const EMBEDS = {
|
||||
fields: [
|
||||
{
|
||||
name: locale.__('common.available_args'),
|
||||
value: locale.__('musicplayer_search.valid_args'),
|
||||
value: locale.__('musicplayer_search.valid_args')
|
||||
}
|
||||
],
|
||||
user: data.getUser()
|
||||
@@ -28,7 +35,7 @@ const EMBEDS = {
|
||||
title: locale.__('musicplayer_search.title_result'),
|
||||
description: `${locale.__('musicplayer_search.x_results_found', {
|
||||
COUNT: result.length.toString()
|
||||
})}\n\n${result.map(track => `- [${TrackUtils.getTitle(track)}](${track.url})`).join('\n')}`,
|
||||
})}\n\n${result.map((track) => `- [${TrackUtils.getTitle(track)}](${track.url})`).join('\n')}`,
|
||||
user: data.getUser()
|
||||
});
|
||||
},
|
||||
@@ -44,12 +51,11 @@ const EMBEDS = {
|
||||
user: data.getUser()
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
export default class Search extends DiscordModule {
|
||||
|
||||
public id = "Discord_MusicPlayer_Search";
|
||||
public commands = ["search"];
|
||||
public commandInteractionName = "search";
|
||||
public id = 'Discord_MusicPlayer_Search';
|
||||
public commands = ['search'];
|
||||
public commandInteractionName = 'search';
|
||||
|
||||
async GuildOnModuleCommand(args: any, message: Message) {
|
||||
await this.run(new HybridInteractionMessage(message), args);
|
||||
@@ -70,16 +76,18 @@ export default class Search extends DiscordModule {
|
||||
data.q stands for data.query
|
||||
*/
|
||||
|
||||
if (typeof payload.m === 'undefined' ||
|
||||
if (
|
||||
typeof payload.m === 'undefined' ||
|
||||
typeof payload.a === 'undefined' ||
|
||||
payload.m !== 'MP_S' ||
|
||||
payload.a !== 'search') return;
|
||||
payload.a !== 'search'
|
||||
)
|
||||
return;
|
||||
|
||||
await this.run(new HybridInteractionMessage(interaction), payload.d.q);
|
||||
}
|
||||
|
||||
async run(data: HybridInteractionMessage, args: any) {
|
||||
|
||||
async run(data: HybridInteractionMessage, args: any) {
|
||||
const guild = data.getGuild();
|
||||
const user = data.getUser();
|
||||
const member = data.getMember();
|
||||
@@ -95,19 +103,18 @@ export default class Search extends DiscordModule {
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.SEARCH_INFO(data, locale)] });
|
||||
|
||||
query = args.join(' ');
|
||||
}
|
||||
else if (data.isApplicationCommand())
|
||||
} else if (data.isApplicationCommand())
|
||||
query = data.getSlashCommand().options.get('query', true).value?.toString();
|
||||
else if (data.isButton())
|
||||
query = args;
|
||||
else if (data.isButton()) query = args;
|
||||
|
||||
if (!query) return;
|
||||
|
||||
const voiceChannel = member.voice.channel;
|
||||
|
||||
if (!voiceChannel)
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.USER_NOT_IN_VOICECHANNEL(data, locale)] });
|
||||
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [EMBEDS.USER_NOT_IN_VOICECHANNEL(data, locale)]
|
||||
});
|
||||
|
||||
if (!DiscordMusicPlayer.isGuildInstanceExists(guild.id))
|
||||
await joinVoiceChannelProcedure(data, null, voiceChannel);
|
||||
@@ -116,7 +123,9 @@ export default class Search extends DiscordModule {
|
||||
if (!instance) return;
|
||||
|
||||
if (instance.voiceChannel.id !== voiceChannel.id)
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.USER_NOT_IN_SAME_VOICECHANNEL(data, locale)] });
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [EMBEDS.USER_NOT_IN_SAME_VOICECHANNEL(data, locale)]
|
||||
});
|
||||
|
||||
if (!instance.isConnected()) {
|
||||
await joinVoiceChannelProcedure(data, instance!, voiceChannel);
|
||||
@@ -136,14 +145,16 @@ export default class Search extends DiscordModule {
|
||||
data.r stands for data.requester
|
||||
data.v stands for data.voiceChannel
|
||||
*/
|
||||
messageSelectMenu.setCustomId(JSON.stringify({
|
||||
m: 'MP_SM',
|
||||
a: 'play',
|
||||
d: {
|
||||
r: user.id,
|
||||
v: voiceChannel.id
|
||||
}
|
||||
}))
|
||||
messageSelectMenu.setCustomId(
|
||||
JSON.stringify({
|
||||
m: 'MP_SM',
|
||||
a: 'play',
|
||||
d: {
|
||||
r: user.id,
|
||||
v: voiceChannel.id
|
||||
}
|
||||
})
|
||||
);
|
||||
messageSelectMenu.setPlaceholder('Nothing selected');
|
||||
|
||||
for (let song of result) {
|
||||
@@ -160,21 +171,21 @@ export default class Search extends DiscordModule {
|
||||
const row = new ActionRowBuilder<SelectMenuBuilder>();
|
||||
row.addComponents([messageSelectMenu]);
|
||||
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.SEARCH_RESULT(data, locale, result)], components: [row] });
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [EMBEDS.SEARCH_RESULT(data, locale, result)],
|
||||
components: [row]
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
isJsonValid(jsonString: string) {
|
||||
try {
|
||||
let o = JSON.parse(jsonString);
|
||||
if (o && typeof o === "object") {
|
||||
if (o && typeof o === 'object') {
|
||||
return true;
|
||||
//return o;
|
||||
}
|
||||
}
|
||||
catch (e) { }
|
||||
} catch (e) {}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import DiscordModule, { HybridInteractionMessage } from "../../utils/DiscordModule";
|
||||
import DiscordModule, { HybridInteractionMessage } from '../../utils/DiscordModule';
|
||||
|
||||
import { Message, CommandInteraction } from "discord.js";
|
||||
import { makeSuccessEmbed, makeErrorEmbed, sendHybridInteractionMessageResponse } from "../../utils/DiscordMessage";
|
||||
import { Message, CommandInteraction } from 'discord.js';
|
||||
import { makeSuccessEmbed, makeErrorEmbed, sendHybridInteractionMessageResponse } from '../../utils/DiscordMessage';
|
||||
|
||||
import DiscordMusicPlayer from "../../providers/DiscordMusicPlayer";
|
||||
import { I18n } from "i18n";
|
||||
import Locale from "../../services/Locale";
|
||||
import DiscordMusicPlayer from '../../providers/DiscordMusicPlayer';
|
||||
import { I18n } from 'i18n';
|
||||
import Locale from '../../services/Locale';
|
||||
|
||||
const EMBEDS = {
|
||||
SKIPPED: (data: HybridInteractionMessage, locale: I18n) => {
|
||||
@@ -38,24 +38,22 @@ const EMBEDS = {
|
||||
user: data.getUser()
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default class Skip extends DiscordModule{
|
||||
|
||||
public id = "Discord_MusicPlayer_Skip";
|
||||
public commands = ["skip"];
|
||||
public commandInteractionName = "skip";
|
||||
export default class Skip extends DiscordModule {
|
||||
public id = 'Discord_MusicPlayer_Skip';
|
||||
public commands = ['skip'];
|
||||
public commandInteractionName = 'skip';
|
||||
|
||||
async GuildOnModuleCommand(args: any, message: Message) {
|
||||
await this.run(new HybridInteractionMessage(message), args);
|
||||
}
|
||||
|
||||
async GuildModuleCommandInteractionCreate(interaction: CommandInteraction) {
|
||||
async GuildModuleCommandInteractionCreate(interaction: CommandInteraction) {
|
||||
await this.run(new HybridInteractionMessage(interaction), interaction.options);
|
||||
}
|
||||
|
||||
async run(data: HybridInteractionMessage, args: any) {
|
||||
|
||||
const guild = data.getGuild();
|
||||
const member = data.getMember();
|
||||
|
||||
@@ -65,24 +63,35 @@ export default class Skip extends DiscordModule{
|
||||
const voiceChannel = member.voice.channel;
|
||||
|
||||
if (!voiceChannel)
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.USER_NOT_IN_VOICECHANNEL(data, locale)] });
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [EMBEDS.USER_NOT_IN_VOICECHANNEL(data, locale)]
|
||||
});
|
||||
|
||||
const instance = DiscordMusicPlayer.getGuildInstance(guild.id);
|
||||
|
||||
if(!instance)
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.NO_MUSIC_PLAYING(data, locale)] });
|
||||
if (!instance)
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [EMBEDS.NO_MUSIC_PLAYING(data, locale)]
|
||||
});
|
||||
|
||||
if(instance.voiceChannel.id !== voiceChannel.id)
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.USER_NOT_IN_SAME_VOICECHANNEL(data, locale)] }, true);
|
||||
if (instance.voiceChannel.id !== voiceChannel.id)
|
||||
return await sendHybridInteractionMessageResponse(
|
||||
data,
|
||||
{ embeds: [EMBEDS.USER_NOT_IN_SAME_VOICECHANNEL(data, locale)] },
|
||||
true
|
||||
);
|
||||
|
||||
if(instance.queue.track.length === 0)
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.NO_MUSIC_PLAYING(data, locale)] });
|
||||
if (instance.queue.track.length === 0)
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [EMBEDS.NO_MUSIC_PLAYING(data, locale)]
|
||||
});
|
||||
|
||||
instance.skipTrack();
|
||||
|
||||
if(instance.queue.track.length === 0)
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.SKIPPED_LASTSONG(data, locale)] });
|
||||
else
|
||||
return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.SKIPPED(data, locale)] });
|
||||
if (instance.queue.track.length === 0)
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [EMBEDS.SKIPPED_LASTSONG(data, locale)]
|
||||
});
|
||||
else return await sendHybridInteractionMessageResponse(data, { embeds: [EMBEDS.SKIPPED(data, locale)] });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+12
-20
@@ -10,11 +10,7 @@ import Environment from '../providers/Environment';
|
||||
import Locale from '../services/Locale';
|
||||
|
||||
import DiscordModule, { HybridInteractionMessage } from '../utils/DiscordModule';
|
||||
import {
|
||||
makeSuccessEmbed,
|
||||
makeProcessingEmbed,
|
||||
sendHybridInteractionMessageResponse
|
||||
} from '../utils/DiscordMessage';
|
||||
import { makeSuccessEmbed, makeProcessingEmbed, sendHybridInteractionMessageResponse } from '../utils/DiscordMessage';
|
||||
|
||||
enum MeasureType {
|
||||
Ping = 'ping',
|
||||
@@ -57,14 +53,14 @@ export default class Ping extends DiscordModule {
|
||||
const guild = data.getGuild();
|
||||
const member = data.getMember();
|
||||
|
||||
if(!guild || !member) return;
|
||||
if (!guild || !member) return;
|
||||
|
||||
const locale = await Locale.getGuildLocale(guild.id);
|
||||
|
||||
let placeholder: HybridInteractionMessage | undefined;
|
||||
let beforeEditDate = Date.now();
|
||||
let _placeholder = await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [EMBEDS.PINGING(data, locale)],
|
||||
embeds: [EMBEDS.PINGING(data, locale)]
|
||||
});
|
||||
if (_placeholder) placeholder = new HybridInteractionMessage(_placeholder);
|
||||
|
||||
@@ -86,23 +82,17 @@ export default class Ping extends DiscordModule {
|
||||
return finalString.push(stringCurrent);
|
||||
}
|
||||
|
||||
if (
|
||||
res.avg === 'unknown' ||
|
||||
res.min === 'unknown' ||
|
||||
res.max === 'unknown'
|
||||
) {
|
||||
if (res.avg === 'unknown' || res.min === 'unknown' || res.max === 'unknown') {
|
||||
stringCurrent += 'Failed';
|
||||
return finalString.push(stringCurrent);
|
||||
}
|
||||
|
||||
stringCurrent += `${parseFloat(res.avg).toFixed(1)}ms (${parseFloat(
|
||||
res.min
|
||||
).toFixed(1)}ms - ${parseFloat(res.max).toFixed(1)}ms)`;
|
||||
stringCurrent += `${parseFloat(res.avg).toFixed(1)}ms (${parseFloat(res.min).toFixed(
|
||||
1
|
||||
)}ms - ${parseFloat(res.max).toFixed(1)}ms)`;
|
||||
finalString.push(stringCurrent);
|
||||
} else if (entry.type === MeasureType.DiscordWebsocket) {
|
||||
stringCurrent += `${Math.round(DiscordProvider.client.ws.ping).toFixed(
|
||||
1
|
||||
)}ms`;
|
||||
stringCurrent += `${Math.round(DiscordProvider.client.ws.ping).toFixed(1)}ms`;
|
||||
finalString.push(stringCurrent);
|
||||
} else if (entry.type === MeasureType.DiscordHTTPPing) {
|
||||
stringCurrent += `${Math.abs(afterEditDate - beforeEditDate).toFixed(1)}ms`;
|
||||
@@ -117,9 +107,11 @@ export default class Ping extends DiscordModule {
|
||||
|
||||
finalString.push('');
|
||||
finalString.push(
|
||||
`💻 ${locale.__('ping.running_on', {HOST: os.hostname()})} ` +
|
||||
`💻 ${locale.__('ping.running_on', { HOST: os.hostname() })} ` +
|
||||
`${
|
||||
Environment.get().NODE_ENV === 'development' ? ` / ${locale.__('ping.development_environment')}` : ''
|
||||
Environment.get().NODE_ENV === 'development'
|
||||
? ` / ${locale.__('ping.development_environment')}`
|
||||
: ''
|
||||
}`
|
||||
);
|
||||
|
||||
|
||||
+4
-6
@@ -27,11 +27,9 @@ const EMBEDS = {
|
||||
NO_PERMISSION: (data: HybridInteractionMessage, locale: I18n) => {
|
||||
return makeErrorEmbed({
|
||||
title: locale.__('common.no_permissions'),
|
||||
description: locale.__(
|
||||
'common.no_permissions_description', {
|
||||
PERMISSIONS: 'VIEW_CHANNEL, SEND_MESSAGES, MANAGE_CHANNELS'
|
||||
}
|
||||
),
|
||||
description: locale.__('common.no_permissions_description', {
|
||||
PERMISSIONS: 'VIEW_CHANNEL, SEND_MESSAGES, MANAGE_CHANNELS'
|
||||
}),
|
||||
user: data.getUser()
|
||||
});
|
||||
},
|
||||
@@ -80,7 +78,7 @@ export default class Say extends DiscordModule {
|
||||
!message.member.permissions.has([
|
||||
PermissionsBitField.Flags.ViewChannel,
|
||||
PermissionsBitField.Flags.SendMessages,
|
||||
PermissionsBitField.Flags.ManageChannels,
|
||||
PermissionsBitField.Flags.ManageChannels
|
||||
])
|
||||
)
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
|
||||
@@ -53,7 +53,14 @@ export default async (data: HybridInteractionMessage, args: any, guild: Guild, l
|
||||
if (!GuildCache) return;
|
||||
const language = GuildCache.locale;
|
||||
|
||||
if (!(await checkMemberPermissionsInGuild({ member, data, locale, permissions: [PermissionsBitField.Flags.ManageGuild] })))
|
||||
if (
|
||||
!(await checkMemberPermissionsInGuild({
|
||||
member,
|
||||
data,
|
||||
locale,
|
||||
permissions: [PermissionsBitField.Flags.ManageGuild]
|
||||
}))
|
||||
)
|
||||
return;
|
||||
|
||||
let newLanguage: string | null | undefined;
|
||||
|
||||
@@ -19,7 +19,7 @@ import { checkMemberPermissionsInGuild } from '../../utils/DiscordPermission';
|
||||
const EMBEDS = {
|
||||
PREFIX_INFO: (data: HybridInteractionMessage, locale: I18n, currentPrefix: string) => {
|
||||
return makeInfoEmbed({
|
||||
title: locale.__('settings_prefix.info', { PREFIX: currentPrefix}),
|
||||
title: locale.__('settings_prefix.info', { PREFIX: currentPrefix }),
|
||||
description: locale.__('settings_prefix.info_description'),
|
||||
user: data.getUser()
|
||||
});
|
||||
@@ -52,10 +52,17 @@ export default async (data: HybridInteractionMessage, args: any, guild: Guild, l
|
||||
if (!member) return;
|
||||
|
||||
const GuildCache = await Cache.getCachedGuild(guild.id);
|
||||
if (!GuildCache) return;
|
||||
if (!GuildCache) return;
|
||||
const prefix = GuildCache.prefix;
|
||||
|
||||
if (!(await checkMemberPermissionsInGuild({ member, data, locale, permissions: [PermissionsBitField.Flags.ManageGuild] })))
|
||||
if (
|
||||
!(await checkMemberPermissionsInGuild({
|
||||
member,
|
||||
data,
|
||||
locale,
|
||||
permissions: [PermissionsBitField.Flags.ManageGuild]
|
||||
}))
|
||||
)
|
||||
return;
|
||||
|
||||
let newPrefix: string | null | undefined;
|
||||
@@ -70,7 +77,8 @@ export default async (data: HybridInteractionMessage, args: any, guild: Guild, l
|
||||
__name.shift();
|
||||
_name = __name.join(' ');
|
||||
newPrefix = _name;
|
||||
} else if (data.isApplicationCommand()) newPrefix = data.getSlashCommand().options.get('prefix', true).value?.toString();
|
||||
} else if (data.isApplicationCommand())
|
||||
newPrefix = data.getSlashCommand().options.get('prefix', true).value?.toString();
|
||||
|
||||
if (!newPrefix)
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
@@ -82,7 +90,10 @@ export default async (data: HybridInteractionMessage, args: any, guild: Guild, l
|
||||
embeds: [EMBEDS.PREFIX_TOO_LONG(data, locale)]
|
||||
});
|
||||
|
||||
if (newPrefix.startsWith(`<@!${DiscordProvider.client.user?.id}>`) || newPrefix.startsWith(`<@${DiscordProvider.client.user?.id}>`))
|
||||
if (
|
||||
newPrefix.startsWith(`<@!${DiscordProvider.client.user?.id}>`) ||
|
||||
newPrefix.startsWith(`<@${DiscordProvider.client.user?.id}>`)
|
||||
)
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [EMBEDS.PREFIX_IS_MENTION(data, locale)]
|
||||
});
|
||||
|
||||
@@ -104,29 +104,49 @@ export const setEnableServiceAnnouncement = async (
|
||||
let member = data.getMember();
|
||||
if (!member) return;
|
||||
|
||||
if (!(await checkMemberPermissionsInGuild({ member, data, locale, permissions: [PermissionsBitField.Flags.Administrator] })))
|
||||
if (
|
||||
!(await checkMemberPermissionsInGuild({
|
||||
member,
|
||||
data,
|
||||
locale,
|
||||
permissions: [PermissionsBitField.Flags.Administrator]
|
||||
}))
|
||||
)
|
||||
return;
|
||||
|
||||
let GuildCache = await Cache.getCachedGuild(guild.id);
|
||||
if(!GuildCache) return;
|
||||
if (!GuildCache) return;
|
||||
|
||||
let newStatus: string | null | undefined;
|
||||
if (data.isMessage()) {
|
||||
let _name: string;
|
||||
if (typeof args[1] === 'undefined')
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [await EMBEDS.NO_SERVICE_ANNOUNCEMENT_STATUS_PROVIDED(data, locale, GuildCache.ServiceAnnouncement_Enabled)]
|
||||
embeds: [
|
||||
await EMBEDS.NO_SERVICE_ANNOUNCEMENT_STATUS_PROVIDED(
|
||||
data,
|
||||
locale,
|
||||
GuildCache.ServiceAnnouncement_Enabled
|
||||
)
|
||||
]
|
||||
});
|
||||
|
||||
let __name = args;
|
||||
__name.shift();
|
||||
_name = __name.join(' ');
|
||||
newStatus = _name;
|
||||
} else if (data.isApplicationCommand()) newStatus = data.getSlashCommand().options.get('status', true).value?.toString();
|
||||
} else if (data.isApplicationCommand())
|
||||
newStatus = data.getSlashCommand().options.get('status', true).value?.toString();
|
||||
|
||||
if (!newStatus)
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [await EMBEDS.NO_SERVICE_ANNOUNCEMENT_STATUS_PROVIDED(data, locale, GuildCache.ServiceAnnouncement_Enabled)]
|
||||
embeds: [
|
||||
await EMBEDS.NO_SERVICE_ANNOUNCEMENT_STATUS_PROVIDED(
|
||||
data,
|
||||
locale,
|
||||
GuildCache.ServiceAnnouncement_Enabled
|
||||
)
|
||||
]
|
||||
});
|
||||
|
||||
if (!['true', 'false', 'yes', 'no', 'y', 'n', 'enable', 'disable'].includes(newStatus.toLowerCase()))
|
||||
@@ -182,7 +202,14 @@ export const setServiceAnnouncementChannel = async (
|
||||
let member = data.getMember();
|
||||
if (!member) return;
|
||||
|
||||
if (!(await checkMemberPermissionsInGuild({ member, data, locale, permissions: [PermissionsBitField.Flags.Administrator] })))
|
||||
if (
|
||||
!(await checkMemberPermissionsInGuild({
|
||||
member,
|
||||
data,
|
||||
locale,
|
||||
permissions: [PermissionsBitField.Flags.Administrator]
|
||||
}))
|
||||
)
|
||||
return;
|
||||
|
||||
let channel;
|
||||
@@ -213,7 +240,9 @@ export const setServiceAnnouncementChannel = async (
|
||||
});
|
||||
|
||||
if (
|
||||
!data.getGuild()?.members.me?.permissionsIn(TargetChannel)
|
||||
!data
|
||||
.getGuild()
|
||||
?.members.me?.permissionsIn(TargetChannel)
|
||||
.has([PermissionsBitField.Flags.SendMessages, PermissionsBitField.Flags.ViewChannel])
|
||||
)
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
import {
|
||||
Message,
|
||||
CommandInteraction,
|
||||
Guild,
|
||||
PermissionsBitField,
|
||||
PermissionResolvable
|
||||
} from 'discord.js';
|
||||
import { Message, CommandInteraction, Guild, PermissionsBitField, PermissionResolvable } from 'discord.js';
|
||||
import { I18n } from 'i18n';
|
||||
|
||||
import DiscordProvider from '../../providers/Discord';
|
||||
@@ -24,26 +18,26 @@ import * as ServiceAnnouncementModule from './ServiceAnnouncement';
|
||||
|
||||
export const COMMON_EMBEDS = {
|
||||
MEMBER_NO_PERMISSION: (data: HybridInteractionMessage, locale: I18n, permissions: PermissionResolvable[]) => {
|
||||
|
||||
let allPermissions = [];
|
||||
for(const value of permissions) {
|
||||
for (const value of permissions) {
|
||||
allPermissions.push(new PermissionsBitField(value).toArray());
|
||||
}
|
||||
return makeErrorEmbed({
|
||||
title: locale.__('common.member_no_permissions'),
|
||||
description: locale.__('common.member_no_permissions_description', { PERMISSIONS: allPermissions.join(', ')}),
|
||||
description: locale.__('common.member_no_permissions_description', {
|
||||
PERMISSIONS: allPermissions.join(', ')
|
||||
}),
|
||||
user: data.getUser()
|
||||
});
|
||||
},
|
||||
BOT_NO_PERMISSION: (data: HybridInteractionMessage, locale: I18n, permissions: PermissionResolvable[]) => {
|
||||
|
||||
let allPermissions = [];
|
||||
for(const value of permissions) {
|
||||
for (const value of permissions) {
|
||||
allPermissions.push(new PermissionsBitField(value).toArray());
|
||||
}
|
||||
return makeErrorEmbed({
|
||||
title: locale.__('common.bot_no_permissions'),
|
||||
description: locale.__('common.bot_no_permissions_description', { PERMISSIONS: allPermissions.join(', ')}),
|
||||
description: locale.__('common.bot_no_permissions_description', { PERMISSIONS: allPermissions.join(', ') }),
|
||||
user: data.getUser()
|
||||
});
|
||||
},
|
||||
@@ -55,7 +49,7 @@ export const COMMON_EMBEDS = {
|
||||
user: data.getUser()
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const EMBEDS = {
|
||||
SETTINGS_INFO: (data: HybridInteractionMessage, locale: I18n, guild: Guild) => {
|
||||
@@ -68,7 +62,7 @@ const EMBEDS = {
|
||||
fields: [
|
||||
{
|
||||
name: locale.__('common.available_args'),
|
||||
value: locale.__('settings.valid_args'),
|
||||
value: locale.__('settings.valid_args')
|
||||
}
|
||||
],
|
||||
user: data.getUser()
|
||||
|
||||
@@ -23,15 +23,16 @@ const EMBEDS = {
|
||||
{
|
||||
name: `🌐 ${locale.__('stats.users')}`,
|
||||
value: `${locale.__('stats.x_servers', { COUNT: totalServers.toString() })}\n${locale.__(
|
||||
'stats.x_users', { COUNT: totalUsers.toString()}
|
||||
'stats.x_users',
|
||||
{ COUNT: totalUsers.toString() }
|
||||
)}`,
|
||||
inline: true
|
||||
},
|
||||
{
|
||||
name: `🟢 ${locale.__('stats.uptime_since')}`,
|
||||
value: `${locale.__('stats.server_uptime_x', {TIME: `<t:${systemUptime.toString()}:R>`})}\n${locale.__(
|
||||
'stats.process_uptime_x', { TIME: `<t:${processUptime.toString()}:R>`}
|
||||
)}`,
|
||||
value: `${locale.__('stats.server_uptime_x', {
|
||||
TIME: `<t:${systemUptime.toString()}:R>`
|
||||
})}\n${locale.__('stats.process_uptime_x', { TIME: `<t:${processUptime.toString()}:R>` })}`,
|
||||
inline: true
|
||||
}
|
||||
],
|
||||
|
||||
@@ -13,11 +13,15 @@ const EMBEDS = {
|
||||
const user = data.getUser();
|
||||
let message;
|
||||
if (Environment.get().SUPPORT_URL)
|
||||
message = locale.__('support.info', { BOT_NAME: DiscordProvider.client.user!.username, LINK: Environment.get().SUPPORT_URL});
|
||||
message = locale.__('support.info', {
|
||||
BOT_NAME: DiscordProvider.client.user!.username,
|
||||
LINK: Environment.get().SUPPORT_URL
|
||||
});
|
||||
|
||||
return makeInfoEmbed({
|
||||
title: locale.__('support.title'),
|
||||
description: message || locale.__('support.not_available', { BOT_NAME: DiscordProvider.client.user!.username}),
|
||||
description:
|
||||
message || locale.__('support.not_available', { BOT_NAME: DiscordProvider.client.user!.username }),
|
||||
user
|
||||
});
|
||||
}
|
||||
@@ -46,7 +50,7 @@ export default class Support extends DiscordModule {
|
||||
embeds: [EMBEDS.SUPPORT_INFO(data, locale)]
|
||||
});
|
||||
|
||||
if(Environment.get().SUPPORT_URL)
|
||||
if (Environment.get().SUPPORT_URL)
|
||||
await sendHybridInteractionMessageResponse(data, {
|
||||
content: Environment.get().SUPPORT_URL
|
||||
});
|
||||
|
||||
+45
-35
@@ -74,22 +74,24 @@ const EMBEDS = {
|
||||
if (user.presence?.activities) {
|
||||
for (let activity of user.presence?.activities) {
|
||||
if (activity.type === ActivityType.Custom)
|
||||
embed.addFields([{
|
||||
name: `✨ ${locale.__('userinfo.custom_status')}`,
|
||||
value: `${
|
||||
!activity.emoji
|
||||
? ''
|
||||
: `${
|
||||
activity.emoji?.identifier.startsWith('<') &&
|
||||
activity.emoji?.identifier.endsWith('>') &&
|
||||
activity.emoji?.identifier.split(':').length == 2
|
||||
? activity.emoji?.identifier.split(':')[0]
|
||||
: activity.emoji?.name
|
||||
}`
|
||||
} ${activity.state === null ? '' : activity.state}
|
||||
embed.addFields([
|
||||
{
|
||||
name: `✨ ${locale.__('userinfo.custom_status')}`,
|
||||
value: `${
|
||||
!activity.emoji
|
||||
? ''
|
||||
: `${
|
||||
activity.emoji?.identifier.startsWith('<') &&
|
||||
activity.emoji?.identifier.endsWith('>') &&
|
||||
activity.emoji?.identifier.split(':').length == 2
|
||||
? activity.emoji?.identifier.split(':')[0]
|
||||
: activity.emoji?.name
|
||||
}`
|
||||
} ${activity.state === null ? '' : activity.state}
|
||||
\u200b`,
|
||||
inline: false
|
||||
}]);
|
||||
inline: false
|
||||
}
|
||||
]);
|
||||
else {
|
||||
let title = '';
|
||||
switch (activity.type) {
|
||||
@@ -111,38 +113,46 @@ const EMBEDS = {
|
||||
}
|
||||
const startTime = activity.timestamps?.start;
|
||||
const endTime = activity.timestamps?.end;
|
||||
embed.addFields([{
|
||||
name: `${title}`,
|
||||
value: `${activity.details === null ? '' : activity.details}
|
||||
embed.addFields([
|
||||
{
|
||||
name: `${title}`,
|
||||
value: `${activity.details === null ? '' : activity.details}
|
||||
${activity.state === null ? '' : activity.state}
|
||||
${
|
||||
startTime
|
||||
? `${locale.__('userinfo.since', {TIME: `<t:${Math.round(startTime.getTime() / 1000)}:R>` })}`
|
||||
? `${locale.__('userinfo.since', {
|
||||
TIME: `<t:${Math.round(startTime.getTime() / 1000)}:R>`
|
||||
})}`
|
||||
: ''
|
||||
}${
|
||||
endTime
|
||||
? `\n${locale.__('userinfo.end', {TIME: `<t:${Math.round(endTime.getTime() / 1000)}:R>` })}`
|
||||
: ''
|
||||
}
|
||||
endTime
|
||||
? `\n${locale.__('userinfo.end', {
|
||||
TIME: `<t:${Math.round(endTime.getTime() / 1000)}:R>`
|
||||
})}`
|
||||
: ''
|
||||
}
|
||||
\u200b`,
|
||||
inline: false
|
||||
}]);
|
||||
inline: false
|
||||
}
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
embed.addFields([{
|
||||
name: `📰 ${locale.__('userinfo.user_guild_info')}`,
|
||||
value: `${
|
||||
user.joinedAt === null
|
||||
? locale.__('userinfo.join_date_unknown')
|
||||
: locale.__('userinfo.join_date', {
|
||||
TIME: `<t:${Math.round(user.joinedAt.getTime() / 1000).toString()}:R>`
|
||||
})
|
||||
}
|
||||
embed.addFields([
|
||||
{
|
||||
name: `📰 ${locale.__('userinfo.user_guild_info')}`,
|
||||
value: `${
|
||||
user.joinedAt === null
|
||||
? locale.__('userinfo.join_date_unknown')
|
||||
: locale.__('userinfo.join_date', {
|
||||
TIME: `<t:${Math.round(user.joinedAt.getTime() / 1000).toString()}:R>`
|
||||
})
|
||||
}
|
||||
${user.isGuildOwner ? `${locale.__('userinfo.guild_owner')}` : ''}
|
||||
`
|
||||
}]);
|
||||
}
|
||||
]);
|
||||
|
||||
embed.setThumbnail(user.displayAvatarURL + '?size=4096');
|
||||
embed.setAuthor({
|
||||
|
||||
+2
-14
@@ -1,11 +1,4 @@
|
||||
import {
|
||||
Message,
|
||||
ActionRowBuilder,
|
||||
ButtonBuilder,
|
||||
CommandInteraction,
|
||||
BaseInteraction,
|
||||
ButtonStyle
|
||||
} from 'discord.js';
|
||||
import { Message, ActionRowBuilder, ButtonBuilder, CommandInteraction, BaseInteraction, ButtonStyle } from 'discord.js';
|
||||
import validator from 'validator';
|
||||
import countryLookup from 'country-code-lookup';
|
||||
import { countryCodeEmoji } from 'country-code-emoji';
|
||||
@@ -14,11 +7,7 @@ import Prisma from '../providers/Prisma';
|
||||
import osuAPI from '../providers/osuAPI';
|
||||
|
||||
import DiscordModule, { HybridInteractionMessage } from '../utils/DiscordModule';
|
||||
import {
|
||||
makeInfoEmbed,
|
||||
makeErrorEmbed,
|
||||
sendHybridInteractionMessageResponse
|
||||
} from '../utils/DiscordMessage';
|
||||
import { makeInfoEmbed, makeErrorEmbed, sendHybridInteractionMessageResponse } from '../utils/DiscordMessage';
|
||||
|
||||
const EMBEDS = {
|
||||
osu_INFO: (data: HybridInteractionMessage) => {
|
||||
@@ -99,7 +88,6 @@ export default class osu extends DiscordModule {
|
||||
const Guild = await Prisma.client.guild.findFirst({ where: { id: data.getGuild()!.id } });
|
||||
if (!Guild) return;
|
||||
|
||||
|
||||
if (!osuAPI.client)
|
||||
return await sendHybridInteractionMessageResponse(data, {
|
||||
embeds: [EMBEDS.NOT_INITIALIZED(data)]
|
||||
|
||||
@@ -1,21 +1,20 @@
|
||||
import HTTP_STATUS from "../libs/HTTPStatus";
|
||||
import Logger from "../libs/Logger";
|
||||
import { ServiceError } from "./Errors";
|
||||
import HTTP_STATUS from '../libs/HTTPStatus';
|
||||
import Logger from '../libs/Logger';
|
||||
import { ServiceError } from './Errors';
|
||||
|
||||
class ExpressExceptionHandler {
|
||||
public static errorLogger(error: any, req: any, res: any, next: any) {
|
||||
if(error instanceof ServiceError) {
|
||||
if (error instanceof ServiceError) {
|
||||
res.status(error.statusCode).json({
|
||||
error: error.message
|
||||
})
|
||||
}
|
||||
else {
|
||||
});
|
||||
} else {
|
||||
res.status(HTTP_STATUS.INTERNAL_SERVER_ERROR).json({
|
||||
error: "Internal server error"
|
||||
})
|
||||
error: 'Internal server error'
|
||||
});
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default ExpressExceptionHandler;
|
||||
export default ExpressExceptionHandler;
|
||||
|
||||
@@ -10,4 +10,4 @@ enum HTTP_STATUS {
|
||||
NOT_IMPLEMENTED = 501
|
||||
}
|
||||
|
||||
export default HTTP_STATUS;
|
||||
export default HTTP_STATUS;
|
||||
|
||||
@@ -36,11 +36,7 @@ class Configuration {
|
||||
const dir = path.join(process.cwd(), 'configs/');
|
||||
if (!fs.existsSync(path.join(dir, file))) {
|
||||
fs.copyFileSync(
|
||||
path.join(
|
||||
process.cwd(),
|
||||
'configs_example/',
|
||||
`${file.replace('.json', '.example.json')}`
|
||||
),
|
||||
path.join(process.cwd(), 'configs_example/', `${file.replace('.json', '.example.json')}`),
|
||||
path.join(dir, file)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,17 @@
|
||||
import { Guild, Client, GuildMember, IntentsBitField, Interaction, Message, TextChannel, BaseGuildTextChannel, TextBasedChannelMixin, ChannelType, BaseGuildVoiceChannel, InteractionType } from 'discord.js';
|
||||
import {
|
||||
Guild,
|
||||
Client,
|
||||
GuildMember,
|
||||
IntentsBitField,
|
||||
Interaction,
|
||||
Message,
|
||||
TextChannel,
|
||||
BaseGuildTextChannel,
|
||||
TextBasedChannelMixin,
|
||||
ChannelType,
|
||||
BaseGuildVoiceChannel,
|
||||
InteractionType
|
||||
} from 'discord.js';
|
||||
|
||||
import Logger from '../libs/Logger';
|
||||
import Environment from './Environment';
|
||||
@@ -131,7 +144,11 @@ class Discord {
|
||||
if (interaction.guild) {
|
||||
thisModule.GuildInteractionCreate(interaction);
|
||||
|
||||
if (interaction.type === InteractionType.ApplicationCommand && interaction.commandName && thisModule.commandInteractionName) {
|
||||
if (
|
||||
interaction.type === InteractionType.ApplicationCommand &&
|
||||
interaction.commandName &&
|
||||
thisModule.commandInteractionName
|
||||
) {
|
||||
thisModule.GuildCommandInteractionCreate(interaction);
|
||||
if (interaction.commandName.toLowerCase() === thisModule.commandInteractionName)
|
||||
thisModule.GuildModuleCommandInteractionCreate(interaction);
|
||||
@@ -164,7 +181,8 @@ class Discord {
|
||||
|
||||
// Handling guild commands
|
||||
this.client.on('messageCreate', async (message: Message) => {
|
||||
if (!(message.channel instanceof BaseGuildTextChannel || message.channel instanceof BaseGuildVoiceChannel)) return;
|
||||
if (!(message.channel instanceof BaseGuildTextChannel || message.channel instanceof BaseGuildVoiceChannel))
|
||||
return;
|
||||
if (message.author.bot) return;
|
||||
if (typeof message.guild?.id === 'undefined') return;
|
||||
|
||||
@@ -265,7 +283,8 @@ class Discord {
|
||||
// Handling mentions
|
||||
this.client.on('messageCreate', async (message: Message) => {
|
||||
// TODO: Handle DMs commands soon
|
||||
if (!(message.channel instanceof BaseGuildTextChannel || message.channel instanceof BaseGuildVoiceChannel)) return;
|
||||
if (!(message.channel instanceof BaseGuildTextChannel || message.channel instanceof BaseGuildVoiceChannel))
|
||||
return;
|
||||
if (message.author.bot) return;
|
||||
|
||||
if (typeof message.guild?.id === 'undefined') return;
|
||||
|
||||
@@ -67,16 +67,21 @@ let tokenObject: TokenOptions = {};
|
||||
if (Environment.get().YOUTUBE_COOKIE_BASE64) {
|
||||
tokenObject.youtube = {
|
||||
cookie: Buffer.from(Environment.get().YOUTUBE_COOKIE_BASE64, 'base64').toString()
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
if (Environment.get().SPOTIFY_CLIENT_ID && Environment.get().SPOTIFY_CLIENT_SECRET && Environment.get().SPOTIFY_REFRESH_TOKEN && Environment.get().SPOTIFY_CLIENT_MARKET) {
|
||||
if (
|
||||
Environment.get().SPOTIFY_CLIENT_ID &&
|
||||
Environment.get().SPOTIFY_CLIENT_SECRET &&
|
||||
Environment.get().SPOTIFY_REFRESH_TOKEN &&
|
||||
Environment.get().SPOTIFY_CLIENT_MARKET
|
||||
) {
|
||||
tokenObject.spotify = {
|
||||
client_id: Environment.get().SPOTIFY_CLIENT_ID,
|
||||
client_secret: Environment.get().SPOTIFY_CLIENT_SECRET,
|
||||
refresh_token: Environment.get().SPOTIFY_REFRESH_TOKEN,
|
||||
market: Environment.get().SPOTIFY_CLIENT_MARKET
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
playdl.setToken(tokenObject);
|
||||
@@ -86,11 +91,10 @@ export class TrackUtils {
|
||||
if (track instanceof YouTubeVideo) {
|
||||
return track.title;
|
||||
} else if (track instanceof SpotifyTrack) {
|
||||
let artistNames = "";
|
||||
for(let artist of track.artists)
|
||||
artistNames += artist.name + " ";
|
||||
let artistNames = '';
|
||||
for (let artist of track.artists) artistNames += artist.name + ' ';
|
||||
|
||||
return `${artistNames} - ${track.name}`;;
|
||||
return `${artistNames} - ${track.name}`;
|
||||
} else {
|
||||
throw new Error('Invalid track type');
|
||||
}
|
||||
@@ -99,22 +103,20 @@ export class TrackUtils {
|
||||
if (track instanceof YouTubeVideo) {
|
||||
return track.thumbnails;
|
||||
} else if (track instanceof SpotifyTrack) {
|
||||
if (track.thumbnail)
|
||||
return [track.thumbnail];
|
||||
if (track.thumbnail) return [track.thumbnail];
|
||||
else {
|
||||
// Try to find the thumbnail again
|
||||
const result = await DiscordMusicPlayer_Instance.searchSpotifyBySpotifyLink(track);
|
||||
if(!result) return null;
|
||||
if(result.thumbnail)
|
||||
return [result.thumbnail];
|
||||
if (!result) return null;
|
||||
if (result.thumbnail) return [result.thumbnail];
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
throw new Error('Invalid track type');
|
||||
}
|
||||
}
|
||||
public static getHighestResolutionThumbnail(thumbnails: (YouTubeThumbnail[] | SpotifyThumbnail[] | null)) {
|
||||
if(!thumbnails) return null;
|
||||
public static getHighestResolutionThumbnail(thumbnails: YouTubeThumbnail[] | SpotifyThumbnail[] | null) {
|
||||
if (!thumbnails) return null;
|
||||
|
||||
return (thumbnails as any[]).reduce((prev: any, current: any) =>
|
||||
prev.height * prev.width > current.height * current.width ? prev : current
|
||||
@@ -141,7 +143,7 @@ export class SpotifyLink {
|
||||
public type: 'track' | 'playlist' | 'album';
|
||||
public url: string;
|
||||
|
||||
constructor(id: string, type: ('track' | 'playlist' | 'album'), url: string) {
|
||||
constructor(id: string, type: 'track' | 'playlist' | 'album', url: string) {
|
||||
this.id = id;
|
||||
this.type = type;
|
||||
this.url = url;
|
||||
@@ -237,7 +239,10 @@ export class DiscordMusicPlayerInstance {
|
||||
});
|
||||
}
|
||||
|
||||
public joinVoiceChannel(voiceChannel: VoiceChannel | StageChannel, textChannel?: BaseGuildTextChannel | BaseGuildVoiceChannel) {
|
||||
public joinVoiceChannel(
|
||||
voiceChannel: VoiceChannel | StageChannel,
|
||||
textChannel?: BaseGuildTextChannel | BaseGuildVoiceChannel
|
||||
) {
|
||||
const permissions = voiceChannel.permissionsFor(DiscordProvider.client.user!);
|
||||
|
||||
if (!permissions || !voiceChannel.joinable || !permissions.has(PermissionsBitField.Flags.Connect))
|
||||
@@ -269,7 +274,7 @@ export class DiscordMusicPlayerInstance {
|
||||
(oldState: VoiceConnectionState, newState: VoiceConnectionState) => {
|
||||
setTimeout(async () => {
|
||||
let guild = DiscordProvider.client.guilds.cache.get(voiceChannel.guildId);
|
||||
if(guild) {
|
||||
if (guild) {
|
||||
if (!guild?.members.me?.voice.channelId) {
|
||||
this.events.emit('disconnect', new VoiceDisconnectedEvent(this));
|
||||
}
|
||||
@@ -314,9 +319,8 @@ export class DiscordMusicPlayerInstance {
|
||||
if (!this.voiceConnection) throw new Error('No voice connection');
|
||||
|
||||
try {
|
||||
|
||||
let resource;
|
||||
if(track instanceof YouTubeVideo) {
|
||||
if (track instanceof YouTubeVideo) {
|
||||
const stream = await playdl.stream(track.url);
|
||||
resource = createAudioResource(stream.stream, {
|
||||
inputType: stream.type
|
||||
@@ -324,8 +328,7 @@ export class DiscordMusicPlayerInstance {
|
||||
this.actualPlaybackURL = track.url;
|
||||
} else {
|
||||
const search = await DiscordMusicPlayer_Instance.searchYouTubeBySpotifyLink(track);
|
||||
if(!search)
|
||||
throw new Error('Unable to find Spotify track on YouTube');
|
||||
if (!search) throw new Error('Unable to find Spotify track on YouTube');
|
||||
|
||||
const stream = await playdl.stream(search.url);
|
||||
resource = createAudioResource(stream.stream, {
|
||||
@@ -333,7 +336,7 @@ export class DiscordMusicPlayerInstance {
|
||||
});
|
||||
this.actualPlaybackURL = search.url;
|
||||
}
|
||||
|
||||
|
||||
this.player.play(resource);
|
||||
this.voiceConnection.subscribe(this.player);
|
||||
} catch (error: any) {
|
||||
@@ -359,7 +362,7 @@ export class DiscordMusicPlayerInstance {
|
||||
public clearQueue() {
|
||||
if (!this.voiceConnection) throw new Error('No voice connection');
|
||||
|
||||
if(!this.queue.track || this.queue.track.length === 0) return;
|
||||
if (!this.queue.track || this.queue.track.length === 0) return;
|
||||
this.queue.track = [this.queue.track[0]];
|
||||
}
|
||||
|
||||
@@ -367,17 +370,17 @@ export class DiscordMusicPlayerInstance {
|
||||
if (!this.voiceConnection) throw new Error('No voice connection');
|
||||
|
||||
const shuffleFixedFirst = (queue: ValidTracks[]) => {
|
||||
if(queue.length <= 2) return queue;
|
||||
|
||||
if (queue.length <= 2) return queue;
|
||||
|
||||
const fixedFirst = queue.shift();
|
||||
if(!fixedFirst) return queue;
|
||||
if (!fixedFirst) return queue;
|
||||
|
||||
queue.sort(() => Math.random() - 0.5);
|
||||
queue.unshift(fixedFirst);
|
||||
return queue;
|
||||
}
|
||||
};
|
||||
|
||||
if(!this.queue.track || this.queue.track.length === 0) return;
|
||||
if (!this.queue.track || this.queue.track.length === 0) return;
|
||||
this.queue.track = shuffleFixedFirst(this.queue.track);
|
||||
}
|
||||
|
||||
@@ -410,7 +413,7 @@ export class DiscordMusicPlayerInstance {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public isPaused() {
|
||||
return this.paused;
|
||||
}
|
||||
@@ -475,32 +478,31 @@ class DiscordMusicPlayer {
|
||||
}
|
||||
|
||||
public async searchYouTubeBySpotifyLink(spotifyLink: SpotifyLink) {
|
||||
|
||||
const track = await this.searchSpotifyBySpotifyLink(spotifyLink);
|
||||
if(!track) return;
|
||||
if (!track) return;
|
||||
|
||||
let artistNames = "";
|
||||
for(let artist of track.artists)
|
||||
artistNames += artist.name + " ";
|
||||
let artistNames = '';
|
||||
for (let artist of track.artists) artistNames += artist.name + ' ';
|
||||
|
||||
const ytSearchResult = await this.searchYouTubeByQuery(`${artistNames} ${track.name}`);
|
||||
if(!ytSearchResult) return null;
|
||||
|
||||
if (!ytSearchResult) return null;
|
||||
|
||||
return ytSearchResult[0];
|
||||
}
|
||||
|
||||
public async searchSpotifyBySpotifyLink(spotifyLink: SpotifyLink) {
|
||||
if(playdl.is_expired())
|
||||
await playdl.refreshToken();
|
||||
|
||||
if(spotifyLink.type != 'track') return;
|
||||
if (playdl.is_expired()) await playdl.refreshToken();
|
||||
|
||||
if (spotifyLink.type != 'track') return;
|
||||
|
||||
// Fetch data from spotify
|
||||
const searched: Spotify = await playdl.spotify("https://open.spotify.com/track/" + spotifyLink.id).catch((err) => {
|
||||
Logger.error(err.message);
|
||||
throw new Error('Error while searching on Spotify');
|
||||
});
|
||||
if(!(searched instanceof SpotifyTrack)) return;
|
||||
const searched: Spotify = await playdl
|
||||
.spotify('https://open.spotify.com/track/' + spotifyLink.id)
|
||||
.catch((err) => {
|
||||
Logger.error(err.message);
|
||||
throw new Error('Error while searching on Spotify');
|
||||
});
|
||||
if (!(searched instanceof SpotifyTrack)) return;
|
||||
|
||||
if (!searched) return null;
|
||||
const track = searched as unknown as SpotifyTrack;
|
||||
@@ -570,16 +572,14 @@ class DiscordMusicPlayer {
|
||||
}
|
||||
|
||||
public async getSpotifySongsInPlayList(spotifyLink: string) {
|
||||
if(playdl.is_expired())
|
||||
await playdl.refreshToken();
|
||||
if (playdl.is_expired()) await playdl.refreshToken();
|
||||
|
||||
const result = await playdl.spotify(spotifyLink).catch((err) => {
|
||||
Logger.error(err.message);
|
||||
throw new Error('Error while searching on Spotify');
|
||||
});
|
||||
|
||||
if(!(result.type == 'playlist' || result.type == 'album'))
|
||||
throw new Error("Not a spotify playlist");
|
||||
if (!(result.type == 'playlist' || result.type == 'album')) throw new Error('Not a spotify playlist');
|
||||
|
||||
return result as unknown as SpotifyPlaylist;
|
||||
}
|
||||
@@ -647,24 +647,21 @@ class DiscordMusicPlayer {
|
||||
type: 'track',
|
||||
url: query.split(/[?#]/)[0]
|
||||
};
|
||||
}
|
||||
else if (query.startsWith('https://open.spotify.com/album/')) {
|
||||
} else if (query.startsWith('https://open.spotify.com/album/')) {
|
||||
let id = query.split('/')[4].split(/[?#]/)[0];
|
||||
return {
|
||||
id: id,
|
||||
type: 'album',
|
||||
url: query.split(/[?#]/)[0]
|
||||
};
|
||||
}
|
||||
else if (query.startsWith('https://open.spotify.com/playlist/')) {
|
||||
} else if (query.startsWith('https://open.spotify.com/playlist/')) {
|
||||
let id = query.split('/')[4].split(/[?#]/)[0];
|
||||
return {
|
||||
id: id,
|
||||
type: 'playlist',
|
||||
url: query.split(/[?#]/)[0]
|
||||
};
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
throw new Error('Spotify link is invalid');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,13 +33,17 @@ class Environment {
|
||||
// PRIVATE_BOT Checks
|
||||
if (this.get().PRIVATE_BOT.toLowerCase() != 'true' && this.get().PRIVATE_BOT.toLowerCase() != 'false')
|
||||
throw new Error('.env PRIVATE_BOT must be either "true" or "false"');
|
||||
|
||||
|
||||
// SUPPORT_URL Checks
|
||||
if (this.get().SUPPORT_URL && !validator.isURL(this.get().SUPPORT_URL))
|
||||
throw new Error('.env SUPPORT_URL is not a valid URL');
|
||||
|
||||
// WEB_HOST Checks
|
||||
if (this.get().WEB_HOST && this.get().WEB_HOST.toLowerCase() != 'localhost' && !validator.isIP(this.get().WEB_HOST))
|
||||
if (
|
||||
this.get().WEB_HOST &&
|
||||
this.get().WEB_HOST.toLowerCase() != 'localhost' &&
|
||||
!validator.isIP(this.get().WEB_HOST)
|
||||
)
|
||||
throw new Error('.env WEB_HOST must be either localhost or a valid IP address');
|
||||
|
||||
// WEB_PORT Checks
|
||||
@@ -68,10 +72,10 @@ class Environment {
|
||||
const YOUTUBE_COOKIE_BASE64 = process.env.YOUTUBE_COOKIE_BASE64;
|
||||
|
||||
const SPOTIFY_CLIENT_ID = process.env.SPOTIFY_CLIENT_ID;
|
||||
const SPOTIFY_CLIENT_SECRET= process.env.SPOTIFY_CLIENT_SECRET;
|
||||
const SPOTIFY_REFRESH_TOKEN= process.env.SPOTIFY_REFRESH_TOKEN;
|
||||
const SPOTIFY_CLIENT_MARKET= process.env.SPOTIFY_CLIENT_MARKET;
|
||||
|
||||
const SPOTIFY_CLIENT_SECRET = process.env.SPOTIFY_CLIENT_SECRET;
|
||||
const SPOTIFY_REFRESH_TOKEN = process.env.SPOTIFY_REFRESH_TOKEN;
|
||||
const SPOTIFY_CLIENT_MARKET = process.env.SPOTIFY_CLIENT_MARKET;
|
||||
|
||||
return {
|
||||
NODE_ENV,
|
||||
|
||||
|
||||
+15
-18
@@ -1,53 +1,50 @@
|
||||
import express from 'express';
|
||||
import cors from 'cors';
|
||||
|
||||
import Logger from "../libs/Logger";
|
||||
import Environment from "./Environment";
|
||||
import Logger from '../libs/Logger';
|
||||
import Environment from './Environment';
|
||||
|
||||
import ExpressException from '../exception/ExpressException';
|
||||
import Routes from './Routes';
|
||||
|
||||
class Express {
|
||||
|
||||
public server: any;
|
||||
public express: express.Application;
|
||||
|
||||
constructor () {
|
||||
constructor() {
|
||||
this.server = null;
|
||||
this.express = express();
|
||||
}
|
||||
|
||||
public init(): void {
|
||||
|
||||
this.mountMiddlewares();
|
||||
this.mountRoutes();
|
||||
this.mountRoutes();
|
||||
this.express = this.express.use(ExpressException.errorLogger);
|
||||
|
||||
this.server = this.express.listen(Environment.get().WEB_PORT, Environment.get().WEB_HOST, () => {
|
||||
Logger.log('info', `Express Webserver listening at ${Environment.get().WEB_HOST}:${Environment.get().WEB_PORT}`);
|
||||
Logger.log(
|
||||
'info',
|
||||
`Express Webserver listening at ${Environment.get().WEB_HOST}:${Environment.get().WEB_PORT}`
|
||||
);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public end(): void {
|
||||
if(this.server)
|
||||
this.server.close();
|
||||
if (this.server) this.server.close();
|
||||
}
|
||||
|
||||
private mountRoutes (): void {
|
||||
private mountRoutes(): void {
|
||||
this.express = Routes.mountAPI(this.express);
|
||||
this.express = Routes.mountWeb(this.express);
|
||||
}
|
||||
|
||||
private mountMiddlewares (): void {
|
||||
this.express = Routes.mountWeb(this.express);
|
||||
}
|
||||
|
||||
private mountMiddlewares(): void {
|
||||
//this.express = RateLimit.init(this.express);
|
||||
this.express = this.express.use(cors());
|
||||
|
||||
//This always have to be at the bottom!
|
||||
this.express = this.express.use(express.json());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
export default new Express();
|
||||
export default new Express();
|
||||
|
||||
@@ -3,7 +3,6 @@ import Logger from '../libs/Logger';
|
||||
import apiv1Router from '../routes/API/v1';
|
||||
|
||||
class Routes {
|
||||
|
||||
public mountWeb(_express: express.Application): Application {
|
||||
Logger.log('info', 'Mounting Web routes');
|
||||
return _express;
|
||||
@@ -16,7 +15,6 @@ class Routes {
|
||||
|
||||
return _express;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default new Routes;
|
||||
export default new Routes();
|
||||
|
||||
@@ -1,20 +1,18 @@
|
||||
import * as express from 'express';
|
||||
import Environment from '../../providers/Environment'
|
||||
import Environment from '../../providers/Environment';
|
||||
|
||||
import HealthCheck from '../../controllers/API/v1/HealthCheck';
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
let isDevEnv = (req: any, res: any, next: any) => {
|
||||
if(Environment.get().NODE_ENV == 'development') {
|
||||
if (Environment.get().NODE_ENV == 'development') {
|
||||
return next();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return res.sendStatus(403);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
router.get('/health', HealthCheck.perform);
|
||||
|
||||
export default router;
|
||||
export default router;
|
||||
|
||||
@@ -6,7 +6,7 @@ import Locale from '../providers/Locale';
|
||||
|
||||
export async function getGuildLocale(id: Snowflake): Promise<I18n> {
|
||||
const cachedGuild = await Cache.getCachedGuild(id);
|
||||
if (!cachedGuild) return Locale.getLocaleProvider("en");
|
||||
if (!cachedGuild) return Locale.getLocaleProvider('en');
|
||||
|
||||
const LocaleProvider = Locale.getLocaleProvider(cachedGuild.locale);
|
||||
return LocaleProvider;
|
||||
@@ -14,4 +14,4 @@ export async function getGuildLocale(id: Snowflake): Promise<I18n> {
|
||||
|
||||
export default {
|
||||
getGuildLocale
|
||||
}
|
||||
};
|
||||
|
||||
@@ -3,9 +3,7 @@ import Environment from '../providers/Environment';
|
||||
|
||||
class Users {
|
||||
public static isDeveloper(user: User | Snowflake) {
|
||||
|
||||
if(!Environment.get().DEVELOPERS)
|
||||
return false;
|
||||
if (!Environment.get().DEVELOPERS) return false;
|
||||
|
||||
const developers: Snowflake[] = Environment.get().DEVELOPER_IDS.split(',');
|
||||
let userID;
|
||||
|
||||
@@ -44,13 +44,9 @@ export default class DiscordModule {
|
||||
GuildModuleInteractionCreate(interaction: Interaction): void | Promise<void | any> {}
|
||||
|
||||
GuildCommandInteractionCreate(interaction: CommandInteraction): void | Promise<void | any> {}
|
||||
GuildModuleCommandInteractionCreate(
|
||||
interaction: CommandInteraction
|
||||
): void | Promise<void | any> {}
|
||||
GuildModuleCommandInteractionCreate(interaction: CommandInteraction): void | Promise<void | any> {}
|
||||
|
||||
GuildSelectMenuInteractionCreate(
|
||||
interaction: SelectMenuInteraction
|
||||
): void | Promise<void | any> {}
|
||||
GuildSelectMenuInteractionCreate(interaction: SelectMenuInteraction): void | Promise<void | any> {}
|
||||
|
||||
GuildButtonInteractionCreate(interaction: ButtonInteraction): void | Promise<void | any> {}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ export async function checkBotPermissionsInGuild({
|
||||
locale?: I18n;
|
||||
}): Promise<boolean> {
|
||||
const member = guild.members.me;
|
||||
if(!member) return false;
|
||||
if (!member) return false;
|
||||
|
||||
const hasPermissions = member.permissions.has(permissions);
|
||||
|
||||
@@ -86,7 +86,7 @@ export async function checkBotPermissionsInChannel({
|
||||
locale?: I18n;
|
||||
}): Promise<boolean> {
|
||||
const member = guild.members.me;
|
||||
if(!member) return false;
|
||||
if (!member) return false;
|
||||
|
||||
const hasPermissions = member.permissionsIn(channel).has(permissions);
|
||||
|
||||
@@ -96,4 +96,4 @@ export async function checkBotPermissionsInChannel({
|
||||
});
|
||||
|
||||
return hasPermissions;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user