Fixed typos

This commit is contained in:
nefrace 2022-11-09 01:23:32 +03:00
parent 43f881178b
commit a64c173c1a
2 changed files with 19 additions and 18 deletions

View File

@ -71,7 +71,7 @@ func userLeft(b *bot, update *tb.Update) error {
func checkCaptcha(b *bot, update *tb.Update) error { func checkCaptcha(b *bot, update *tb.Update) error {
message := update.Message message := update.Message
sender := message.ForwardFrom sender := message.From
d := db.GetDatabase() d := db.GetDatabase()
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
defer cancel() defer cancel()

View File

@ -18,6 +18,7 @@ type bot struct {
} }
func (b *bot) Update(update *tb.Update) { func (b *bot) Update(update *tb.Update) {
if update.Message != nil {
if len(update.Message.NewChatMembers) != 0 { if len(update.Message.NewChatMembers) != 0 {
for _, user := range update.Message.NewChatMembers { for _, user := range update.Message.NewChatMembers {
if user.ID == b.Me.ID { if user.ID == b.Me.ID {
@ -37,7 +38,7 @@ func (b *bot) Update(update *tb.Update) {
return return
} }
checkCaptcha(b, update) checkCaptcha(b, update)
}
} }
} }