Updated beta1
This commit is contained in:
@@ -236,14 +236,15 @@ command_result ConnectedClient::handleCommandMusicBotPlayerInfo(Command& cmd) {
|
||||
result["bot_id"] = bot->getClientDatabaseId();
|
||||
|
||||
result["player_state"] =(int) bot->player_state();
|
||||
if(bot->current_player()) {
|
||||
result["player_buffered_index"] = bot->current_player()->bufferedUntil().count();
|
||||
result["player_replay_index"] = bot->current_player()->currentIndex().count();
|
||||
result["player_max_index"] = bot->current_player()->length().count();
|
||||
result["player_seekable"] = bot->current_player()->seek_supported();
|
||||
auto player = bot->current_player();
|
||||
if(player) {
|
||||
result["player_buffered_index"] = player->bufferedUntil().count();
|
||||
result["player_replay_index"] = player->currentIndex().count();
|
||||
result["player_max_index"] = player->length().count();
|
||||
result["player_seekable"] = player->seek_supported();
|
||||
|
||||
result["player_title"] = bot->current_player()->songTitle();
|
||||
result["player_description"] = bot->current_player()->songDescription();
|
||||
result["player_title"] = player->songTitle();
|
||||
result["player_description"] = player->songDescription();
|
||||
} else {
|
||||
result["player_buffered_index"] = 0;
|
||||
result["player_replay_index"] = 0;
|
||||
@@ -270,6 +271,7 @@ command_result ConnectedClient::handleCommandMusicBotPlayerAction(Command& cmd)
|
||||
if(!bot) return command_result{error::music_invalid_id};
|
||||
ACTION_REQUIRES_PERMISSION(permission::i_client_music_play_power, bot->calculate_permission(permission::i_client_music_needed_play_power, bot->getChannelId()), this->getChannelId());
|
||||
|
||||
auto player = bot->current_player();
|
||||
if(cmd["action"] == 0) {
|
||||
bot->stopMusic();
|
||||
} else if(cmd["action"] == 1) {
|
||||
@@ -281,11 +283,11 @@ command_result ConnectedClient::handleCommandMusicBotPlayerAction(Command& cmd)
|
||||
} else if(cmd["action"] == 4) {
|
||||
bot->rewindSong();
|
||||
} else if(cmd["action"] == 5) {
|
||||
if(!bot->current_player()) return command_result{error::music_no_player};
|
||||
bot->current_player()->forward(::music::PlayerUnits(cmd["units"].as<int64_t>()));
|
||||
if(!player) return command_result{error::music_no_player};
|
||||
player->forward(::music::PlayerUnits(cmd["units"].as<int64_t>()));
|
||||
} else if(cmd["action"] == 6) {
|
||||
if(!bot->current_player()) return command_result{error::music_no_player};
|
||||
bot->current_player()->rewind(::music::PlayerUnits(cmd["units"].as<int64_t>()));
|
||||
if(!player) return command_result{error::music_no_player};
|
||||
player->rewind(::music::PlayerUnits(cmd["units"].as<int64_t>()));
|
||||
} else return command_result{error::music_invalid_action};
|
||||
|
||||
return command_result{error::ok};
|
||||
|
||||
Reference in New Issue
Block a user