Where to find the Telegram Api Key - c#

I am trying to find the Api Key for Telegram but I cannot find it. Where do I find it on the website? If I use the Api Id, I get the error Incorrect Token Format in the C# Console Application.

Like ihoru mentioned in his answer, you can find all of your bots relevant information in BotFather.
So navigate to #BotFather in Telegram. If you have not yet created a bot do so by entering /newbotand follow the instructions on screen. You should get your key at the end of the process.
But now let's assume you already have a bot and can't find the key anymore. Again, go to #BotFather but this time enter /mybots. You should see something like this:
Click/Touch whatever bot you would like your API key for, then you should see this:
Click the API Key button and tadaa there is your key:

You mean Telegram API for create a telegram application using C#, not Telegram Bot API, right? to get API key. Please see the step by step below or for detail information you can see this link
Sign up for Telegram using any application.
Log in to your Telegram core: https://my.telegram.org.
Go to ‘API development tools’ and fill out the form.
You will get basic addresses as well as the api_id and api_hash parameters required
for user authorization.
For the moment each number can only have one api_id connected to it.
But if you need API for Telegram Bot, You can check the API your bot using BotFather.
for detail, you can check on this link
I hope this is useful for you.

In special official bot: https://telegram.me/BotFather
Additional information on official Telegram FAQ page:
https://core.telegram.org/bots/faq#how-do-i-create-a-bot

Are you asking for finding bot's token ?
or are looking for telegram client api code ?
#BotFather , gives you the token of each bot you made.
for getting api token for making client , you must make developer account for telegram. it can be you personal account for telegram .

Related

C# Discord get my own messages in real time

I am familiar with Discord Api and I handling requests using a Bot.
However, I need now just to get my user messages (not a bot), and handle the corresponding events.
I am using discord .net but I am not able to find a clear example for this task, that should be simple...
For a bot, I need to create an application in the dev portal. Do I need the same if I just want it for my user?
Discord gateway https://discord.com/developers/docs/topics/gateway is the best option I guess. This example uses javascript with websockets, and no other configuration is required beside the auth token of the guild: https://www.youtube.com/watch?v=uo7ugT_XQKk
Any example about how to read the own user messages in C#?

How to give my bot access to my telegram account?

I want to manage my account with the bot, I want from bot to read messages from my account and reply inested of me without shows that bot is replying, what is the API for authentication to account and get information from the account?
There is a concept of Userbot among telegram users which is basically using a MTProto library to use your own account like a bot .
You can check Telegram-Paperplane which uses Telethon MTProto Library ,
(Referred this as just an Idea for what you want to do , Check the PMPERMIT feature which might be little bit similar to your goal) ..
Unfortunately it is not written in C# , You need to find MTProto library for C# make something like this to achieve your target .
You cannot access your account with the telegram bot api in that way, so you will have to use the Telegram API
greetings,
Mike

User Avatar in Ms Bot virtual Assistant bot framework V4

I am developing a chat bot using MS bot framework V4 and virtual assistant.I am looking for ways to add avatar.
1) Bot avatar
in Azure Web Chat I updated the bot icon, but the avatar is showing up only when I test in azure web chat.How to setup my bot avatar so that it will show up consistently in every bot channel
2) User avatar.
I am authenticating my user making use of MS graph API and I can find the profile image in token, but not sure where to configure it so that it will show user's avatar along with each response/message
I have gone through the Demo for setting the bot framework server and the webchat for the bot by following the samples provided
bot server == https://github.com/Microsoft/BotBuilder-Samples
webchat == https://github.com/Microsoft/BotFramework-WebChat
but there is no proper example or documentation on how to set the user image after the user has signed in. using the signed user object.
I looked into the discussions mentioned here, here and here. Any suggestions ?
Bot avatar: avatar management is different given channels. There is no way to globally modify your bot avatar for every channel:
For Teams, it is a property of your app package
For the webchat, you can setup the image on your webchat code
Etc
User avatar: same here, there is no quick way of changing the image of the user in the webchat after its start. You pointed the right topic, you will have to dig in the webchat code
Nicolas is correct regarding avatar management across different channels. This answer specifically addresses the "User avatar" question.
Updating the user avatar in Web Chat is possible, however it will require you to use React (or similar) for re-rendering, as well as for state management. This Stack Overflow solution (located here) details how to achieve this.
It does use AAD for obtaining the user photo (for use as the avatar). If you are not using AAD, then change the code to make the appropriate service and API call(s).
Hope of help!
If you are following the webchat samples available at: https://github.com/Microsoft/BotFramework-WebChat. User avatar can be changed by creating a style set using createStyleSet method where you can put many style properties to customize your webchat UI. Among those properties is userAvatarImage which will take the image url for user avatar.
hope this helps.

