forked from ChomeNS/chomens-bot-java
ig fix music filename mabe mabe
This commit is contained in:
parent
2b9d29e52e
commit
d133cd7d13
4 changed files with 16 additions and 19 deletions
2
.idea/.gitignore
vendored
2
.idea/.gitignore
vendored
|
@ -1,3 +1,3 @@
|
|||
# Default ignored files
|
||||
/shelf/
|
||||
/.idea3/workspace.xml
|
||||
/.idea/workspace.xml
|
||||
|
|
|
@ -4,8 +4,9 @@
|
|||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="50f184fa-7bed-4956-baf5-7586ff26ea08" name="Changes" comment="1.19.4 + add stuff (kinda broken ..,,.)">
|
||||
<list default="true" id="50f184fa-7bed-4956-baf5-7586ff26ea08" name="Changes" comment="add/improve/fix stuff ig mabe mabe mabe useCore!1!1!">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/commands/MusicCommand.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/land/chipmunk/chayapak/chomens_bot/commands/MusicCommand.java" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
@ -94,13 +95,6 @@
|
|||
<option name="presentableId" value="Default" />
|
||||
<updated>1680245437032</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00038" summary="add sus autocomplete (works, tested)">
|
||||
<created>1681003794277</created>
|
||||
<option name="number" value="00038" />
|
||||
<option name="presentableId" value="LOCAL-00038" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1681003794277</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00039" summary="actually fix a small (or big?) bug">
|
||||
<created>1681014542708</created>
|
||||
<option name="number" value="00039" />
|
||||
|
@ -437,7 +431,14 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1681984879688</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="87" />
|
||||
<task id="LOCAL-00087" summary="add/improve/fix stuff ig mabe mabe mabe useCore!1!1!">
|
||||
<created>1682060041610</created>
|
||||
<option name="number" value="00087" />
|
||||
<option name="presentableId" value="LOCAL-00087" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1682060041611</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="88" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
|
@ -452,7 +453,6 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="remove the time from cb" />
|
||||
<MESSAGE value="ig change to `ChomeNS Bot` in .name yup" />
|
||||
<MESSAGE value="hopefully fix the core problem?" />
|
||||
<MESSAGE value="maybe patch the sus" />
|
||||
|
@ -477,7 +477,8 @@
|
|||
<MESSAGE value="add a working (or not?) stereo to music" />
|
||||
<MESSAGE value="improve and fix cmd handler (first commit on arch) yup this is my first commit on arch linux,.,.,..,.,., yes i use arch btw :sunglasses:" />
|
||||
<MESSAGE value="1.19.4 + add stuff (kinda broken ..,,.)" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="1.19.4 + add stuff (kinda broken ..,,.)" />
|
||||
<MESSAGE value="add/improve/fix stuff ig mabe mabe mabe useCore!1!1!" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="add/improve/fix stuff ig mabe mabe mabe useCore!1!1!" />
|
||||
</component>
|
||||
<component name="XSLT-Support.FileAssociations.UIState">
|
||||
<expand />
|
||||
|
|
|
@ -393,22 +393,22 @@ public class MusicCommand implements Command {
|
|||
public Component info (CommandContext context) {
|
||||
final Bot bot = context.bot();
|
||||
final Song currentSong = bot.music().currentSong();
|
||||
final String fileName = bot.music().fileName();
|
||||
|
||||
if (currentSong == null) return Component.text("No song is currently playing").color(NamedTextColor.RED);
|
||||
|
||||
// ig very code yup
|
||||
final Component title = currentSong.name;
|
||||
final String songAuthor = currentSong.songAuthor == null || currentSong.songAuthor.equals("") ? "N/A" : currentSong.songAuthor;
|
||||
final String songOriginalAuthor = currentSong.songOriginalAuthor == null || currentSong.songOriginalAuthor.equals("") ? "N/A" : currentSong.songOriginalAuthor;
|
||||
final String songDescription = currentSong.songDescription == null || currentSong.songDescription.equals("") ? "N/A" : currentSong.songDescription;
|
||||
|
||||
final Component component = Component.translatable(
|
||||
"""
|
||||
Filename: %s
|
||||
Title/Filename: %s
|
||||
Author: %s
|
||||
Original author: %s
|
||||
Description: %s""",
|
||||
Component.text(fileName).color(NamedTextColor.AQUA),
|
||||
title.color(NamedTextColor.AQUA),
|
||||
Component.text(songAuthor).color(NamedTextColor.AQUA),
|
||||
Component.text(songOriginalAuthor).color(NamedTextColor.AQUA),
|
||||
Component.text(songDescription).color(NamedTextColor.AQUA)
|
||||
|
|
|
@ -34,8 +34,6 @@ public class MusicPlayerPlugin extends SessionAdapter {
|
|||
}
|
||||
}
|
||||
|
||||
@Getter private String fileName;
|
||||
|
||||
@Getter @Setter private Song currentSong;
|
||||
@Getter @Setter private LinkedList<Song> songQueue = new LinkedList<>();
|
||||
@Getter @Setter private SongLoaderThread loaderThread;
|
||||
|
@ -99,7 +97,6 @@ public class MusicPlayerPlugin extends SessionAdapter {
|
|||
bot.chat().tellraw(Component.translatable("Failed to load song: %s", loaderThread.exception.message()).color(NamedTextColor.RED));
|
||||
} else {
|
||||
songQueue.add(loaderThread.song);
|
||||
fileName = loaderThread.fileName;
|
||||
bot.chat().tellraw(Component.translatable("Added %s to the song queue", Component.empty().append(loaderThread.song.name).color(NamedTextColor.GOLD)));
|
||||
}
|
||||
loaderThread = null;
|
||||
|
@ -151,7 +148,6 @@ public class MusicPlayerPlugin extends SessionAdapter {
|
|||
if (songQueue.size() == 0) {
|
||||
stopPlaying();
|
||||
removeBossBar();
|
||||
fileName = null;
|
||||
bot.chat().tellraw(Component.text("Finished playing every song in the queue"));
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue