How to give my bot access to my telegram account? - c#

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

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#?

Microsoft Graph API - Get photo

My company has an internal application where I need to pull/display pictures of all the employees from office 365 with out user intervention.
From what I read online I think I need to call Microsoft graph getphoto API in daemon application to achieve this as per this link (https://developer.microsoft.com/en-us/graph/docs/authorization/app_only).
Will this be a right approach? If yes please point me to any C# sample codes related to this.
Appreciate your responses.
Yes, this is exactly the type of application you will want to build. App-only (machine-to-machine) authentication should be used anytime you don't need a user present to execute functionality.
You can take a look at the ASP.NET Core App Only sample to get a sense of how to register and set up your app to use app-only authentication. The sample goes on to use this access token to set up webhooks, but you can replace this logic with your custom code. You will want to select the scope User.ReadBasic.All to have access to users' profile photos.

Where to find the Telegram Api Key

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 .

Background app to monitor Facebook

I'm building an aggregator for Twitter and Facebook. Via my website users should be able to grant the app access to their Facebook and Twitter profile.
Then, my C# app will, at regular intervals, check the networks (or stream from) for new posts/likes/tweets related to that user and store the result in a database. I will not use Facebook and Twitter as an identity provider for my website.
Now my question: what library should I use best to accomplish the connection with the social networks? Can I use dotnetopenauth for this? Or are there better solutions?
I should also be able to extend the library and add whatever social network later on.
It is probably a very basic question, but I get confused due to all the possible libraries and options. I tweaked a small and simple OAuth class to connect to Twitter, but this was only capably of OAuth 1.0...
Yes, DotNetOpenAuth can help you with this. But you might want to double check the Facebook terms of service, as I thought they forbade any persistence of the data you download from them.
It is indeed possible to do so with DotNetOpenAuth, I know this because I am working on something similar. Already have it working like a charm with Twitter, working on the Facebook link at the moment. Seems like Facebook is going to give me more trouble then I expected at first.

ASP.NET MVC3 and Facebook integration

I'm just about to start a new ASP.NET project using MVC3, and since some of the requirements are about facebook integration, I need your advice on the following issues:
1- Is it achievable to connect my Membership users to thier Facebook accounts so whenever a user share/add/comment on an event on my website, I can automatically share these actions using his/her Facebook account?
2- also the ability to create Facebook events when the user create one on my site, and if he/she updates the event information, I may update them on Facebook too.
3- Can this be achieved using Facebook Connect, or this is only to authenticate users using their Facebook accounts?
4- How about using Graph API from my MVC solution, I know that there is a Facebook C# SDK on Codeplex http://facebooksdk.codeplex.com, but will it satisfy my mentioned needs or not.
Thanks in advance.
I've done something similar recently. Based on my experience:
Yes, you can connect your membership with a Facebook account, however it does not guarantee your user activity will be pushed to Facebook. (users have to log in with Facebook authentication)
Same as above. This blog post does a good job of describing it: http://amirrajan.net/Blog/asp-mvc-and-facebook-single-sign-on
No, facebook connect only takes care of authentication. For more information, check: http://thinkdiff.net/facebook/graph-api-javascript-base-facebook-connect-tutorial/
I have not tried the Facebook SDK you mentioned. However, I believe facebook Graph API already does a good job for you to and will fulfil your requirement

Categories