Instagram Mention API - not able to retrieve media details in DEV mode

Since the existing instagram APIs are deprecated, I am switching to the graph api.
Below is what i want to achieve and what the issue is.
Requirement.
I would like to track the number of likes and comments on instagram posts in which my business account is mentioned using #. I have setup the faccebook and instagram accounts along with the webhook. The webhook is going to send me the "mediaid" in which i my business account is tagged.
Since the app is in the development mode i am not receiving the webhooks if i mention the business account in any of the post, but i am able to send the test webhook from the developer account console. So i assume once the app is in LIVE mode it will start sending the webhooks to my server.
Once the "mediaid" is received i would like to make a call to another api https://developers.facebook.com/docs/instagram-api/reference/user/mentioned_media
in order to get the number of likes and comments.
I am facing an issue on the 2nd part. Whenever i call the api mentioned in the 2nd part i am getting the error
This api call works fine when i pass the mediaid that my instagram business account owns. But as soon as i pass the mediaid of the post which mentioned my business i am getting the above error.
I just wanted to check if this is also a limitation of my facebook app being in a development mode ? Please suggest a solution to achieve this scenario.
I tried the same what you did but with a live facebook app. From the webhook, I got an event when any other user mentioned my instagram business handle in caption and am able to fetch the mentioned media details using the mentioned media API https://developers.facebook.com/docs/instagram-api/reference/user/mentioned_media.
As you didn't share the webhook event payload, I am just assuming you are using the correct user id while making the API call. The JSON path of the user id in event payload is entry[0].id

winform facebook app accept friend request

I am using facebook-c#-sdk to develop a winform FaceBook app, this app should be able to accept friend request and chat with people.
But I didn't find any samples on how to access friend_request in the facebook-c#-sdk.
Can someone help to point out how could I accept friend request?
And especially how can I get the notification first and then accept the request?
Extra information:
The API, [facebook-C#-SDK] is officially supported by Microsoft
http://developers.facebook.com/tools/third-party-sdks/
I already check out the following post but found no solution to my problem.
Accept or decline Friend Request using FB Graph API
If you like, you can chat with my bot during office hour, it works only if I manually accept your friend request.
http://www.facebook.com/ictbot.np
AFAIK, consistent with Igy's link, there is no way for an app to send, accept or refuse a friend request. This is one of many capabilities which Facebook presumably does not consider appropriate for apps.
See https://developers.facebook.com/docs/reference/fql/friend_request/ on reading friend requests using the API, including the considerable limits on doing so.
Thanks Jon Newman for pointing out the limitation of API.
Basically there is no way to do so with Facebook API.
But I do have a workaround, and this workaround only works for certain scenario:
"When you have full control of a facebook account"
In my case ,the app is used only by my Facebook account. I have full control of both, so I will set the notification on in account setting.
When a friend request is send to my facebook, the notification is also send to my gmail.
Then I can retrieve it from gmail, filter out html tag, then a link will appear, open that link in browser.
Done.
Miscellaneous:
1)To retrieve email in gmail:
http://imapx.codeplex.com/releases/view/98061
Basicly Program.ImapClient.Folders[0].Messages[#].HtmlBody.TextData will give you the html data.
2) If your url is wrong, you will be redirected to friend request list where you can accept request manually.

Categories