Updated music interface to the newest version of TeaSpeak
This commit is contained in:
parent
09ae0503b6
commit
17d543e711
3 changed files with 11 additions and 13 deletions
|
@ -788,7 +788,7 @@ class MusicClientProperties extends ClientProperties {
|
|||
}
|
||||
|
||||
class MusicClientPlayerInfo {
|
||||
botid: number = 0;
|
||||
bot_id: number = 0;
|
||||
player_state: number = 0;
|
||||
|
||||
player_buffered_index: number = 0;
|
||||
|
@ -870,7 +870,7 @@ class MusicClientEntry extends ClientEntry {
|
|||
createInputModal("Please enter the URL", "URL:", text => true, result => {
|
||||
if(result) {
|
||||
this.channelTree.client.serverConnection.sendCommand("musicbotqueueadd", {
|
||||
botid: this.properties.client_database_id,
|
||||
bot_id: this.properties.client_database_id,
|
||||
type: "yt", //Its a hint not a force!
|
||||
url: result
|
||||
}).catch(error => {
|
||||
|
@ -937,7 +937,7 @@ class MusicClientEntry extends ClientEntry {
|
|||
Modals.spawnYesNo("Are you sure?", $.spawn("div").append(tag), result => {
|
||||
if(result) {
|
||||
this.channelTree.client.serverConnection.sendCommand("musicbotdelete", {
|
||||
botid: this.properties.client_database_id
|
||||
bot_id: this.properties.client_database_id
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -977,7 +977,7 @@ class MusicClientEntry extends ClientEntry {
|
|||
this._info_promise_resolve = resolve;
|
||||
});
|
||||
|
||||
this.channelTree.client.serverConnection.sendCommand("musicbotplayerinfo", {botid: this.properties.client_database_id });
|
||||
this.channelTree.client.serverConnection.sendCommand("musicbotplayerinfo", {bot_id: this.properties.client_database_id });
|
||||
return this._info_promise;
|
||||
}
|
||||
}
|
|
@ -423,7 +423,7 @@ class MusicInfoManager extends ClientInfoManager {
|
|||
button_play.click(handler => {
|
||||
if(!button_play.hasClass("active")) {
|
||||
this.handle.handle.serverConnection.sendCommand("musicbotplayeraction", {
|
||||
botid: bot.properties.client_database_id,
|
||||
bot_id: bot.properties.client_database_id,
|
||||
action: 1
|
||||
}).then(updated => this.triggerUpdate()).catch(error => {
|
||||
createErrorModal("Failed to execute play", MessageHelper.formatMessage("Failed to execute play.<br>{}", error)).open();
|
||||
|
@ -436,7 +436,7 @@ class MusicInfoManager extends ClientInfoManager {
|
|||
button_pause.click(handler => {
|
||||
if(!button_pause.hasClass("active")) {
|
||||
this.handle.handle.serverConnection.sendCommand("musicbotplayeraction", {
|
||||
botid: bot.properties.client_database_id,
|
||||
bot_id: bot.properties.client_database_id,
|
||||
action: 2
|
||||
}).then(updated => this.triggerUpdate()).catch(error => {
|
||||
createErrorModal("Failed to execute pause", MessageHelper.formatMessage("Failed to execute pause.<br>{}", error)).open();
|
||||
|
@ -448,7 +448,7 @@ class MusicInfoManager extends ClientInfoManager {
|
|||
});
|
||||
button_stop.click(handler => {
|
||||
this.handle.handle.serverConnection.sendCommand("musicbotplayeraction", {
|
||||
botid: bot.properties.client_database_id,
|
||||
bot_id: bot.properties.client_database_id,
|
||||
action: 0
|
||||
}).then(updated => this.triggerUpdate()).catch(error => {
|
||||
createErrorModal("Failed to execute stop", MessageHelper.formatMessage("Failed to execute stop.<br>{}", error)).open();
|
||||
|
@ -471,7 +471,7 @@ class MusicInfoManager extends ClientInfoManager {
|
|||
{ /* Button functions */
|
||||
_frame.find(".btn-forward").click(() => {
|
||||
this.handle.handle.serverConnection.sendCommand("musicbotplayeraction", {
|
||||
botid: bot.properties.client_database_id,
|
||||
bot_id: bot.properties.client_database_id,
|
||||
action: 3
|
||||
}).then(updated => this.triggerUpdate()).catch(error => {
|
||||
createErrorModal("Failed to execute forward", "Failed to execute pause.<br>{}".format(error)).open();
|
||||
|
@ -480,7 +480,7 @@ class MusicInfoManager extends ClientInfoManager {
|
|||
});
|
||||
_frame.find(".btn-rewind").click(() => {
|
||||
this.handle.handle.serverConnection.sendCommand("musicbotplayeraction", {
|
||||
botid: bot.properties.client_database_id,
|
||||
bot_id: bot.properties.client_database_id,
|
||||
action: 4
|
||||
}).then(updated => this.triggerUpdate()).catch(error => {
|
||||
createErrorModal("Failed to execute rewind", "Failed to execute pause.<br>{}".format(error)).open();
|
||||
|
@ -535,7 +535,7 @@ class MusicInfoManager extends ClientInfoManager {
|
|||
|
||||
let current_timestamp = info.player_replay_index + Date.now() - timestamp;
|
||||
this.handle.handle.serverConnection.sendCommand("musicbotplayeraction", {
|
||||
botid: bot.properties.client_database_id,
|
||||
bot_id: bot.properties.client_database_id,
|
||||
action: current_timestamp > target_timestamp ? 6 : 5,
|
||||
units: current_timestamp < target_timestamp ? target_timestamp - current_timestamp : current_timestamp - target_timestamp
|
||||
}).then(() => this.triggerUpdate()).catch(error => {
|
||||
|
|
|
@ -71,7 +71,7 @@ class ModalProperties {
|
|||
}
|
||||
}
|
||||
|
||||
class Modal extends EventTarget {
|
||||
class Modal {
|
||||
private _htmlTag: JQuery;
|
||||
properties: ModalProperties;
|
||||
shown: boolean;
|
||||
|
@ -79,8 +79,6 @@ class Modal extends EventTarget {
|
|||
close_listener: (() => any)[] = [];
|
||||
|
||||
constructor(props: ModalProperties) {
|
||||
super();
|
||||
|
||||
this.properties = props;
|
||||
this.shown = false;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue