Repository of Telegram MiniApp written in ASP.NET C# using React.Js. The main purpose of this MiniApp is a collection of a certain number of simple card games for a company, where you just need to take information from the card, and interact with your friends.
![](https://private-user-images.githubusercontent.com/111704140/273396262-44bd7204-4e9b-4bfd-8342-75fa132a56ba.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUyMjgzNjAsIm5iZiI6MTcyNTIyODA2MCwicGF0aCI6Ii8xMTE3MDQxNDAvMjczMzk2MjYyLTQ0YmQ3MjA0LTRlOWItNGJmZC04MzQyLTc1ZmExMzJhNTZiYS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwOTAxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDkwMVQyMjAxMDBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT03Mzg3YzJjMTExZWM2YWViYTA4MzI0NGMxNWJlZTE5MWY3MTRjNmY2MTAxZTY2MDU3YWM4OTQ0NWRiYTQ4ZTVmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.GDUOrPnPQnDQ3ZoFU9FA2kqdxibHwaLqIBubmJF03Cg)
The app was written for a Telegram contest. Contest
What Is "This or That"? This or That is an easy-to-play word game in which you must choose between two things. These two options could be funny, mundane, or totally outrageous. Even if neither option appeals to you, you have to choose one or the other.
Truth or dare? is a mostly verbal party game requiring two or more players. Players are given the choice between answering a question truthfully, or performing a "dare". The game is particularly popular among adolescents and children, and is sometimes used as a forfeit when gambling.
Before you begin, ensure you have the following prerequisites installed on your machine:
- Visual Studio or Rider.
- .NET SDK.
- MongoDB installed locally.
Step 1: Copy this repository on your local machine.
Step 2: Open CardGamesGuruMiniApp.sln file in your Visual Studio or Rider.
Step 3: Run mongod.exe for start local mongodb.
Step 4: Run Debug version in your IDE.
Step 5: First, you need to run a couple of requests to create all the collections and the database itself in mongo.
https://localhost:5001/api/game/create - for creating game.
Contract example:
{
// The name of the game to be displayed in the game selection start menu.
"Name":"This Or That",
// The key by which the game is searched.
"NameIndex":"tot",
"Description":"This or that is a simple talking game where players choose which of two items they prefer. Best for: A small group, maybe even two players only.",
// The type of game. Can be: None = 0 (default), NoPlayersJustCards = 1, MultiPlayerGame = 2
"GameType":"NoPlayersJustCards",
// Address to contoller.
"Endpoint":"api/tot/",
// Colors for button.
"Colors" : [
"rgb(45, 89, 134)",
"rgb(121, 166, 0)"
],
"font": "Monospace"
}
https://localhost:5001/api/tot/create - for creating card for tot game.
Contract example:
{
"FirstQuestion": "Apple",
"SecondQuestion": "Android"
}
It is also faster to run the project on your machine via docker-compose. You just need to have Docker and that's it. Go to the project folder and open cmd. Use this commad:
docker-compose up
After that you can make the same requests for creating collection inside mongo container.
We have an application running on a local machine that can only be accessed from it. And we need to check how it will work in Telegram itself.
- Create your own bot. Telegram bot creating tutorial
- Take the URL of your web page, like
https://localhost:5001
- Change
localhost
to127.0.0.1
- In the BotFather pick to Edit Main Button Url.
- And send him your URL.
https://127.0.0.1:5001
To see all possible API requests and contracts, you can use Swagger.
Just add /swagger
to the end: https://localhost:5001/swagger
Other information about mini-app on Wiki: CardGamesGuruMiniApp Wiki