649 return ext.EndGroups
650}
651
652func (moduleStruct) warnsButtonHandler(b *gotgbot.Bot, ctx *ext.Context) error {653 query := ctx.Update.CallbackQuery
654 user := query.From
655
608 return ext.EndGroups
609}
610
611func (moduleStruct) resetAllWarns(b *gotgbot.Bot, ctx *ext.Context) error {612 user := ctx.EffectiveSender.User
613 msg := ctx.EffectiveMessage
614 chat := ctx.EffectiveChat
562 return ext.EndGroups
563}
564
565func (moduleStruct) resetWarns(b *gotgbot.Bot, ctx *ext.Context) error {566 msg := ctx.EffectiveMessage
567 chat := ctx.EffectiveChat
568 user := ctx.EffectiveSender.User
515 return ext.EndGroups
516}
517
518func (moduleStruct) setWarnLimit(b *gotgbot.Bot, ctx *ext.Context) error {519 msg := ctx.EffectiveMessage
520 // connection status
521 connectedChat := helpers.IsUserConnected(b, ctx, true, true)
469 return ext.EndGroups
470}
471
472func (moduleStruct) rmWarnButton(b *gotgbot.Bot, ctx *ext.Context) error {473 query := ctx.Update.CallbackQuery
474 user := ctx.EffectiveSender.User
475 chat := ctx.EffectiveChat
(Go's FAQ)[https://go.dev/doc/faq#methodsonvaluesorpointers] recommends that method receivers should be consistent. If some of the methods of the type must have pointer receivers, the rest should too, so the method set is consistent regardless of how the type is used. This is because value and pointer receivers have different method sets.
package main
type foo struct {
a int
}
func (f foo) a() {}
func (f *foo) b() {
f.a = 10
}
package main
type foo struct {
a int
}
func (f *foo) a() {}
func (f *foo) b() {
f.a = 10
}