Skip to content
Merged
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions Deployf.Botf/System/UpdateContextExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ public static string GetUserFullName(this IUpdateContext context)

return first + " " + last;
}
public static string? GetLangCode(this IUpdateContext context)
{
var value = context.Update.Message?.From?.LanguageCode
?? context.Update.EditedMessage?.From?.LanguageCode
?? context.Update.CallbackQuery?.From?.LanguageCode
?? context.Update.InlineQuery?.From?.LanguageCode;

return value;
}

public static void StopHandling(this IUpdateContext context)
{
Expand Down