I want to send location of the bot to users, I very searched about it in google , but i find just this case"send location of users to the bot" I want versa case that mean:"send location of the bot to the users".
this is my idea: the owner of the bot is a driver who that want to share his location with the users of the bot,in the bot i put a button,when the users click on that button, the bot tell them location of driver.the location of bot is variable and it isn't constant
Sample request for send location from Bot to user with URL:
https://api.telegram.org/bot[botToken]/sendlocation?chat_id=[UserID]&latitude=51.6680&longitude=32.6546
Requirement for execute URL:
[botToken], e.g:399684XXX:AAH_NiVFtLXVmh4XXX-XXXEZo3yO6XXX
[UserID], e.g:64326XX
latitude , e.g:51.6680
longitude, e.g:32.6546
You can use sendVenue or sendLocation method to do it.
use sendLocation and not a web request to telegram api, to get the longitude and latitude you can use messageEventArgs.Message.Location.Latitude and messageEventArgs.Message.Location.Longitude with telegram c# bot api
Related
Use the bot framework composer to display the adaptive card "people-picker" in my chatbot in Teams.
When I select a person from the people-picker and click on the Check button i get the message:
Your response was send to the app
How can i capture that response in a string variable in the Bot Framework Composer enter image description here?
Greetings,
I have some disсord servers and I need the bot to create a log channel into which my bot is able to write the data I will indicate in the code.
If you search on discord.py docs you would find this from guild's object.
await create_text_channel(name, *, overwrites=None, category=None, reason=None, **options)
Example:
guild = client.get_guild(ID)
await guild.create_text_channel('logs')
If you want the bot for everyone to use, you would need a database to save channels' id.
About the type of logs that you want to send to each guild it really depends. If it is only logs that you write by your own then just loop all channel's id that you saved and send each one a message.
If it is some discord logs given by discord API then you would have to search in discord.py docs for more info.
how can I ask my telegram bot user to share his contacts with bot ?
any inline keys or commands?
I want the output to be contacts chat id
$keyboard = json_encode([
'resize_keyboard'=>true,
'keyboard'=>[
[['text'=>"request contact",'request_contact'=>true]]
]
]);
there is a way to get contact of bot user (not user`s contact) with KeyboardButton (request_contact=True)
(is used it in python-telegram-bot v13.13 library)
you can read more in
telegram core bots KeyboardButton
Is it possible to send the location from Telegram to Bot, which made in Bot Framework?
I send my location from my Telegram account to my Bot, but the server does not get them (I don't get the response).
Text messages send normal, and I get response from the server.
Code is very simple:
public async Task<Message> Post([FromBody]Message message)
{
return message.CreateReplyMessage("Tadaa");
}
Dang it, this is a bug. We are filtering out messages without content and we are not treating the location property as "content". To us it looks like no text, no attachments, no channeldata and so no reason to send the message. I will push through a fix.
Is there any method to get current user location. Let say I created some "slash" command /map. When I am calling this command - POST message being send to my nodejs server, and server returns some json data.
{
"channel": "#map",
"username": "test",
"unfurl_links": true,
"icon_emoji": ":world_map:",
"attachments": [
{
"fallback": "Required plain-text summary of the attachment.",
"pretext": "Beautiful Personalized Map Sharing",
"image_url": "http://static.mapjam.com/yrjkbmb/auto/640x480.jpg",
"thumb_url": "http://static.mapjam.com/yrjkbmb/auto/640x480.jpg"
}
]
}
Because I am authenticated I am able to get some Slack user info:
username
email etc..
How can I access Slack user lat, long if it is possible though
Currently there is nothing available in the user info to get the geographical position of a user from the Slack API.
Please refer to the Users Info Slack API documentation and the User Type documentation.
If you are expecting to create a slash command the slack application would have to have permissions to your devices location. Looking at the permissions on my android app id does not request permissions to the devices location.
Just spit-balling, there could be a way to do it. This is completely hypothetical simplified method. You would have to have a helper application on the device that has permissions to the location of the device. That app would listen for the /location /map request then post to the channel where the request came from.