Skip to content

Commit

Permalink
Bot active users
Browse files Browse the repository at this point in the history
  • Loading branch information
FrayxRulez committed Jul 22, 2024
1 parent 9ce93ff commit 58dc76b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Telegram/Controls/Cells/ProfileCell.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ public void UpdateUser(IClientService clientService, User user, int photoSize, b
SubtitleLabel.Text = PhoneNumber.Format(user.PhoneNumber);
}
}
else if (user.Type is UserTypeBot)
else if (user.Type is UserTypeBot bot)
{
SubtitleLabel.Text = Strings.Bot;
SubtitleLabel.Text = bot.ActiveUserCount > 0 ? Locale.Declension(Strings.R.BotDAU, bot.ActiveUserCount) : Strings.Bot;
SubtitleLabel.Style = BootStrapper.Current.Resources["InfoCaptionTextBlockStyle"] as Style;
}
else
Expand Down
2 changes: 1 addition & 1 deletion Telegram/Converters/LastSeenConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public static string GetLabel(User user, bool details)
{
if (details)
{
return Strings.Bot;
return bot.ActiveUserCount > 0 ? Locale.Declension(Strings.R.BotDAU, bot.ActiveUserCount) : Strings.Bot;
}

return bot.CanReadAllGroupMessages ? Strings.BotStatusRead : Strings.BotStatusCantRead;
Expand Down
3 changes: 2 additions & 1 deletion Telegram/Strings/en/Resources.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// <auto-generatedInfo>
// This code was generated by TdParseOptions (http://github.com/UnigramDev/UnigramUtils/)
//
// Generated: 07/19/2024 16:21:10
// Generated: 07/22/2024 10:21:03
// </auto-generatedInfo>
// --------------------------------------------------------------------------------------------------
namespace Telegram
Expand Down Expand Up @@ -63,6 +63,7 @@ public static class R
public const string BoostingReassignBoostTextPluralWithLink = "BoostingReassignBoostTextPluralWithLink";
public const string BoostingShowMoreBoosts = "BoostingShowMoreBoosts";
public const string BoostStories = "BoostStories";
public const string BotDAU = "BotDAU";
public const string BotMultiContactsSelectorLimit = "BotMultiContactsSelectorLimit";
public const string BotStarsButtonWithdraw = "BotStarsButtonWithdraw";
public const string BotStarsWithdrawMinLimit = "BotStarsWithdrawMinLimit";
Expand Down
6 changes: 6 additions & 0 deletions Telegram/Strings/en/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -1982,6 +1982,12 @@ from **{0}**.</value>
<data name="BotChangeSettings" xml:space="preserve">
<value>Change Bot Settings</value>
</data>
<data name="BotDAU_one" xml:space="preserve">
<value>{0} user</value>
</data>
<data name="BotDAU_other" xml:space="preserve">
<value>{0} users</value>
</data>
<data name="BotEditCommands" xml:space="preserve">
<value>Edit Commands</value>
</data>
Expand Down

0 comments on commit 58dc76b

Please sign in to comment.