telegram-bot-api icon indicating copy to clipboard operation
telegram-bot-api copied to clipboard

Sending message with method createChatInviteLink return nothing

Open mazanur opened this issue 3 years ago • 4 comments

Response from telegram {"invite_link":"https://t.me/+SEgfYrEGlSwzMjAy", "creator":{"id":1295847044,"is_bot":true,"first_name":"***","username":"*"},"member_limit":1,"creates_join_request":false,"is_primary":false,"is_revoked":false}

After Unmarshal, message has not inviteLink

mazanur avatar Apr 28 '22 09:04 mazanur

Hi! You must provide youre code first, if you want help

But it looks like that youre use it wrong way

You must use Request method and provide tgbotapi.CreateChatInviteLinkConfig for it

temamagic avatar Apr 28 '22 23:04 temamagic

Hi, that's exactly what I did. image

But I want to use the Send method to create a link and return a Message, where the ChatInviteLink field will be

mazanur avatar Apr 29 '22 10:04 mazanur

Works for me like so:

		response, err := bot.Request(createInviteLinkConfig)
		if err != nil {
			return msg, err
		}
		var dat map[string]interface{}
		json.Unmarshal(response.Result, &dat)

omerxx avatar May 02 '23 15:05 omerxx