"(a|b)"
: thành phần bắt buộc, chọn giữaa
vàb
"[a|b]"
: thành phần có thể có hay không cũng được, chọn giữaa
vàb
"<a>"
: thay<a>
bằng giá trị tham số có têna
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>"
}
Mã | 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" |
Lệnh remove mà bị sai thì nó nhét vào lỗi 401 chứ?