Skip to content

Commit

Permalink
Show song names in status messages | Fixes #22
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas Breuer committed Jan 22, 2017
1 parent d57ff5d commit 91629b7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions plugins/music.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ func (m *Music) Action(command string, content string, msg *discordgo.Message, s
// Check if the video is not too long
// Bot owners may bypass this
if !helpers.IsBotAdmin(msg.Author.ID) && match.Duration > int((65 * time.Minute).Seconds()) {
session.ChannelMessageSend(channel.ID, "Whoa that's a big video!\nPlease use something shorter :neutral_face:")
session.ChannelMessageSend(channel.ID, "Whoa `" + match.Title + "` is a big video!\nPlease use something shorter :neutral_face:")
return
}

Expand All @@ -437,7 +437,7 @@ func (m *Music) Action(command string, content string, msg *discordgo.Message, s
// Inform users
session.ChannelMessageSend(
channel.ID,
"Added to queue. Music should start soon.\nLive progress at: <https://meetkaren.xyz/music>",
"`" + match.Title + "` was added to your download-queue.\nLive progress at: <https://meetkaren.xyz/music>",
)
go m.waitForSong(channel.ID, fingerprint, match, msg, session)
return
Expand Down Expand Up @@ -468,15 +468,15 @@ func (m *Music) Action(command string, content string, msg *discordgo.Message, s
if songPresent {
session.ChannelMessageSend(
channel.ID,
"That song is already in your queue.\nLive progress at: <https://meetkaren.xyz/music>",
"`" + match.Title + "` is already in your download-queue.\nLive progress at: <https://meetkaren.xyz/music>",
)
return
}

*queue = append(*queue, match)
session.ChannelMessageSend(
channel.ID,
"Song was added to your queue but did not finish downloading yet. Wait a bit :wink:\nLive progress at: <https://meetkaren.xyz/music>",
"`" + match.Title + "` was added to your download-queue.\nLive progress at: <https://meetkaren.xyz/music>",
)
go m.waitForSong(channel.ID, fingerprint, match, msg, session)
break
Expand Down Expand Up @@ -504,7 +504,7 @@ func (m *Music) Action(command string, content string, msg *discordgo.Message, s

var results []Song
err = cursor.All(&results)
if err == rethink.ErrEmptyResult {
if err == rethink.ErrEmptyResult || len(results) == 0 {
session.ChannelMessageSend(
channel.ID,
"No results :frowning:",
Expand All @@ -513,7 +513,7 @@ func (m *Music) Action(command string, content string, msg *discordgo.Message, s
}
helpers.Relax(err)

headers := []string{"Title", "Link for !add"}
headers := []string{"Title", "Link"}
rows := make([][]string, len(results))
for i, result := range results {
rows[i] = []string{result.Title, result.URL}
Expand Down

0 comments on commit 91629b7

Please sign in to comment.