-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove Newtonsoft.Json Remove IEquatable Remove model interfaces Remove AttachedFile class Code cleanup
- Loading branch information
Showing
449 changed files
with
27,928 additions
and
31,657 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
# Ignore vscode editor files | ||
.vscode/* | ||
# Ignore all folders named publish | ||
**/publish/* | ||
# Nuget packages | ||
nuget.config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
src/library/Telegram.BotAPI/Abstractions/ICustomizableReplyMarkup.cs
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
src/library/Telegram.BotAPI/Abstractions/IExternalThumbnail.cs
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
src/library/Telegram.BotAPI/Abstractions/IFormattableMessage.cs
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
82 changes: 82 additions & 0 deletions
82
src/library/Telegram.BotAPI/Abstractions/ITelegramBotClient.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
// Copyright (c) 2024 Quetzal Rivera. | ||
// Licensed under the MIT License, See LICENCE in the project root for license information. | ||
|
||
using System.Net.Http; | ||
using System.Text.Json; | ||
|
||
namespace Telegram.BotAPI; | ||
|
||
/// <summary> | ||
/// Defines methods to make requests to the Telegram Bot API. | ||
/// </summary> | ||
public interface ITelegramBotClient | ||
{ | ||
/// <summary> | ||
/// Options used to configure the client. | ||
/// </summary> | ||
TelegramBotClientOptions Options { get; } | ||
|
||
/// <summary> | ||
/// Calls a method of the Telegram Bot API and returns the result. | ||
/// </summary> | ||
/// <typeparam name="TResult">Result type.</typeparam> | ||
/// <param name="method">Method name.</param> | ||
/// <param name="args">Method arguments.</param> | ||
/// <returns>An object containing the result of the API call.</returns> | ||
/// <exception cref="ArgumentException">The method arguments are invalid.</exception> | ||
/// <exception cref="BotRequestException">The request failed and the Bot API returned an error.</exception> | ||
/// <exception cref="HttpRequestException">The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout.</exception> | ||
/// <exception cref="JsonException">The response could not be deserialized.</exception> | ||
TResult CallMethod<TResult>(string method, object? args = null); | ||
|
||
/// <summary> | ||
/// Calls a method of the Telegram Bot API and returns the result. | ||
/// </summary> | ||
/// <typeparam name="TResult">Result type.</typeparam> | ||
/// <param name="method">Method name.</param> | ||
/// <param name="args">Method arguments.</param> | ||
/// <param name="cancellationToken">A <see cref="CancellationToken"/> to cancel the request.</param> | ||
/// <returns>An object containing the result of the API call.</returns> | ||
/// <exception cref="ArgumentException">The method arguments are invalid.</exception> | ||
/// <exception cref="BotRequestException">The request failed and the Bot API returned an error.</exception> | ||
/// <exception cref="HttpRequestException">The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout.</exception> | ||
/// <exception cref="JsonException">The response could not be deserialized.</exception> | ||
/// <exception cref="OperationCanceledException">The request was canceled.</exception> | ||
Task<TResult> CallMethodAsync<TResult>( | ||
string method, | ||
object? args = null, | ||
CancellationToken cancellationToken = default | ||
); | ||
|
||
/// <summary> | ||
/// Calls a method of the Telegram Bot API and returns the response. | ||
/// </summary> | ||
/// <typeparam name="TReturn">Response type.</typeparam> | ||
/// <param name="method">Method name.</param> | ||
/// <param name="args">Method arguments.</param> | ||
/// <returns>A <see cref="BotResponse{T}"/> object containing the response.</returns> | ||
/// <exception cref="ArgumentException">The method arguments are invalid.</exception> | ||
/// <exception cref="BotRequestException">The request failed and the Bot API returned an error.</exception> | ||
/// <exception cref="HttpRequestException">The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout.</exception> | ||
/// <exception cref="JsonException">The response could not be deserialized.</exception> | ||
BotResponse<TReturn> CallMethodDirect<TReturn>(string method, object? args = null); | ||
|
||
/// <summary> | ||
/// Calls a method of the Telegram Bot API and returns the response. | ||
/// </summary> | ||
/// <typeparam name="TReturn">Response type.</typeparam> | ||
/// <param name="method">Method name.</param> | ||
/// <param name="args">Method arguments.</param> | ||
/// <param name="cancellationToken">A <see cref="CancellationToken"/> to cancel the request.</param> | ||
/// <returns>A <see cref="BotResponse{T}"/> object containing the response.</returns> | ||
/// <exception cref="ArgumentException">The method arguments are invalid.</exception> | ||
/// <exception cref="BotRequestException">The request failed and the Bot API returned an error.</exception> | ||
/// <exception cref="HttpRequestException">The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout.</exception> | ||
/// <exception cref="JsonException">The response could not be deserialized.</exception> | ||
/// <exception cref="OperationCanceledException">The request was canceled.</exception> | ||
Task<BotResponse<TReturn>> CallMethodDirectAsync<TReturn>( | ||
string method, | ||
object? args = null, | ||
CancellationToken cancellationToken = default | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
src/library/Telegram.BotAPI/Abstractions/SendAttachedFilesArgsBase.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (c) 2024 Quetzal Rivera. | ||
// Licensed under the MIT License, See LICENCE in the project root for license information. | ||
|
||
using Telegram.BotAPI.AvailableTypes; | ||
|
||
namespace Telegram.BotAPI; | ||
|
||
/// <summary> | ||
/// Defines a property to send attached files through multipart/form-data. | ||
/// </summary> | ||
public abstract class AttachedFilesArgsBase | ||
{ | ||
/// <summary> | ||
/// Files to send. | ||
/// </summary> | ||
[JsonIgnore] | ||
public IDictionary<string, InputFile> Files { get; set; } = new Dictionary<string, InputFile>(); | ||
} |
71 changes: 0 additions & 71 deletions
71
src/library/Telegram.BotAPI/Abstractions/SendMessageBase.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.