blow away a bunch of unused params
This commit is contained in:
parent
0476dd09a4
commit
b2ea90dbef
@ -23,16 +23,16 @@ func (h *Beat) Re() string {
|
||||
}
|
||||
|
||||
// Match determines if we are asking for a beat
|
||||
func (h *Beat) Match(user, msg string) bool {
|
||||
func (h *Beat) Match(_, msg string) bool {
|
||||
re := regexp.MustCompile(h.Re())
|
||||
return re.MatchString(msg)
|
||||
}
|
||||
|
||||
// SetStore we don't need a store here
|
||||
func (h *Beat) SetStore(s PluginStore) {}
|
||||
func (h *Beat) SetStore(_ PluginStore) {}
|
||||
|
||||
// RespondText to beat request events
|
||||
func (h *Beat) RespondText(c *gomatrix.Client, ev *gomatrix.Event, user, post string) error {
|
||||
func (h *Beat) RespondText(c *gomatrix.Client, ev *gomatrix.Event, _, _ string) error {
|
||||
n := time.Now()
|
||||
utc1 := n.Unix() + 3600
|
||||
r := utc1 % 86400
|
||||
|
@ -86,7 +86,7 @@ func (h *Beer) fix(msg string) string {
|
||||
}
|
||||
|
||||
// Match determines if we should call the response for Beer
|
||||
func (h *Beer) Match(user, msg string) bool {
|
||||
func (h *Beer) Match(_, msg string) bool {
|
||||
re := regexp.MustCompile(h.Re())
|
||||
return re.MatchString(msg)
|
||||
}
|
||||
@ -113,10 +113,10 @@ func (h *Beer) pretty(b BeerResp, random bool) string {
|
||||
}
|
||||
|
||||
// SetStore we don't need a store here.
|
||||
func (h *Beer) SetStore(s PluginStore) {}
|
||||
func (h *Beer) SetStore(_ PluginStore) {}
|
||||
|
||||
// RespondText to looking up of beer requests
|
||||
func (h *Beer) RespondText(c *gomatrix.Client, ev *gomatrix.Event, user, post string) error {
|
||||
func (h *Beer) RespondText(c *gomatrix.Client, ev *gomatrix.Event, _, post string) error {
|
||||
beer := h.fix(post)
|
||||
if beer != "" {
|
||||
var beers = &BeerResp{}
|
||||
|
@ -23,7 +23,7 @@ func (h *BotSnack) Re() string {
|
||||
}
|
||||
|
||||
// Match determines if we should execute BotSnack
|
||||
func (h *BotSnack) Match(user, msg string) bool {
|
||||
func (h *BotSnack) Match(_, msg string) bool {
|
||||
re := regexp.MustCompile(h.Re())
|
||||
return re.MatchString(msg)
|
||||
}
|
||||
@ -42,7 +42,7 @@ func (h *BotSnack) resp() string {
|
||||
}
|
||||
|
||||
// SetStore we don't need a store, so just return
|
||||
func (h *BotSnack) SetStore(s PluginStore) {}
|
||||
func (h *BotSnack) SetStore(_ PluginStore) {}
|
||||
|
||||
// RespondText to botsnack events
|
||||
func (h *BotSnack) RespondText(c *gomatrix.Client, ev *gomatrix.Event, user, post string) error {
|
||||
|
@ -42,16 +42,16 @@ func (h *Feder) fix(msg string) string {
|
||||
}
|
||||
|
||||
// Match determines if we should call the response for Feder
|
||||
func (h *Feder) Match(user, msg string) bool {
|
||||
func (h *Feder) Match(_, msg string) bool {
|
||||
re := regexp.MustCompile(h.Re())
|
||||
return re.MatchString(msg)
|
||||
}
|
||||
|
||||
// SetStore we don't need a store here.
|
||||
func (h *Feder) SetStore(s PluginStore) {}
|
||||
func (h *Feder) SetStore(_ PluginStore) {}
|
||||
|
||||
// RespondText to looking up of federation check requests
|
||||
func (h *Feder) RespondText(c *gomatrix.Client, ev *gomatrix.Event, user, post string) error {
|
||||
func (h *Feder) RespondText(c *gomatrix.Client, ev *gomatrix.Event, _, post string) error {
|
||||
homeServer := h.fix(post)
|
||||
if homeServer != "" {
|
||||
u, err := url.Parse(fmt.Sprintf("https://%s", homeServer))
|
||||
|
@ -57,13 +57,13 @@ func (h *Ham) fix(msg string) string {
|
||||
}
|
||||
|
||||
// Match determines if we should call the response for Ham
|
||||
func (h *Ham) Match(user, msg string) bool {
|
||||
func (h *Ham) Match(_, msg string) bool {
|
||||
re := regexp.MustCompile(h.Re())
|
||||
return re.MatchString(msg)
|
||||
}
|
||||
|
||||
// SetStore we don't need a store here.
|
||||
func (h *Ham) SetStore(s PluginStore) {}
|
||||
func (h *Ham) SetStore(_ PluginStore) {}
|
||||
|
||||
func (h *Ham) pretty(resp *LicenseResp) string {
|
||||
var s []string
|
||||
@ -86,7 +86,7 @@ func (h *Ham) pretty(resp *LicenseResp) string {
|
||||
}
|
||||
|
||||
// RespondText to looking up of federation check requests
|
||||
func (h *Ham) RespondText(c *gomatrix.Client, ev *gomatrix.Event, user, post string) error {
|
||||
func (h *Ham) RespondText(c *gomatrix.Client, ev *gomatrix.Event, _, post string) error {
|
||||
call := h.fix(post)
|
||||
if call != "" {
|
||||
furl := fmt.Sprintf("%s%s",
|
||||
|
@ -28,10 +28,10 @@ func (h *Hi) Match(user, msg string) bool {
|
||||
}
|
||||
|
||||
// SetStore we don't need a store here
|
||||
func (h *Hi) SetStore(s PluginStore) {}
|
||||
func (h *Hi) SetStore(_ PluginStore) {}
|
||||
|
||||
// RespondText to hi events
|
||||
func (h *Hi) RespondText(c *gomatrix.Client, ev *gomatrix.Event, user, post string) error {
|
||||
func (h *Hi) RespondText(c *gomatrix.Client, ev *gomatrix.Event, _, _ string) error {
|
||||
s := NameRE.ReplaceAllString(ev.Sender, "$1")
|
||||
|
||||
return SendText(c, ev.RoomID, fmt.Sprintf("hi %s!", s))
|
||||
|
@ -31,7 +31,7 @@ func (h *HighFive) Re() string {
|
||||
}
|
||||
|
||||
// SetStore we don't need a store here.
|
||||
func (h *HighFive) SetStore(s PluginStore) {}
|
||||
func (h *HighFive) SetStore(_ PluginStore) {}
|
||||
|
||||
// Match determines if we should bother giving a high five
|
||||
func (h *HighFive) Match(user, msg string) bool {
|
||||
@ -40,7 +40,7 @@ func (h *HighFive) Match(user, msg string) bool {
|
||||
}
|
||||
|
||||
// RespondText to high five events
|
||||
func (h *HighFive) RespondText(c *gomatrix.Client, ev *gomatrix.Event, user, post string) error {
|
||||
func (h *HighFive) RespondText(c *gomatrix.Client, ev *gomatrix.Event, _, post string) error {
|
||||
s := NameRE.ReplaceAllString(ev.Sender, "$1")
|
||||
|
||||
rm := regexp.MustCompile(rightFive())
|
||||
|
@ -43,10 +43,10 @@ func (h *LoveYou) resp() string {
|
||||
}
|
||||
|
||||
// SetStore we don't need a store, so just return
|
||||
func (h *LoveYou) SetStore(s PluginStore) {}
|
||||
func (h *LoveYou) SetStore(_ PluginStore) {}
|
||||
|
||||
// RespondText to love events
|
||||
func (h *LoveYou) RespondText(c *gomatrix.Client, ev *gomatrix.Event, user, post string) error {
|
||||
func (h *LoveYou) RespondText(c *gomatrix.Client, ev *gomatrix.Event, _, _ string) error {
|
||||
return SendText(c, ev.RoomID, h.resp())
|
||||
}
|
||||
|
||||
|
@ -42,16 +42,16 @@ func (h *OpenBSDMan) fix(msg string) string {
|
||||
}
|
||||
|
||||
// Match checks for our man page re
|
||||
func (h *OpenBSDMan) Match(user, msg string) bool {
|
||||
func (h *OpenBSDMan) Match(_, msg string) bool {
|
||||
re := regexp.MustCompile(h.Re())
|
||||
return re.MatchString(msg)
|
||||
}
|
||||
|
||||
// SetStore does nothing in OpenBSDMan
|
||||
func (h *OpenBSDMan) SetStore(s PluginStore) {}
|
||||
func (h *OpenBSDMan) SetStore(_ PluginStore) {}
|
||||
|
||||
// RespondText sends back a man page.
|
||||
func (h *OpenBSDMan) RespondText(c *gomatrix.Client, ev *gomatrix.Event, user, post string) error {
|
||||
func (h *OpenBSDMan) RespondText(c *gomatrix.Client, ev *gomatrix.Event, _, post string) error {
|
||||
page := h.fix(post)
|
||||
if page != "" {
|
||||
return SendText(c, ev.RoomID, fmt.Sprintf("https://man.openbsd.org/%s", page))
|
||||
|
@ -28,10 +28,10 @@ func (h *Source) Match(user, msg string) bool {
|
||||
}
|
||||
|
||||
// SetStore does nothing in here
|
||||
func (h *Source) SetStore(s PluginStore) {}
|
||||
func (h *Source) SetStore(_ PluginStore) {}
|
||||
|
||||
// RespondText to questions about TheSource™©®⑨
|
||||
func (h *Source) RespondText(c *gomatrix.Client, ev *gomatrix.Event, user, post string) error {
|
||||
func (h *Source) RespondText(c *gomatrix.Client, ev *gomatrix.Event, _, _ string) error {
|
||||
s := NameRE.ReplaceAllString(ev.Sender, "$1")
|
||||
|
||||
return SendText(c, ev.RoomID, fmt.Sprintf("%s: %s ;D", s, "https://git.sr.ht/~qbit/mcchunkie"))
|
||||
|
@ -30,10 +30,10 @@ func (h *Thanks) Match(user, msg string) bool {
|
||||
}
|
||||
|
||||
// SetStore we don't need a store here
|
||||
func (h *Thanks) SetStore(s PluginStore) {}
|
||||
func (h *Thanks) SetStore(_ PluginStore) {}
|
||||
|
||||
// RespondText to welcome back events
|
||||
func (h *Thanks) RespondText(c *gomatrix.Client, ev *gomatrix.Event, user, post string) error {
|
||||
func (h *Thanks) RespondText(c *gomatrix.Client, ev *gomatrix.Event, _, _ string) error {
|
||||
s := NameRE.ReplaceAllString(ev.Sender, "$1")
|
||||
a := []string{
|
||||
fmt.Sprintf("welcome %s", s),
|
||||
|
@ -4022,13 +4022,13 @@ func (t *Toki) Re() string {
|
||||
}
|
||||
|
||||
// Match determines if we are highfiving
|
||||
func (t *Toki) Match(user, msg string) bool {
|
||||
func (t *Toki) Match(_, msg string) bool {
|
||||
re := regexp.MustCompile(t.Re())
|
||||
return re.MatchString(msg)
|
||||
}
|
||||
|
||||
// SetStore we don't need a store here
|
||||
func (t *Toki) SetStore(s PluginStore) {}
|
||||
func (t *Toki) SetStore(_ PluginStore) {}
|
||||
|
||||
func (t *Toki) fix(msg string) (string, string) {
|
||||
re := regexp.MustCompile(t.Re())
|
||||
@ -4036,7 +4036,7 @@ func (t *Toki) fix(msg string) (string, string) {
|
||||
}
|
||||
|
||||
// RespondText to hi events
|
||||
func (t *Toki) RespondText(c *gomatrix.Client, ev *gomatrix.Event, user, post string) error {
|
||||
func (t *Toki) RespondText(c *gomatrix.Client, ev *gomatrix.Event, _, post string) error {
|
||||
cmd, w := t.fix(post)
|
||||
cmd = strings.ToLower(cmd)
|
||||
switch cmd {
|
||||
|
@ -31,7 +31,7 @@ func (v *Version) Match(user, msg string) bool {
|
||||
return re.MatchString(msg) && ToMe(user, msg)
|
||||
}
|
||||
|
||||
func (v *Version) print(to string) string {
|
||||
func (v *Version) print() string {
|
||||
if version == "" {
|
||||
version = "unknown version"
|
||||
}
|
||||
@ -39,13 +39,11 @@ func (v *Version) print(to string) string {
|
||||
}
|
||||
|
||||
// SetStore does nothing in here
|
||||
func (v *Version) SetStore(s PluginStore) {}
|
||||
func (v *Version) SetStore(_ PluginStore) {}
|
||||
|
||||
// RespondText to version events
|
||||
func (v *Version) RespondText(c *gomatrix.Client, ev *gomatrix.Event, user, post string) error {
|
||||
s := NameRE.ReplaceAllString(ev.Sender, "$1")
|
||||
|
||||
return SendText(c, ev.RoomID, v.print(s))
|
||||
func (v *Version) RespondText(c *gomatrix.Client, ev *gomatrix.Event, _, _ string) error {
|
||||
return SendText(c, ev.RoomID, v.print())
|
||||
}
|
||||
|
||||
// Name Version
|
||||
|
@ -152,7 +152,7 @@ func (h *Weather) Re() string {
|
||||
}
|
||||
|
||||
// Match checks for "weather: " messages
|
||||
func (h *Weather) Match(user, msg string) bool {
|
||||
func (h *Weather) Match(_, msg string) bool {
|
||||
re := regexp.MustCompile(h.Re())
|
||||
return re.MatchString(msg)
|
||||
}
|
||||
@ -163,7 +163,7 @@ func (h *Weather) fix(msg string) string {
|
||||
}
|
||||
|
||||
// RespondText to looking up of weather lookup requests
|
||||
func (h *Weather) RespondText(c *gomatrix.Client, ev *gomatrix.Event, user, post string) error {
|
||||
func (h *Weather) RespondText(c *gomatrix.Client, ev *gomatrix.Event, _, post string) error {
|
||||
weather := h.fix(post)
|
||||
if weather != "" {
|
||||
wd, err := h.get(weather)
|
||||
|
@ -28,10 +28,10 @@ func (h *Wb) Match(user, msg string) bool {
|
||||
}
|
||||
|
||||
// SetStore we don't need a store here
|
||||
func (h *Wb) SetStore(s PluginStore) {}
|
||||
func (h *Wb) SetStore(_ PluginStore) {}
|
||||
|
||||
// RespondText to welcome back events
|
||||
func (h *Wb) RespondText(c *gomatrix.Client, ev *gomatrix.Event, user, post string) error {
|
||||
func (h *Wb) RespondText(c *gomatrix.Client, ev *gomatrix.Event, _, _ string) error {
|
||||
s := NameRE.ReplaceAllString(ev.Sender, "$1")
|
||||
|
||||
return SendText(c, ev.RoomID, fmt.Sprintf("thanks %s!", s))
|
||||
|
Loading…
Reference in New Issue
Block a user