Init location plugin
Anirudh Oppiliappan x@icyphox.sh
Sat, 20 Nov 2021 09:55:10 +0530
1 files changed,
27 insertions(+),
0 deletions(-)
jump to
A
plugins/location.go
@@ -0,0 +1,27 @@
+package plugins + +import ( + "fmt" + "strings" + + "gopkg.in/irc.v3" +) + +func init() { + Register(Location{}) +} + +type Location struct{} + +func (Location) Triggers() []string { + return []string{".loc", ".location"} +} + +func (Location) Execute(m *irc.Message) (string, error) { + parsed := strings.SplitN(m.Trailing(), " ", 2) + trigger := parsed[0] + location := parsed[1] + if len(parsed) != 2 { + return fmt.Sprintf("Usage: %s <location>", trigger), nil + } +}