Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Stream Branch to Main Branch #14

Merged
merged 36 commits into from
Oct 1, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
515fda2
✨ Added Basic Stream Support for Library (Need to Add for Plugin)
PulseBeat02 Sep 23, 2021
639f79c
✨ Fixed Bug in BotConfiguration
PulseBeat02 Sep 23, 2021
dedb78a
✨ Added Stream Support for Plugin (Supposedly Working, Need to Test +…
PulseBeat02 Sep 23, 2021
bedbf94
🐛 Fixed NullPointerException + Changed Message (From Master)
PulseBeat02 Sep 23, 2021
5edc309
🐛 Fixed a Ton of Video Bugs
PulseBeat02 Sep 23, 2021
62c73e7
Merge branch 'stream' of https://github.com/MinecraftMediaLibrary/EzM…
PulseBeat02 Sep 23, 2021
d25e5a0
🐛 Added Support for All youtube-dl Videos!
PulseBeat02 Sep 24, 2021
3b234fc
✨ Worked on Discord Bot
PulseBeat02 Sep 24, 2021
29094c5
✨ Discord Bot Plays Music Now
PulseBeat02 Sep 24, 2021
7c75913
✨ Some Stream Issues... Will Fix Soon
PulseBeat02 Sep 24, 2021
f8b5bc9
Merge branch 'stream' of https://github.com/MinecraftMediaLibrary/EzM…
PulseBeat02 Sep 25, 2021
a3b1761
🐛 One Step Closer to Streams...
PulseBeat02 Sep 25, 2021
81b45be
✨ Experimental Commit
PulseBeat02 Sep 25, 2021
fec1a2f
✨ HTTP Stream Support Works!
PulseBeat02 Sep 25, 2021
6f4e913
✨ Fixed Normal Video Issue
PulseBeat02 Sep 25, 2021
e273ba9
🐛 Fixed Windows Bug + URL Component Bug
PulseBeat02 Sep 26, 2021
14ff9f6
✨ Removed Unnecessary Class
PulseBeat02 Sep 26, 2021
92566b8
✨ Added Support for More Platforms + Cleaned Up Links
PulseBeat02 Sep 26, 2021
d158eaa
Merge branch 'stream' of https://github.com/MinecraftMediaLibrary/EzM…
PulseBeat02 Sep 26, 2021
0dfab25
✨ Cleaned Up Code
PulseBeat02 Sep 27, 2021
37256bd
✨ Refactored Some Code
PulseBeat02 Sep 27, 2021
702b4d9
✨ Fixed CompletableFuture Bug - Still Many Need to Fix
PulseBeat02 Sep 28, 2021
f912584
🐛 HTTP Live Stream Bug Fixed
PulseBeat02 Sep 29, 2021
5e23422
🐛 Added Thread Dump Command + Properly Released VLC Players
PulseBeat02 Sep 29, 2021
1c76291
🐛 Patched FFmpegMediaPlayer + Linux Support Fixed
PulseBeat02 Sep 30, 2021
db5af6b
🐛 Patched FFmpegMediaPlayer Bug
PulseBeat02 Sep 30, 2021
43ce191
✨ General Logger Improvements
PulseBeat02 Sep 30, 2021
b326724
🐛 Fixed Public Port Issue on Linux
PulseBeat02 Sep 30, 2021
9c93e02
🐛 Fixed Log Output
PulseBeat02 Sep 30, 2021
79a08e3
🐛 Overrided Progress Listener
PulseBeat02 Sep 30, 2021
1856179
✨ Update README.md
PulseBeat02 Oct 1, 2021
9a6a386
🐛 Added Support for Normal Video Playback in HTTP Stream
PulseBeat02 Oct 1, 2021
05a7038
✨ Disallowed Users from Using Buggy Discord Bot Feature
PulseBeat02 Oct 1, 2021
efd543d
Merge branch 'stream' of https://github.com/MinecraftMediaLibrary/EzM…
PulseBeat02 Oct 1, 2021
bea38be
✨ Added Clauses to Switch Statement
PulseBeat02 Oct 1, 2021
fb5106a
✨ Added Licensing
PulseBeat02 Oct 1, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
✨ Discord Bot Plays Music Now
  • Loading branch information
PulseBeat02 committed Sep 24, 2021
commit 29094c598ad735251708b28e1ed7c8cbc734e2d2
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ public void disable() {
CommandUtils.unRegisterBukkitCommand(this, cmd);
}
}
if (this.mediaBot != null) {
this.mediaBot.getJDA().shutdown();
}
this.log("Good Bye :(");
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.pulsebeat02.deluxemediaplugin.discord;

import com.google.common.collect.ImmutableMap;
import io.github.pulsebeat02.deluxemediaplugin.discord.command.ConnectAudioCommand;
import io.github.pulsebeat02.deluxemediaplugin.discord.command.DiscordBaseCommand;
import io.github.pulsebeat02.deluxemediaplugin.discord.command.PlayAudioCommand;
import io.github.pulsebeat02.deluxemediaplugin.discord.command.StopAudioCommand;
Expand All @@ -23,7 +23,8 @@ public class MediaCommandListener {
public MediaCommandListener(@NotNull final MediaBot bot) {
this.bot = bot;
this.commands =
ImmutableMap.of(
Map.of(
"connect", new ConnectAudioCommand(bot),
"play", new PlayAudioCommand(bot),
"stop", new StopAudioCommand(bot));
}
Expand All @@ -45,19 +46,20 @@ public void onMessageReceivedEvent(@NotNull final MessageReceivedEvent event) {
.build())
.queue();
}
final String[] content = message.substring(prefix.length() - 1).split(" ");
this.commands.get(content[0]).execute(msg, ArrayUtils.trim(content, 1, content.length));
final String[] content = message.substring(prefix.length()).split(" ");
final DiscordBaseCommand command = this.commands.get(content[0]);
if (command != null) {
command.execute(msg, ArrayUtils.trim(content, 1, content.length));
}
}
}

private boolean canExecuteCommand(@NotNull final User user) {
final Member member = this.bot.getGuild().getMember(user);
if (member != null) {
if (member.isOwner()
return member.isOwner()
|| member.hasPermission(Permission.ADMINISTRATOR)
|| member.getRoles().stream().anyMatch(role -> role.getName().equalsIgnoreCase("DJ"))) {
return true;
}
|| member.getRoles().stream().anyMatch(role -> role.getName().equalsIgnoreCase("DJ"));
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void trackLoaded(final AudioTrack audioTrack) {
channel
.sendMessageEmbeds(
new EmbedBuilder()
.setTitle(info.title)
.setTitle(info.title, info.uri)
.addField("Author", info.author, false)
.addField(
"Playtime Length",
Expand All @@ -131,7 +131,7 @@ public void playlistLoaded(final AudioPlaylist audioPlaylist) {
channel
.sendMessageEmbeds(
new EmbedBuilder()
.setTitle(audioPlaylist.getName())
.setTitle(audioPlaylist.getName(), url)
.addField(
"Playtime Length", HOURS_MINUTES_SECONDS.format(new Date(ms)), false)
.build())
Expand All @@ -144,7 +144,7 @@ public void noMatches() {
.sendMessageEmbeds(
new EmbedBuilder()
.setTitle("Media Error")
.setDescription("Could not find song!")
.setDescription("Could not find song %s!".formatted(url))
.build())
.queue();
}
Expand Down