Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add question to faq about concurrency of updates #117

Open
wants to merge 87 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
97c86c2
Merge pull request #102 from TelegramBots/develop
wiz0u Jun 26, 2024
cea0d94
Merge pull request #103 from TelegramBots/develop
wiz0u Jun 26, 2024
d736e18
Merge pull request #104 from TelegramBots/develop
wiz0u Jun 26, 2024
db92b29
Merge pull request #105 from TelegramBots/develop
wiz0u Jun 28, 2024
e708bbf
Merge pull request #106 from TelegramBots/develop
wiz0u Jun 28, 2024
07eb19a
Merge pull request #107 from TelegramBots/develop
wiz0u Jun 29, 2024
17c51aa
Merge pull request #108 from TelegramBots/develop
wiz0u Jun 30, 2024
874d709
Merge pull request #109 from TelegramBots/develop
wiz0u Jul 1, 2024
9ffeeff
Merge pull request #111 from TelegramBots/develop
wiz0u Jul 2, 2024
39dd33a
Merge pull request #113 from TelegramBots/develop
wiz0u Jul 5, 2024
f87338b
Merge pull request #114 from TelegramBots/develop
wiz0u Jul 7, 2024
1089a74
Merge pull request #115 from TelegramBots/develop
wiz0u Jul 8, 2024
6db101b
Merge pull request #116 from TelegramBots/develop
wiz0u Jul 8, 2024
f2c3458
fix urls
wiz0u Jul 8, 2024
a3d4a59
dotnet nuget add source
wiz0u Jul 8, 2024
db7bf67
updated nuget screenshots
wiz0u Jul 8, 2024
074cf17
horizontal nuget screenshot
wiz0u Jul 8, 2024
10ff84b
some FAQ fixes
wiz0u Jul 9, 2024
3fe6e5e
more fix
wiz0u Jul 9, 2024
f3b501b
added Mini Apps
wiz0u Jul 9, 2024
327dd92
added some badges
wiz0u Jul 9, 2024
4b43880
Use Markdown alerts
wiz0u Jul 9, 2024
842c98b
add mdbook--alerts
wiz0u Jul 9, 2024
1f4b6a5
fix build
wiz0u Jul 9, 2024
50ee470
fix ci.yml
wiz0u Jul 9, 2024
485b5da
fix ci.yml
wiz0u Jul 9, 2024
450fd52
fix ci.yml
wiz0u Jul 9, 2024
7dab7f3
fix ci.yml
wiz0u Jul 9, 2024
1e3847c
ci.yml
wiz0u Jul 9, 2024
3e79c82
ci.yml
wiz0u Jul 9, 2024
bc7c082
typo
wiz0u Jul 9, 2024
15cbd24
doc v21.5
wiz0u Jul 10, 2024
3fec023
new ReplyKeyboardMarkup(true)
wiz0u Jul 10, 2024
22728ad
Update Migration-Guide-to-Version-21.x.md
wiz0u Jul 11, 2024
423e943
Less warnings
wiz0u Jul 11, 2024
dbed18d
improve readability
wiz0u Jul 14, 2024
ecb4b1d
faster ci?
wiz0u Jul 14, 2024
3ace221
ci: try with taiki-e/install-action@v2 & cargo binstall
wiz0u Jul 16, 2024
6fe013f
test
wiz0u Jul 16, 2024
1a8164d
Update for v21.7
wiz0u Jul 17, 2024
ed4ea1a
fix url
wiz0u Jul 17, 2024
a237a29
little fix
wiz0u Jul 17, 2024
2c48dad
minor change
wiz0u Jul 17, 2024
54315db
updating documentation for bot.OnUpdate
wiz0u Jul 18, 2024
4bb8ece
minor fixes
wiz0u Jul 19, 2024
8c78ea1
minor updates
wiz0u Jul 22, 2024
a668ab1
FAQ 27: resend with fileId
wiz0u Jul 23, 2024
d72269c
add TOC to FAQ
wiz0u Jul 23, 2024
8730ac6
Removed logging.md
wiz0u Jul 23, 2024
1e82a0d
fold migration guides
wiz0u Jul 23, 2024
3b4cb80
collapse sections
wiz0u Jul 23, 2024
f598f88
collapse sections
wiz0u Jul 23, 2024
8ad4fb6
Moved migrations in folder
wiz0u Jul 23, 2024
6675f47
oops!
wiz0u Jul 23, 2024
44761a9
oops, i did it again
wiz0u Jul 23, 2024
96f9f8b
fold: open level 1
wiz0u Jul 23, 2024
623aae1
faq before migrations
wiz0u Jul 23, 2024
1546586
reverse migration order
wiz0u Jul 23, 2024
fa6bdce
link for v21 under #-installation
wiz0u Jul 23, 2024
17f5cd8
minor
wiz0u Jul 23, 2024
1f529f7
retitle FAQ
wiz0u Jul 25, 2024
b29e98d
examples badge
wiz0u Jul 26, 2024
5059be8
updated login-widget
wiz0u Jul 28, 2024
33351eb
v21.8
wiz0u Aug 1, 2024
1333b04
Passport Data Errors (fix #10)
wiz0u Aug 1, 2024
c64136c
added chats & business page.
wiz0u Aug 1, 2024
69f79a3
more details about update/message types (fix #14)
wiz0u Aug 2, 2024
feb5791
Login Widget doesn't deserve a separate page
wiz0u Aug 2, 2024
17f6055
filled business.md
wiz0u Aug 2, 2024
fbc2979
minor fix
wiz0u Aug 2, 2024
6de9408
doc v21.9
wiz0u Aug 3, 2024
9f2663c
small detail
wiz0u Aug 3, 2024
68a879e
FAQ: DropPendingUpdatesAsync
wiz0u Aug 8, 2024
0672c5a
some fix
wiz0u Aug 8, 2024
234785d
fix links in migrate/*
wiz0u Aug 12, 2024
6ebe9d1
Doc on Payments API
wiz0u Aug 20, 2024
f8d4ad2
Payments: adding full example
wiz0u Aug 20, 2024
69059fc
Payments: reorder sendInvoice
wiz0u Aug 20, 2024
a5b9913
Payments: adding log
wiz0u Aug 20, 2024
6bc3369
payments: log first
wiz0u Aug 20, 2024
841158f
minor tweak
wiz0u Aug 20, 2024
7690aa3
reorder advanced topics
wiz0u Aug 20, 2024
bdcf174
pkgs.dev.azure.com feed
wiz0u Aug 23, 2024
25a0336
updated webapps.md
wiz0u Aug 26, 2024
5b67a21
docs: add question number 28
elementh Aug 27, 2024
f9a5279
docs: add bit about contributing back
elementh Aug 27, 2024
fb4eaee
docs: update webhook documentation with link to question 28 in common…
elementh Aug 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ indent_size = 2
# Markdown Files
[*.md]
trim_trailing_whitespace = false
indent_size = 2
indent_size = 4
24 changes: 17 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,24 @@ jobs:
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v2
with:
mdbook-version: '0.4.35'
- name: Setup nodejs
uses: actions/setup-node@v4

- name: Install mdbook and cargo-binstall binaries
uses: taiki-e/install-action@v2
with:
node-version: '18'
tool: mdbook,cargo-binstall
- name: Install mdbook extensions
run: cargo binstall -y mdbook-mermaid mdbook-alerts mdbook-toc

# - name: Setup mdBook
# uses: peaceiris/actions-mdbook@v2
# with:
# mdbook-version: '0.4.36'
# - run: cargo install mdbook-alerts
# - name: Setup nodejs
# uses: actions/setup-node@v4
# with:
# node-version: '18'

# - name: Setup linter and spellchecker cli
# run: npm install --location=global markdownlint-cli cspell
# - name: Lint markdown files
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Executables
*.exe
*.pdn

# msBook compiled book
book
Expand Down
10 changes: 10 additions & 0 deletions Examples/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ csharp_empty_block_style = together
csharp_max_line_length = 120

# Solution Files

# CS1998: Async method lacks 'await' operators and will run synchronously
dotnet_diagnostic.CS1998.severity = silent

# IDE0062: Make local function 'static'
dotnet_diagnostic.IDE0062.severity = silent

# CA2016: Forward the 'CancellationToken' parameter to methods
dotnet_diagnostic.CA2016.severity = none

[*.sln]
indent_style = tab

Expand Down
35 changes: 0 additions & 35 deletions Examples/1/ExampleBot.cs

This file was deleted.

18 changes: 0 additions & 18 deletions Examples/1/Quickstart.cs

This file was deleted.

75 changes: 27 additions & 48 deletions Examples/2/ReplyMarkup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,104 +10,83 @@ namespace BookExamples.Chapter2;

internal class ReplyMarkup
{
public readonly ITelegramBotClient bot = new TelegramBotClient("{YOUR_ACCESS_TOKEN_HERE}");
public readonly ITelegramBotClient bot = new TelegramBotClient("YOUR_BOT_TOKEN");
public readonly ChatId chatId = 12345;

private async Task SingleRowMarkup()
{
// ANCHOR: single-row
var buttons = new KeyboardButton[]
{
"Help me", "Call me ☎️",
};
var replyMarkup = new ReplyKeyboardMarkup(true)
.AddButtons("Help me", "Call me ☎️");

var sent = await bot.SendTextMessageAsync(chatId, "Choose a response",
replyMarkup: new ReplyKeyboardMarkup(buttons) { ResizeKeyboard = true });
var sent = await bot.SendTextMessageAsync(chatId, "Choose a response", replyMarkup: replyMarkup);
// ANCHOR_END: single-row
}

private async Task MultipleRowMarkup()
{
// ANCHOR: multiple-row
var buttons = new KeyboardButton[][]
{
new KeyboardButton[] { "Help me" },
new KeyboardButton[] { "Call me ☎️", "Write me ✉️" },
};
var replyMarkup = new ReplyKeyboardMarkup(true)
.AddButton("Help me")
.AddNewRow("Call me ☎️", "Write me ✉️");

var sent = await bot.SendTextMessageAsync(chatId, "Choose a response",
replyMarkup: new ReplyKeyboardMarkup(buttons) { ResizeKeyboard = true });
var sent = await bot.SendTextMessageAsync(chatId, "Choose a response", replyMarkup: replyMarkup);
// ANCHOR_END: multiple-row
}

private async Task RequestInfo()
{
// ANCHOR: request-info
var buttons = new[]
{
KeyboardButton.WithRequestLocation("Share Location"),
KeyboardButton.WithRequestContact("Share Contact"),
};
var replyMarkup = new ReplyKeyboardMarkup()
.AddButton(KeyboardButton.WithRequestLocation("Share Location"))
.AddButton(KeyboardButton.WithRequestContact("Share Contact"));

var sent = await bot.SendTextMessageAsync(chatId, "Who or Where are you?",
replyMarkup: new ReplyKeyboardMarkup(buttons));
var sent = await bot.SendTextMessageAsync(chatId, "Who or Where are you?", replyMarkup: replyMarkup);
// ANCHOR_END: request-info
}

private async Task RemoveKeyboard()
{
// ANCHOR: remove-keyboard
var sent = await bot.SendTextMessageAsync(chatId, "Removing keyboard",
replyMarkup: new ReplyKeyboardRemove());
await bot.SendTextMessageAsync(chatId, "Removing keyboard", replyMarkup: new ReplyKeyboardRemove());
// ANCHOR_END: remove-keyboard
}

private async Task CallbackButtons()
{
// ANCHOR: callback-buttons
var buttons = new InlineKeyboardButton[][]
{
new[] // first row
{
InlineKeyboardButton.WithCallbackData("1.1", "11"),
InlineKeyboardButton.WithCallbackData("1.2", "12"),
},
new[] // second row
{
InlineKeyboardButton.WithCallbackData("2.1", "21"),
InlineKeyboardButton.WithCallbackData("2.2", "22"),
},
};
var inlineMarkup = new InlineKeyboardMarkup()
.AddButton("1.1", "11") // first row, first button
.AddButton("1.2", "12") // first row, second button
.AddNewRow()
.AddButton("2.1", "21") // second row, first button
.AddButton("2.2", "22");// second row, second button

var sent = await bot.SendTextMessageAsync(chatId, "A message with an inline keyboard markup",
replyMarkup: new InlineKeyboardMarkup(buttons));
replyMarkup: inlineMarkup);
// ANCHOR_END: callback-buttons
}

private async Task UrlButtons()
{
// ANCHOR: url-buttons
var buttons = new[]
{
InlineKeyboardButton.WithUrl("Repository Link", "https://github.com/TelegramBots/Telegram.Bot")
};
var inlineMarkup = new InlineKeyboardMarkup()
.AddButton(InlineKeyboardButton.WithUrl("Repository Link", "https://github.com/TelegramBots/Telegram.Bot"));

var sent = await bot.SendTextMessageAsync(chatId, "A message with an inline keyboard markup",
replyMarkup: new InlineKeyboardMarkup(buttons));
replyMarkup: inlineMarkup);
// ANCHOR_END: url-buttons
}

private async Task SwitchToInline()
{
// ANCHOR: switch-to-inline
var buttons = new[]
{
InlineKeyboardButton.WithSwitchInlineQuery("switch_inline_query"),
InlineKeyboardButton.WithSwitchInlineQueryCurrentChat("switch_inline_query_current_chat"),
};
var inlineMarkup = new InlineKeyboardMarkup()
.AddButton(InlineKeyboardButton.WithSwitchInlineQuery("switch_inline_query"))
.AddButton(InlineKeyboardButton.WithSwitchInlineQueryCurrentChat("switch_inline_query_current_chat"));

var sent = await bot.SendTextMessageAsync(chatId, "A message with an inline keyboard markup",
replyMarkup: new InlineKeyboardMarkup(buttons));
replyMarkup: inlineMarkup);
// ANCHOR_END: switch-to-inline
}
}
4 changes: 2 additions & 2 deletions Examples/2/SendMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Examples.Chapter2;

internal class SendMessage
{
public readonly ITelegramBotClient bot = new TelegramBotClient("{YOUR_ACCESS_TOKEN_HERE}");
public readonly ITelegramBotClient bot = new TelegramBotClient("YOUR_BOT_TOKEN");
public readonly ChatId chatId = 12345;
public readonly Update update = new ();

Expand Down Expand Up @@ -90,7 +90,7 @@ private async Task SendPoll()
// ANCHOR_END: send-poll

// ANCHOR: stop-poll
Poll poll = await bot.StopPollAsync(pollMessage.Chat.Id, pollMessage.MessageId);
Poll poll = await bot.StopPollAsync(pollMessage.Chat, pollMessage.MessageId);
// ANCHOR_END: stop-poll
}

Expand Down
2 changes: 1 addition & 1 deletion Examples/3/Files.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Examples.Chapter3;

internal class Files
{
public readonly ITelegramBotClient bot = new TelegramBotClient("{YOUR_ACCESS_TOKEN_HERE}");
public readonly ITelegramBotClient bot = new TelegramBotClient("YOUR_BOT_TOKEN");
public readonly ChatId chatId = 12345;
public readonly Update update = new();

Expand Down
2 changes: 1 addition & 1 deletion Examples/3/Inline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace BookExamples.Chapter3;

internal class Inline
{
public readonly ITelegramBotClient bot = new TelegramBotClient("{YOUR_ACCESS_TOKEN_HERE}");
public readonly ITelegramBotClient bot = new TelegramBotClient("YOUR_BOT_TOKEN");
// ANCHOR: arrays
private readonly string[] sites = { "Google", "Github", "Telegram", "Wikipedia" };
private readonly string[] siteDescriptions =
Expand Down
33 changes: 0 additions & 33 deletions Examples/3/LongPolling.cs

This file was deleted.

2 changes: 1 addition & 1 deletion Examples/Examples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Telegram.Bot" Version="21.1.0-ci.1306" />
<PackageReference Include="Telegram.Bot" Version="21.7.0" />
</ItemGroup>

<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion Examples/nuget.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="nuget.voids.site" value="https://nuget.voids.site/v3/index.json" />
<add key="Telegram.Bot" value="https://pkgs.dev.azure.com/tgbots/Telegram.Bot/_packaging/release/nuget/v3/index.json" />
<add key="Telegram.Bot ci" value="https://pkgs.dev.azure.com/tgbots/Telegram.Bot/_packaging/Telegram.Bot/nuget/v3/index.json" />
</packageSources>
</configuration>
15 changes: 14 additions & 1 deletion book.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[book]
authors = ["Poulad Ashrafpour", "Aleksey Usatov", "karb0f0s", "Miha Zupan"]
authors = ["Poulad Ashrafpour", "Aleksey Usatov", "karb0f0s", "Miha Zupan", "Wizou"]
multilingual = false
src = "src"
title = "A guide to Telegram.Bot library"
Expand All @@ -9,3 +9,16 @@ language = "en"
[output.html]
git-repository-url = "https://github.com/TelegramBots/book"
additional-css = ["theme/custom.css"]

[output.html.fold]
enable = true
level = 1

[preprocessor.alerts]

[preprocessor.toc]
command = "mdbook-toc"
renderer = ["html"]

[output.html.redirect]
"Migration-Guide-to-Version-21.x.html" = "migrate/Version-21.x.html"
Binary file removed src/1/docs/NugetPackageManager.jpg
Binary file not shown.
Binary file added src/1/docs/NugetPackageManager.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading