Adding chat functionality to a game using telegram api - chat

I want to add chat functionality to a game I have developed using Unity, and I'm going to use Telegram for that. I didn't found telegram api documentation enough helpful, and it seemed to have steep learning curve specially for advanced features.
So I searched for something that could give me a high level tool, and I found Telegram Cli (also in Python) and Telegram Bot Api. But I don't know that they can be used to develop a chat app. Telgeram Bot is suggesting that is used for creating telgeram bots, not chat app instances. Also Telegram Cli seemed to be a command line version of desktop app.
Anyway what I want to add is chatting with friends, adding other players to friend list, and other thing that a chat application has.
My question is: Can I use either telgeram bot api or telegram cli to create something like a chat application? or I have to use Telegram Api and MTProto?
If I have to use the second method, I would really appreciate some sample code or a simple guide.
Also I have read other questions like this and this. Second one is really good, but I don't understand VB.net. Some C-Like language or python is really better.
and I have read documentation pages like Creating an Authorization Key (Sample) or Creating an Authentication Key, and they weren't enough helpful. TL Language is quite complicated too (IMHO).
Edit: Since it might be ambiguous, I want to use Telegram Api to add chat In my game.

you didn't mention specifically if you want players to chat inside your app or out of your app in telegram?
out of your app: well, you could just create telegram.me/username links inside your app and when a user clicks it. Telegram app would open and he would start chatting with the opponent just right away.
this method is:
easy (no special coding required)
familiar UI
not limited to game users
some might not have telegram installed already and would be forced to download and extra app to use your game
it would be out of your control (who knows when their service might not )
inside your app: you'd have to write your own telegram client, which is not easy and going by telegram rules, like getting pin codes for signing in and other stuff, I don't think it would work for you. Instead if you try to write your own game messaging system yourself, I guess you'll spend less time and get better results.
good amount of coding
have to go by an extra signing process for users
need to keep up with updates and changes

Related

Sync game user progress across devices - unity

I have a really simple game on both iOS and Android written in Unity and I would like to save user progress across devices/OSes.
I already have Facebook analytics in it and so i was thinking i can implement Facebook Login and just save a couple of numbers on the Facebook server.
Upon some research it seems (?) that Facebook doesn't offer anything like that. You have to set up your own server and then just identify the player with Facebook login. A server like that is really an overkill for the game as i just want to save a simple Level Passed number.
Is there any other way? Can i use Facebook like that to save ONE custom user property? Perhaps i can use Google Play Services (both iOS and Android (?) ) to achieve what i want?
Any other free way of saving user progress across devices?
First thing Google play service stopped support for IOS
https://developers.google.com/games/services/ios/quickstart
Other suggestion for Cross platform services like firebase cloud, photon, Gamesprak etc.
https://firebase.google.com/products/firestore/
https://www.photonengine.com/
https://www.gamesparks.com/
Please not most of them giving free service for development only. Before use please check its price details

PubNub based opensource web chat

Have anybody heard of some opensource, or one that can be bought, client-side (web, android, ios) chat based on pure pubnub or pubnub ChatEngine?
The reason I'm asking is that it looks like PubNub gives a reliable backend, but it doesn't come up with UI that we can just use as drop in replacement for our current chat, that doesn't perform well, and we don't really have time to build UI from scratch.
I found many examples of really simple chats, but it's still a long way from that to fully functional chat that we need to replace.
We have a multi-room chat, with users being able to access only some subset of rooms and also open one-on-one chats. Similar to Slack, but with way fewer features.
Thanks
There is a well-made UI for ChatEngine using Vue.js. The example has 1 to 1 chats which can also be chat rooms. There is a tutorial for building the app with ChatEngine on the PubNub Website:
Tutorial:
https://www.pubnub.com/tutorials/chatengine/vuejs/chat-app/
Live Demo:
https://ajb413.github.io/chatengine-vue-chatbot-1to1/
GitHub Repository:
https://github.com/ajb413/chat-engine-vue
Screenshot:

Building a 'bot' that lives in a Google Spreadsheet

I'm wondering if there's Google Apps API support for building a bot that lives in a Spreadsheet and interacts with users via the in-document chat features. I can't find a Google Apps API that defines calls to view and send messages for in-document chat, but I figured I'd ask in here case I'm missing anything!
If this doesn't exist, any suggestions about how I might build out this type of functionality?
I am fairly certain there is no official API for the in-document chat. I do know that the regular Google chat uses XMPP; the in-document chat probably just uses a more limited version.
In theory, I suppose Google should not be able to differentiate between a program and a user. You might be able to reverse-engineer the chat protocol by digging through the source or inspecting the network. You could also run a browser on your machine and simulate mouse and keyboard input, like a regular input.
Alternatively, you could interact with the user using the spreadsheet itself, via the Google Spreadsheet API.

Share saved game data via game center?

I'm trying to figure out if game center is the right tool for me. Here's my situation:
I'm building an app which allows users to create their own musical compositions. I plan to make the compositions exportable and loadable via text file (xml or json format, probably). I'd like to allow users to share their compositions with friends. It seems to me that game kit is the default social network for iOS, so it seems worth looking at. However, the social aspect of game kit seems to be designed mainly for real-time, simultaneous play. Is there any way to share data with friends in a non-realtime way via game center? Is there even a way to send game center contacts a message?
If you look at the documentation for peer-to-peer networking in GameKit, you will probably find exactly what you are looking for, with a tiny exception. It is only for wifi/bluetooth connectivity.
The way I would go with your description is a private server that hosts the compositions. If you are familiar to Java and/or Python, I'd recommend using Google App Engine for the server. That would make the headache a little bit less.
You can use GameKit too, but as you describe it, it's more for real-time communication.
If you implement invitation handlers, you could "invite" another player to receive the composition, but if they reject you will have to retry manually at a later point.
The contents of what you sent over an open "GameKit connection" can be "anything" you like, stuffed into a NSData object, so there is no limits there.
I hope this helps you a tiny bit in the right direction, good luck!

Display Gamecenter leaderboard on website

Is there currently a way to read GameCenter leaderboard data from the Web?
I'm looking for a read only way to display a leaderboard on a companion website. I do not need to post scores or otherwise manipulate the leaderboard off the device.
I have a feeling the answer is going to be no and I'll need to use OpenFeint's because they have a JSON API available.
I have been trying to find an answer to this as well.
I came across an interesting article Game Center via Openfeint
that discusses using Openfeint and Gamecenter together by using the new Openfeint SDK
Then using their JSON API publish results to the supporting website. I cant see any other way around it and feel this is what we need to do. Not the nicest, but you do end up with a game that sits in both communities.
Hope it helps.
If you are the author of the app and your web host provides PHP and MySQL you could roll your own server-side script to process score submissions and another script to generate a dynamic HTML page to display the scores in any way you like. Many web hosts offer PHP and MySQL for free.
There is no ready made solution that I am aware of.
To be honest I don't think there is much to gain from doing this, since players already have access to the leaderboard from within the game, and visitors to a website might not care about high-scores of a game they haven't played. Thats just my opinion.