package mainimport ( "fmt" "github.com/amarnathcjd/gogram/telegram")func main() { // Create and authenticate the client client, _ := telegram.NewClient(telegram.ClientConfig{ AppID: 6, AppHash: "YOUR_APP_HASH", }) client.LoginBot("YOUR_BOT_TOKEN") // Listen for participant updates (joins/leaves) client.On("participant", UserJoinHandle) // Handle /start command client.On("cmd:start", func(message *telegram.NewMessage) error { message.Reply("Hello, I am a bot!") return nil }) // Keep the bot running client.Idle()}// Handle user join eventsfunc UserJoinHandle(m *telegram.ParticipantUpdate) error { // Check if user joined or was added to the group if m.IsJoined() || m.IsAdded() { // Send welcome message with user's first name // m.ChannelID() returns the chat/group ID where user joined // m.User contains the user information fmt.Println(m.Client.SendMessage( m.ChannelID(), "Welcome to the group <b>"+m.User.FirstName+"!</b>", )) } return nil}