diff --git a/pkg/commands/botstatus.go b/pkg/commands/botstatus.go index 5447e87..f178c71 100644 --- a/pkg/commands/botstatus.go +++ b/pkg/commands/botstatus.go @@ -8,6 +8,7 @@ import ( log "github.com/sirupsen/logrus" ) +// Botstatus responds with if a given bot is verified/known and its ratelimits. func BotStatus(channel, name string, nb *bot.Bot) { resp, err := aiden.ApiCall(fmt.Sprintf("api/v1/twitch/botStatus/%s?includeLimits=1", name)) diff --git a/pkg/commands/bttv.go b/pkg/commands/bttv.go index d52b620..21a9bc6 100644 --- a/pkg/commands/bttv.go +++ b/pkg/commands/bttv.go @@ -6,6 +6,7 @@ import ( "github.com/lyx0/nourybot/cmd/bot" ) +// Bttv responds with a search for a given bttv emote. func Bttv(target, emote string, nb *bot.Bot) { reply := fmt.Sprintf("https://betterttv.com/emotes/shared/search?query=%s", emote) diff --git a/pkg/commands/coinflip.go b/pkg/commands/coinflip.go index 63c8aca..f9b7d11 100644 --- a/pkg/commands/coinflip.go +++ b/pkg/commands/coinflip.go @@ -5,6 +5,7 @@ import ( "github.com/lyx0/nourybot/pkg/utils" ) +// Coinflip responds with Heads or Tails. func Coinflip(channel string, nb *bot.Bot) { result := utils.GenerateRandomNumber(2) diff --git a/pkg/commands/color.go b/pkg/commands/color.go index 155acd6..5908e14 100644 --- a/pkg/commands/color.go +++ b/pkg/commands/color.go @@ -7,6 +7,7 @@ import ( "github.com/lyx0/nourybot/cmd/bot" ) +// Color responds with a users Twitch username color. func Color(message twitch.PrivateMessage, nb *bot.Bot) { reply := fmt.Sprintf("@%v, your color is %v", message.User.DisplayName, message.User.Color) diff --git a/pkg/commands/commandslist.go b/pkg/commands/commandslist.go index 6c33b1e..13f2d27 100644 --- a/pkg/commands/commandslist.go +++ b/pkg/commands/commandslist.go @@ -2,6 +2,7 @@ package commands import "github.com/lyx0/nourybot/cmd/bot" +// Commandslist responds with a link to the list of commands. func CommandsList(target string, nb *bot.Bot) { reply := "https://gist.github.com/lyx0/6e326451ed9602157fcf6b5e40fb1dfd" diff --git a/pkg/commands/currency.go b/pkg/commands/currency.go index 9d5a709..08c46b5 100644 --- a/pkg/commands/currency.go +++ b/pkg/commands/currency.go @@ -6,6 +6,8 @@ import ( "github.com/sirupsen/logrus" ) +// Currency responds with the conversion rate for two given currencies. +// Example: ()currency 10 usd to eur func Currency(target, currAmount, currFrom, currTo string, nb *bot.Bot) { reply, err := api.Currency(currAmount, currFrom, currTo) if err != nil { diff --git a/pkg/commands/echo.go b/pkg/commands/echo.go index 4447c25..4a0dd99 100644 --- a/pkg/commands/echo.go +++ b/pkg/commands/echo.go @@ -2,12 +2,8 @@ package commands import "github.com/lyx0/nourybot/cmd/bot" +// Echo responds with the given message. func Echo(channel, message string, nb *bot.Bot) { - // if message[0] == '.' || message[0] == '/' || message[0] == '!' { - // nb.Send(channel, ":tf:") - // return - // } - nb.Send(channel, message) } diff --git a/pkg/commands/eightball.go b/pkg/commands/eightball.go index ec4bd2e..ec37bdb 100644 --- a/pkg/commands/eightball.go +++ b/pkg/commands/eightball.go @@ -6,6 +6,7 @@ import ( log "github.com/sirupsen/logrus" ) +// Eightball asks the magic 8ball for guidance. func EightBall(channel string, nb *bot.Bot) { resp, err := aiden.ApiCall("api/v1/misc/8ball") diff --git a/pkg/commands/emotelookup.go b/pkg/commands/emotelookup.go index 6f67ffe..c6fb6db 100644 --- a/pkg/commands/emotelookup.go +++ b/pkg/commands/emotelookup.go @@ -7,6 +7,8 @@ import ( "github.com/lyx0/nourybot/pkg/api/ivr" ) +// EmoteLookup looks up a given emote and responds with the channel it is +// associated with and its tier. func EmoteLookup(channel, emote string, nb *bot.Bot) { reply, err := ivr.EmoteLookup(emote) diff --git a/pkg/commands/ffz.go b/pkg/commands/ffz.go index ba8082c..e861c29 100644 --- a/pkg/commands/ffz.go +++ b/pkg/commands/ffz.go @@ -6,6 +6,7 @@ import ( "github.com/lyx0/nourybot/cmd/bot" ) +// Ffz responds with a search link for a given ffz emote. func Ffz(target, emote string, nb *bot.Bot) { reply := fmt.Sprintf("https://www.frankerfacez.com/emoticons/?q=%s", emote) diff --git a/pkg/commands/fill.go b/pkg/commands/fill.go index 8353b6a..b8aa49b 100644 --- a/pkg/commands/fill.go +++ b/pkg/commands/fill.go @@ -7,6 +7,8 @@ import ( "github.com/lyx0/nourybot/cmd/bot" ) +// Fill repeats a given emote until the whole twitch message +// is filled up with the emote and then sends it. func Fill(channel, emote string, nb *bot.Bot) { if emote[0] == '.' || emote[0] == '/' { nb.Send(channel, ":tf:") diff --git a/pkg/commands/firstline.go b/pkg/commands/firstline.go index 0ca23ea..ced2fe1 100644 --- a/pkg/commands/firstline.go +++ b/pkg/commands/firstline.go @@ -7,6 +7,7 @@ import ( "github.com/lyx0/nourybot/pkg/api/ivr" ) +// Firstline responds a given users first message in a given channel. func Firstline(channel, streamer, username string, nb *bot.Bot) { ivrResponse, err := ivr.FirstLine(streamer, username) diff --git a/pkg/commands/followage.go b/pkg/commands/followage.go index b5e11a2..6583f36 100644 --- a/pkg/commands/followage.go +++ b/pkg/commands/followage.go @@ -7,6 +7,7 @@ import ( "github.com/lyx0/nourybot/pkg/api/ivr" ) +// Followage responds with a given users time since he followed a streamer. func Followage(channel, streamer, username string, nb *bot.Bot) { ivrResponse, err := ivr.Followage(streamer, username) diff --git a/pkg/commands/game.go b/pkg/commands/game.go index 840d800..4487726 100644 --- a/pkg/commands/game.go +++ b/pkg/commands/game.go @@ -8,6 +8,7 @@ import ( log "github.com/sirupsen/logrus" ) +// Game responds with the current game category a given stream is set to. func Game(channel, name string, nb *bot.Bot) { game, err := aiden.ApiCall(fmt.Sprintf("api/v1/twitch/channel/%s/game", name)) diff --git a/pkg/commands/godocs.go b/pkg/commands/godocs.go index c0af799..4c31dc8 100644 --- a/pkg/commands/godocs.go +++ b/pkg/commands/godocs.go @@ -6,6 +6,7 @@ import ( "github.com/lyx0/nourybot/cmd/bot" ) +// Godocs responds with a search for a given term on godocs.io func Godocs(channel, searchTerm string, nb *bot.Bot) { resp := fmt.Sprintf("https://godocs.io/?q=%s", searchTerm) diff --git a/pkg/commands/help.go b/pkg/commands/help.go index a7b1eea..5654206 100644 --- a/pkg/commands/help.go +++ b/pkg/commands/help.go @@ -2,6 +2,7 @@ package commands import "github.com/lyx0/nourybot/cmd/bot" +// Help responds with basic information about the bot. func Help(target string, nb *bot.Bot) { reply := "Bot made in Go by @Nouryqt, Prefix: (), Commands: https://gist.github.com/lyx0/6e326451ed9602157fcf6b5e40fb1dfd" diff --git a/pkg/commands/number.go b/pkg/commands/number.go index 2e70a59..6284667 100644 --- a/pkg/commands/number.go +++ b/pkg/commands/number.go @@ -5,12 +5,14 @@ import ( "github.com/lyx0/nourybot/pkg/api" ) +// RandomNumber calls the numbers api with a random number. func RandomNumber(channel string, nb *bot.Bot) { reply := api.RandomNumber() nb.Send(channel, string(reply)) } +// Number calls the numbers api with a given number. func Number(channel, number string, nb *bot.Bot) { reply := api.Number(number) diff --git a/pkg/commands/osrs.go b/pkg/commands/osrs.go index ff21868..3e67630 100644 --- a/pkg/commands/osrs.go +++ b/pkg/commands/osrs.go @@ -7,6 +7,7 @@ import ( "github.com/lyx0/nourybot/cmd/bot" ) +// Osrs responds with a link to a given osrs wiki search. func Osrs(target, term string, nb *bot.Bot) { reply := fmt.Sprint("https://oldschool.runescape.wiki/?search=" + url.QueryEscape(term)) diff --git a/pkg/commands/ping.go b/pkg/commands/ping.go index a511013..fffdbcc 100644 --- a/pkg/commands/ping.go +++ b/pkg/commands/ping.go @@ -8,6 +8,7 @@ import ( "github.com/lyx0/nourybot/pkg/utils" ) +// Ping responds with Pong and basic information about the bot. func Ping(target string, nb *bot.Bot) { commandCount := fmt.Sprint(utils.GetCommandsUsed()) botUptime := humanize.Time(nb.Uptime) diff --git a/pkg/commands/pingme.go b/pkg/commands/pingme.go index 4fbb6ff..6f6ef23 100644 --- a/pkg/commands/pingme.go +++ b/pkg/commands/pingme.go @@ -6,6 +6,7 @@ import ( "github.com/lyx0/nourybot/cmd/bot" ) +// Pingme pings a user. func Pingme(channel, user string, nb *bot.Bot) { response := fmt.Sprintf("@%s", user) diff --git a/pkg/commands/profilepicture.go b/pkg/commands/profilepicture.go index b6652f5..102fef5 100644 --- a/pkg/commands/profilepicture.go +++ b/pkg/commands/profilepicture.go @@ -7,6 +7,7 @@ import ( "github.com/lyx0/nourybot/pkg/api/ivr" ) +// ProfilePicture responds with a link to a given users Twitch Profilepicture. func ProfilePicture(channel, target string, nb *bot.Bot) { reply, err := ivr.ProfilePicture(target) diff --git a/pkg/commands/randomcat.go b/pkg/commands/randomcat.go index 34dae05..f206738 100644 --- a/pkg/commands/randomcat.go +++ b/pkg/commands/randomcat.go @@ -5,6 +5,8 @@ import ( "github.com/lyx0/nourybot/pkg/api" ) +// RandomCat calls the RandomCat api and responds with a link for a +// random cat image. func RandomCat(channel string, nb *bot.Bot) { reply := api.RandomCat() diff --git a/pkg/commands/randomdog.go b/pkg/commands/randomdog.go index 5555dba..c176b85 100644 --- a/pkg/commands/randomdog.go +++ b/pkg/commands/randomdog.go @@ -5,6 +5,8 @@ import ( "github.com/lyx0/nourybot/pkg/api" ) +// RandomDog calls the RandomDog api and responds with a link for a +// random dog image. func RandomDog(channel string, nb *bot.Bot) { reply := api.RandomDog() diff --git a/pkg/commands/randomduck.go b/pkg/commands/randomduck.go index 70b82a6..82ccb67 100644 --- a/pkg/commands/randomduck.go +++ b/pkg/commands/randomduck.go @@ -5,6 +5,8 @@ import ( "github.com/lyx0/nourybot/pkg/api" ) +// RandomDuck calls the RandomDuck api and responds with a link for a +// random duck image. func RandomDuck(channel string, nb *bot.Bot) { reply := api.RandomDuck() diff --git a/pkg/commands/randomfox.go b/pkg/commands/randomfox.go index d9b3744..061d4a4 100644 --- a/pkg/commands/randomfox.go +++ b/pkg/commands/randomfox.go @@ -5,6 +5,8 @@ import ( "github.com/lyx0/nourybot/pkg/api" ) +// RandomFox calls the RandomFox api and responds with a link for a +// random fox image. func RandomFox(channel string, nb *bot.Bot) { reply := api.RandomFox() diff --git a/pkg/commands/randomquote.go b/pkg/commands/randomquote.go index 402c3a5..4453d90 100644 --- a/pkg/commands/randomquote.go +++ b/pkg/commands/randomquote.go @@ -7,6 +7,8 @@ import ( "github.com/lyx0/nourybot/pkg/api/ivr" ) +// RandomQuote calls the RandomQuote api and responds with a link for a +// random quote image. func RandomQuote(channel, target, username string, nb *bot.Bot) { ivrResponse, err := ivr.RandomQuote(target, username) diff --git a/pkg/commands/randomxkcd.go b/pkg/commands/randomxkcd.go index d812363..c6ed164 100644 --- a/pkg/commands/randomxkcd.go +++ b/pkg/commands/randomxkcd.go @@ -5,6 +5,8 @@ import ( "github.com/lyx0/nourybot/pkg/api" ) +// RandomXkcd calls the RandomXkcd api and responds with a link to a +// random xkcd comic. func RandomXkcd(channel string, nb *bot.Bot) { reply := api.RandomXkcd() diff --git a/pkg/commands/robohash.go b/pkg/commands/robohash.go index a4cebe2..03a7375 100644 --- a/pkg/commands/robohash.go +++ b/pkg/commands/robohash.go @@ -7,6 +7,8 @@ import ( "github.com/lyx0/nourybot/cmd/bot" ) +// Robohash takes the message ID from the message and responds +// with the robohash image link for the message id. func RoboHash(target string, message twitch.PrivateMessage, nb *bot.Bot) { reply := fmt.Sprintf("https://robohash.org/%s", message.ID) diff --git a/pkg/commands/seventv.go b/pkg/commands/seventv.go index fae893c..39bba56 100644 --- a/pkg/commands/seventv.go +++ b/pkg/commands/seventv.go @@ -6,6 +6,7 @@ import ( "github.com/lyx0/nourybot/cmd/bot" ) +// SevenTV responds with a link to the 7tv search for a given emote. func SevenTV(target, emote string, nb *bot.Bot) { reply := fmt.Sprintf("https://7tv.app/emotes?query=%s", emote) diff --git a/pkg/commands/subage.go b/pkg/commands/subage.go index dc696cc..11614cb 100644 --- a/pkg/commands/subage.go +++ b/pkg/commands/subage.go @@ -7,6 +7,8 @@ import ( "github.com/lyx0/nourybot/pkg/api/ivr" ) +// Subage responds with the time a given user has been subscribed +// to a given channel. func Subage(channel, username, streamer string, nb *bot.Bot) { ivrResponse, err := ivr.Subage(username, streamer) diff --git a/pkg/commands/thumbnail.go b/pkg/commands/thumbnail.go index fc1cc97..640a2ff 100644 --- a/pkg/commands/thumbnail.go +++ b/pkg/commands/thumbnail.go @@ -7,6 +7,7 @@ import ( "github.com/lyx0/nourybot/pkg/utils" ) +// Thumbnail responds with the current preview image for a given channel. func Thumbnail(channel, target string, nb *bot.Bot) { imageHeight := utils.GenerateRandomNumberRange(1040, 1080) imageWidth := utils.GenerateRandomNumberRange(1890, 1920) diff --git a/pkg/commands/title.go b/pkg/commands/title.go index 8373349..4350312 100644 --- a/pkg/commands/title.go +++ b/pkg/commands/title.go @@ -8,6 +8,7 @@ import ( log "github.com/sirupsen/logrus" ) +// Title responds with the stream title for a given channel. func Title(channel, target string, nb *bot.Bot) { title, err := aiden.ApiCall(fmt.Sprintf("api/v1/twitch/channel/%s/title", target)) diff --git a/pkg/commands/uptime.go b/pkg/commands/uptime.go index 5c3a649..f9d3aad 100644 --- a/pkg/commands/uptime.go +++ b/pkg/commands/uptime.go @@ -8,6 +8,7 @@ import ( log "github.com/sirupsen/logrus" ) +// Uptime responds with the time a given channel has been live. func Uptime(channel, name string, nb *bot.Bot) { resp, err := aiden.ApiCall(fmt.Sprintf("api/v1/twitch/channel/%s/uptime", name)) diff --git a/pkg/commands/userid.go b/pkg/commands/userid.go index 14b380b..bff6adc 100644 --- a/pkg/commands/userid.go +++ b/pkg/commands/userid.go @@ -5,6 +5,7 @@ import ( "github.com/lyx0/nourybot/pkg/api/ivr" ) +// Userid responds with the userid for a given user. func Userid(channel, target string, nb *bot.Bot) { reply := ivr.Userid(target) diff --git a/pkg/commands/weather.go b/pkg/commands/weather.go index b4b8ae6..05ab804 100644 --- a/pkg/commands/weather.go +++ b/pkg/commands/weather.go @@ -8,6 +8,8 @@ import ( log "github.com/sirupsen/logrus" ) +// Weather calls the weather api for a given location and responds +// with the current weather data. func Weather(channel, location string, nb *bot.Bot) { reply, err := aiden.ApiCall(fmt.Sprintf("api/v1/misc/weather/%s", location)) diff --git a/pkg/commands/whois.go b/pkg/commands/whois.go index a913b02..dcac00a 100644 --- a/pkg/commands/whois.go +++ b/pkg/commands/whois.go @@ -5,6 +5,7 @@ import ( "github.com/lyx0/nourybot/pkg/api/ivr" ) +// Whois responds with information about a given users Twitch account. func Whois(target, user string, nb *bot.Bot) { reply := ivr.Whois(user) diff --git a/pkg/commands/xd.go b/pkg/commands/xd.go index d5c7c49..e48492b 100644 --- a/pkg/commands/xd.go +++ b/pkg/commands/xd.go @@ -2,6 +2,7 @@ package commands import "github.com/lyx0/nourybot/cmd/bot" +// Xd responds with a xd func Xd(channel string, nb *bot.Bot) { nb.Send(channel, "xd") } diff --git a/pkg/commands/xkcd.go b/pkg/commands/xkcd.go index 1768851..b245a1a 100644 --- a/pkg/commands/xkcd.go +++ b/pkg/commands/xkcd.go @@ -5,6 +5,7 @@ import ( "github.com/lyx0/nourybot/pkg/api" ) +// Xkcd responds with a link to the current xkcd comic and information about i. func Xkcd(channel string, nb *bot.Bot) { reply := api.Xkcd()