Skip to content

Commit c223c20

Browse files
authored
Update README.md
1 parent 8114e61 commit c223c20

File tree

1 file changed

+29
-13
lines changed

1 file changed

+29
-13
lines changed

README.md

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,32 @@ On a bot side we can implement any business logic we want.
2929
2. Save your Bot Token
3030

3131
## Starting a sample project
32-
1. In Visual Studio you should enable multi-project startup: https://learn.microsoft.com/en-us/visualstudio/ide/how-to-set-multiple-startup-projects?view=vs-2022
33-
34-
2. In our case, we need to run 2 project simultaneously: Botticelli.Server and Samples\TelegramBotSample
35-
3. After the first run of a bot-project(Samples\TelegramBotSample in pour case), you should find Data\botId file with a generanted botId
36-
4. Copy a generated botId into a clipboard
37-
5. In your browser run http://localhost:5050/swagger (Admin panel functions)
38-
6. Find an AddNewBot([FromBody] RegisterBotRequest request) method with parameters:
39-
- botId (put your botId here)
40-
- botKey (put your Telegram Bot key from a BotFather)
41-
- botType (0 - Telegram)
42-
7. Execute AddNewBot with your parameters
43-
8. Create some new chat/group with your bot (Notice! In order to read messages from a group, your bot account needs admin priveleges!)
44-
9. Enjoy!
32+
1. Go to a folder and edit appsettings.json this way:
33+
`
34+
{
35+
"Logging": {
36+
"LogLevel": {
37+
"Default": "Information",
38+
"Microsoft.AspNetCore": "Warning"
39+
}
40+
},
41+
"SampleSettings": {
42+
"SecureStorageConnectionString": "Filename=../../../database.db;Password=123;ReadOnly=true" // path to a secure storage db, you may you own
43+
},
44+
"ServerSettings": {
45+
"ServerUri": "http://localhost:5050" // path to an admin server, your may configure it (don't forget to check your server settings)
46+
},
47+
"AllowedHosts": "*"
48+
}
49+
50+
`
51+
2. Start a sample bot project at Samples\TelegramMessagingSample. Run run_standalone.sh.
52+
3. After the first run of a bot-project(Samples\TelegramMessagingSample in pour case), you should find Data\botId file with a generated botId
53+
4. Copy a generated *botId* into a clipboard
54+
5. In your browser run https://localhost:7247 (Admin panel).
55+
6. Login with creds: login [email protected] and password 12345678
56+
7. Go to "Your bots" page
57+
8. Click "Add Bot" button, put in your *botId* and click "Save"
58+
9. Create some new chat/group with your bot (Notice! In order to read messages from a group, your bot account needs admin priveleges!)
59+
10. On "Your bots" page click "start/stop" button in order to activate your bot. Here you can track it's status (alive/dead).
60+
11. Enjoy!

0 commit comments

Comments
 (0)