changed redditbooru function to async function

This commit is contained in:
2020-06-06 20:20:16 -05:00
parent 545591700a
commit 110c1c472f
2 changed files with 39 additions and 25 deletions

View File

@@ -63,7 +63,11 @@ func message_create (s *discordgo.Session, m *discordgo.MessageCreate) {
// awwnime (test)
if message == "awwnime" {
s.ChannelMessageSend(m.ChannelID, get_redditbooru_image("awwnime"))
// get url
url := <-get_redditbooru_image("awwnime")
// print message with url
s.ChannelMessageSend(m.ChannelID, url)
}
//get_redditbooru("awwnime")