Skip to content

Instantly share code, notes, and snippets.

@SpikeVN
Last active February 25, 2022 04:01
Show Gist options
  • Save SpikeVN/ecb0b09fc7e08178f5eff5fa0ce44c87 to your computer and use it in GitHub Desktop.
Save SpikeVN/ecb0b09fc7e08178f5eff5fa0ce44c87 to your computer and use it in GitHub Desktop.

GTTT®NQDB™ Documentation

một sản phẩm của SS_GANG® Dev Team

Quy ước

  • "(a|b)": thành phần bắt buộc, chọn giữa ab
  • "[a|b]": thành phần có thể có hay không cũng được, chọn giữa ab
  • "<a>": thay <a> bằng giá trị tham số có tên a

JSON API

Plugin muốn gửi dữ liệu về Bot cần tuân theo API sau:

  • Plugin:
{
    "from": "server",
    "command": "music.(play|pause|stop)",
    "payload": {
        "playerName": "<tên_người_chơi>",
        "discordID": "<id_discord_của_ng_dùng>",
        "query": "<thông_tin_yêu_cầu>"
    }
}
  • Bot:
{
    "code": "<code>",
    "response": [
        {
            "title": "",
            "url": "",
            "description": "",
            "uploadChannel": "",
            "uploadDate": ""
        }
    ]
}

hoặc

{
    "code": "<code>",
    "response": "<trạng_thái>"
}

Bảng tra trạng thái

Nghĩa là response
200 Thành công. Bot đang phát bài nhạc được yêu cầu. "Success"
201 Đã tìm kiếm xong. Đợi người dùng chọn 1/5 kết quả [video tìm thấy]
202 Tạm dừng/tiếp tục bài nhạc thành công "Paused/resumed successfully"
400 Người dùng chưa vào voice "You need to be in a voice channel to do that"
401 Không tìm thấy video "Video not found"
402 discordID nhận được không hợp lệ "Invalid discordID"
403 Người dùng cố dừng bài nhạc nhưng bot hiện không phát gì cả "Not playing anything"
404 JSON request không hợp lệ "Invalid JSON request"
500 Lỗi nói chung <Exception>
501 Lỗi chơi video "Unable to play video"
@viet2k7tapcode
Copy link

Lệnh remove mà bị sai thì nó nhét vào lỗi 401 chứ?

@SpikeVN
Copy link
Author

SpikeVN commented Feb 24, 2022

@viet2k7tapcode làm gì có lệnh remove

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment