mirror of
https://github.com/lyx0/nourybot.git
synced 2024-11-13 19:49:55 +01:00
add osrs wiki command
This commit is contained in:
parent
3196c22348
commit
ef47f45e6e
14
pkg/commands/osrs.go
Normal file
14
pkg/commands/osrs.go
Normal file
|
@ -0,0 +1,14 @@
|
|||
package commands
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
|
||||
"github.com/lyx0/nourybot/cmd/bot"
|
||||
)
|
||||
|
||||
func Osrs(target, term string, nb *bot.Bot) {
|
||||
reply := fmt.Sprint("https://oldschool.runescape.wiki/?search=" + url.QueryEscape(term))
|
||||
|
||||
nb.Send(target, reply)
|
||||
}
|
|
@ -218,6 +218,14 @@ func Command(message twitch.PrivateMessage, nb *bot.Bot) {
|
|||
} else {
|
||||
commands.Number(target, cmdParams[1], nb)
|
||||
}
|
||||
case "osrs":
|
||||
if msgLen == 1 {
|
||||
nb.Send(target, "Usage: ()osrs [term]")
|
||||
return
|
||||
} else {
|
||||
commands.Osrs(target, message.Message[7:len(message.Message)], nb)
|
||||
return
|
||||
}
|
||||
|
||||
case "ping":
|
||||
commands.Ping(target, nb)
|
||||
|
|
Loading…
Reference in a new issue