Skip to content

Commit 7026023

Browse files
Fix bug with /youtube stalling when inputting spaces
1 parent abbb3ff commit 7026023

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/java/technobot/commands/utility/YouTubeCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public YouTubeCommand(TechnoBot bot) {
4343
@Override
4444
public void execute(SlashCommandInteractionEvent event) {
4545
event.deferReply().queue();
46-
String channel = event.getOption("channel").getAsString();
46+
String channel = event.getOption("channel").getAsString().replace(" ", "+");
4747
String url = "https://www.googleapis.com/youtube/v3/search?part=snippet&type=channel&maxResults=1&q="+channel+"&key="+YOUTUBE_TOKEN;
4848

4949
// Asynchronous API call

0 commit comments

Comments
 (0)