浏览代码

optimize go/tg/l1.go

root 3 周之前
父节点
当前提交
56e6a40230
共有 2 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      go/tg/l1.go
  2. 二进制
      go/tg/output/l1

+ 2 - 1
go/tg/l1.go

@@ -27,8 +27,9 @@ func main() {
 		if update.Message == nil {
 			continue
 		}
+		id := update.Message.Chat.ID
 		if update.Message.IsCommand() && update.Message.Command() == "start" {
-			msg := tgbotapi.NewMessage(update.Message.Chat.ID, "Сергей")
+			msg := tgbotapi.NewMessage(id, "Сергей")
 			bot.Send(msg)
 		}
 	}

二进制
go/tg/output/l1