< Summary

Information
Class: TeleFlow.Telegram.BotCommands
Assembly: TeleFlow.Telegram.Client
File(s): /_/src/TeleFlow.Telegram.Client/BotCommands.cs
Line coverage
100%
Covered lines: 11
Uncovered lines: 0
Coverable lines: 11
Total lines: 30
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
Create(...)100%11100%
Ephemeral(...)100%11100%

File(s)

/_/src/TeleFlow.Telegram.Client/BotCommands.cs

#LineLine coverage
 1using TeleFlow.Telegram.Schema.Types;
 2
 3namespace TeleFlow.Telegram;
 4
 5/// <summary>
 6/// Creates explicit Bot API command descriptors for application startup configuration.
 7/// It does not discover handler routes or publish commands automatically.
 8/// </summary>
 9public static class BotCommands
 10{
 11    public static BotCommand Create(string command, string description)
 12    {
 113        ArgumentException.ThrowIfNullOrWhiteSpace(command);
 114        ArgumentException.ThrowIfNullOrWhiteSpace(description);
 15
 116        return new BotCommand
 117        {
 118            Command = command,
 119            Description = description
 120        };
 21    }
 22
 23    public static BotCommand Ephemeral(string command, string description)
 24    {
 125        return Create(command, description) with
 126        {
 127            IsEphemeral = true
 128        };
 29    }
 30}