Also set the Discord presence to the currently playing song.multithread-playback
parent
14492728ab
commit
4c62889ba1
@ -0,0 +1,133 @@ |
||||
/* |
||||
* Copyright (C) 2022 jimj316 |
||||
* |
||||
* This program is free software: you can redistribute it and/or modify |
||||
* it under the terms of the GNU General Public License as published by |
||||
* the Free Software Foundation, either version 3 of the License, or |
||||
* (at your option) any later version. |
||||
* |
||||
* This program is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU General Public License |
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/ |
||||
package moe.nekojimi.chords; |
||||
|
||||
import java.net.URL; |
||||
import java.util.List; |
||||
import moe.nekojimi.musicsearcher.Result; |
||||
import net.dv8tion.jda.api.MessageBuilder; |
||||
import net.dv8tion.jda.api.entities.Message; |
||||
import net.dv8tion.jda.api.requests.restaction.MessageAction; |
||||
import net.dv8tion.jda.internal.entities.DataMessage; |
||||
|
||||
/** |
||||
* |
||||
* @author jimj316 |
||||
*/ |
||||
public class SongRequest |
||||
{ |
||||
|
||||
private Message requestMessage; |
||||
private Message responseMessage; |
||||
|
||||
private String query; |
||||
private URL url; |
||||
|
||||
private List<Result> searchResults; |
||||
|
||||
private Result result; |
||||
|
||||
private Song song; |
||||
|
||||
@SuppressWarnings("null") |
||||
public void respond(String text) |
||||
{ |
||||
MessageAction action = null; |
||||
|
||||
if (responseMessage == null) |
||||
{ |
||||
action = requestMessage.reply(text); |
||||
} else |
||||
{ |
||||
action = responseMessage.editMessage(text); |
||||
} |
||||
|
||||
responseMessage = action.complete(); |
||||
} |
||||
|
||||
|
||||
public List<Result> getSearchResults() |
||||
{ |
||||
return searchResults; |
||||
} |
||||
|
||||
public void setSearchResults(List<Result> searchResults) |
||||
{ |
||||
this.searchResults = searchResults; |
||||
} |
||||
|
||||
public Result getResult() |
||||
{ |
||||
return result; |
||||
} |
||||
|
||||
public void setResult(Result result) |
||||
{ |
||||
this.result = result; |
||||
} |
||||
|
||||
public Message getRequestMessage() |
||||
{ |
||||
return requestMessage; |
||||
} |
||||
|
||||
public void setRequestMessage(Message requestMessage) |
||||
{ |
||||
this.requestMessage = requestMessage; |
||||
} |
||||
|
||||
public Message getResponseMessage() |
||||
{ |
||||
return responseMessage; |
||||
} |
||||
|
||||
public void setResponseMessage(Message responseMessage) |
||||
{ |
||||
this.responseMessage = responseMessage; |
||||
} |
||||
|
||||
public String getQuery() |
||||
{ |
||||
return query; |
||||
} |
||||
|
||||
public void setQuery(String query) |
||||
{ |
||||
this.query = query; |
||||
} |
||||
|
||||
public URL getUrl() |
||||
{ |
||||
return url; |
||||
} |
||||
|
||||
public void setUrl(URL url) |
||||
{ |
||||
this.url = url; |
||||
} |
||||
|
||||
public Song getSong() |
||||
{ |
||||
return song; |
||||
} |
||||
|
||||
public void setSong(Song song) |
||||
{ |
||||
this.song = song; |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue