Skip to content

Commit 5b29319

Browse files
committed
Add Rider Quickstart Guide
1 parent 2b5a909 commit 5b29319

File tree

6 files changed

+58
-6
lines changed

6 files changed

+58
-6
lines changed

Media/CreateProjectRider.gif

466 KB
Loading

Media/InstallNugetPackageRider.gif

278 KB
Loading

Media/RunProjectRider.jpg

19.1 KB
Loading

Quickstart/QuickstartGuideRider.md

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,60 @@ thanks for your interested in using [RxTelegram.Bot](https://github.com/RxTelegr
1414

1515
Before we can get started you need to create a Telegram Bot by visiting [@BotFather](https://t.me/BotFather) with any Telegram client and create a new bot. He will give you an access token which you need to authorize your bot at every request, but do not worry we will handle this for you.
1616

17-
## 2.
18-
> Comming soon!
17+
## 2. Hello World - by clicking
1918

20-
## 3.
21-
> Comming soon!
19+
This Tutotial will not explain how to get Rider installed, but you need a working Rider installation so go and set it up. It is quite simple just ask any search engine and you will find many tutorial or click [here](https://www.jetbrains.com/help/rider/Installation_guide.html) follow the offical tutorial by Jetbrains.
20+
21+
So since you have a running Rider installation, lets begin.
22+
23+
### 2.1 Create a Project
24+
25+
First of all you have to create a new "Console Application" as shown in the video below.
26+
![Creating a new Project in Rider](../Media/CreateProjectRider.gif)
27+
28+
### 2.2 Install RxTelegram.Bot
29+
30+
Now you have to install the [RxTelegram.Bot](https://github.com/RxTelegram/RxTelegram.Bot) Nuget package as shown in the video below.
31+
![Installing RxTelegram.Bot](../Media/InstallNugetPackageRider.gif)
32+
33+
### 2.3 Paste the code
34+
35+
Open the ```Programm.cs``` file and paste the following content.
36+
37+
> **Replace ACCESS_TOKEN_HERE with the access token Botfaher gave you.**
38+
39+
```csharp
40+
using System;
41+
using RxTelegram.Bot;
42+
43+
namespace Awesome {
44+
class Program {
45+
public static void Main () {
46+
var botClient = new TelegramBot ("ACCESS_TOKEN_HERE");
47+
var me = botClient.GetMe().Result;
48+
Console.WriteLine (
49+
$"Hello, World! I am bot number {me.Id}. My name is {me.FirstName}."
50+
);
51+
}
52+
}
53+
}
54+
```
55+
56+
## 3. Run your programm
57+
58+
The last step is quid simple. Just click on the "Bug" button and your awesome Project will start.
59+
![Running the project](../Media/RunProjectRider.jpg)
60+
61+
## Troubleshooting
62+
63+
### Invalid Bot Token
64+
65+
```text
66+
Unhandled exception. RxTelegram.Bot.Exceptions.InvalidTokenException: The given bot token is not valid. See "https://core.telegram.org/bots/api#authorizing-your-bot" for further information. Token was: ACCESS_TOKEN_HERE
67+
at RxTelegram.Bot.BotInfo.ValidateToken(String token)
68+
at RxTelegram.Bot.BotInfo..ctor(String token)
69+
at RxTelegram.Bot.TelegramBot..ctor(String token)
70+
at Awesome.Program.Main() in C:\Users\nikwe\Downloads\asf\Program.cs:line 7
71+
```
72+
73+
If you get an Exception like this it is most likely that you did not replaced the access token in the code sample or you copied the wrong one.

Quickstart/QuickstartGuideTerminal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Just open up your Terminal in a new Folder and run the following commands.
4444
var botClient = new TelegramBot ("ACCESS_TOKEN_HERE");
4545
var me = botClient.GetMe().Result;
4646
Console.WriteLine (
47-
$"Hello, World! I am user {me.Id} and my name is {me.FirstName}."
47+
$"Hello, World! I am bot number {me.Id}. My name is {me.FirstName}."
4848
);
4949
}
5050
}

Quickstart/QuickstartGuideVisualStudio.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ namespace Awesome {
4646
var botClient = new TelegramBot ("ACCESS_TOKEN_HERE");
4747
var me = botClient.GetMe().Result;
4848
Console.WriteLine (
49-
$"Hello, World! I am user {me.Id} and my name is {me.FirstName}."
49+
$"Hello, World! I am bot number {me.Id}. My name is {me.FirstName}."
5050
);
5151
}
5252
}

0 commit comments

Comments
 (0)