Skip to content

Commit

Permalink
fix: params
Browse files Browse the repository at this point in the history
  • Loading branch information
greenhat616 committed Oct 28, 2024
1 parent cf36ad8 commit c8697da
Show file tree
Hide file tree
Showing 41 changed files with 140 additions and 140 deletions.
16 changes: 8 additions & 8 deletions pmcenter/BotCommands/AutoSaveCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ public async Task<bool> ExecuteAsync(TelegramBotClient botClient, Update update)
_ = await botClient.SendTextMessageAsync(update.Message.From.Id,
Vars.CurrentLang.Message_AutoSaveDisabled,
parseMode: ParseMode.Markdown,
protectContent: false,
linkPreviewOptions: false,
disableNotification: Vars.CurrentConf.DisableNotifications,
messageThreadId: update.Message.MessageId).ConfigureAwait(false);
replyParameters: update.Message.MessageId).ConfigureAwait(false);
if (Vars.SyncConf != null) Vars.SyncConf.Interrupt();
return true;
}
Expand All @@ -41,16 +41,16 @@ public async Task<bool> ExecuteAsync(TelegramBotClient botClient, Update update)
_ = await botClient.SendTextMessageAsync(update.Message.From.Id,
Vars.CurrentLang.Message_AutoSaveEnabled.Replace("$1", (interval / 1000).ToString()),
parseMode: ParseMode.Markdown,
protectContent: false,
linkPreviewOptions: false,
disableNotification: Vars.CurrentConf.DisableNotifications,
messageThreadId: update.Message.MessageId).ConfigureAwait(false);
replyParameters: update.Message.MessageId).ConfigureAwait(false);
if (interval < 5000)
_ = await botClient.SendTextMessageAsync(update.Message.From.Id,
Vars.CurrentLang.Message_AutoSaveIntervalTooShort.Replace("$1", interval.ToString()),
parseMode: ParseMode.Markdown,
protectContent: false,
linkPreviewOptions: false,
disableNotification: Vars.CurrentConf.DisableNotifications,
messageThreadId: update.Message.MessageId).ConfigureAwait(false);
replyParameters: update.Message.MessageId).ConfigureAwait(false);
if ((Vars.SyncConf == null) || !Vars.SyncConf.IsAlive)
{
Vars.SyncConf = new Thread(() => Methods.ThrSyncConf());
Expand All @@ -64,9 +64,9 @@ public async Task<bool> ExecuteAsync(TelegramBotClient botClient, Update update)
_ = await botClient.SendTextMessageAsync(update.Message.From.Id,
Vars.CurrentLang.Message_GeneralFailure.Replace("$1", ex.ToString()),
parseMode: ParseMode.Markdown,
protectContent: false,
linkPreviewOptions: false,
disableNotification: Vars.CurrentConf.DisableNotifications,
messageThreadId: update.Message.MessageId).ConfigureAwait(false);
replyParameters: update.Message.MessageId).ConfigureAwait(false);
return true;
}
}
Expand Down
4 changes: 2 additions & 2 deletions pmcenter/BotCommands/BackupConfCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ public async Task<bool> ExecuteAsync(TelegramBotClient botClient, Update update)
update.Message.From.Id,
Vars.CurrentLang.Message_BackupComplete.Replace("$1", randomFilename),
parseMode: ParseMode.Markdown,
protectContent: false,
linkPreviewOptions: false,
disableNotification: Vars.CurrentConf.DisableNotifications,
messageThreadId: update.Message.MessageId).ConfigureAwait(false);
replyParameters: update.Message.MessageId).ConfigureAwait(false);
return true;
}
}
Expand Down
4 changes: 2 additions & 2 deletions pmcenter/BotCommands/BanCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public async Task<bool> ExecuteAsync(TelegramBotClient botClient, Update update)
update.Message.From.Id,
Vars.CurrentLang.Message_UserBanned,
parseMode: ParseMode.Markdown,
protectContent: false,
linkPreviewOptions: false,
disableNotification: Vars.CurrentConf.DisableNotifications,
messageThreadId: update.Message.MessageId).ConfigureAwait(false);
replyParameters: update.Message.MessageId).ConfigureAwait(false);
return true;
}
}
Expand Down
8 changes: 4 additions & 4 deletions pmcenter/BotCommands/BanIdCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ public async Task<bool> ExecuteAsync(TelegramBotClient botClient, Update update)
update.Message.From.Id,
Vars.CurrentLang.Message_UserBanned,
parseMode: ParseMode.Markdown,
protectContent: false,
linkPreviewOptions: false,
disableNotification: Vars.CurrentConf.DisableNotifications,
messageThreadId: update.Message.MessageId).ConfigureAwait(false);
replyParameters: update.Message.MessageId).ConfigureAwait(false);
}
catch (Exception ex)
{
_ = await botClient.SendTextMessageAsync(
update.Message.From.Id,
Vars.CurrentLang.Message_GeneralFailure.Replace("$1", ex.Message),
parseMode: ParseMode.Markdown,
protectContent: false,
linkPreviewOptions: false,
disableNotification: Vars.CurrentConf.DisableNotifications,
messageThreadId: update.Message.MessageId).ConfigureAwait(false);
replyParameters: update.Message.MessageId).ConfigureAwait(false);
}
return true;
}
Expand Down
12 changes: 6 additions & 6 deletions pmcenter/BotCommands/CatConfigCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public async Task<bool> ExecuteAsync(TelegramBotClient botClient, Update update)
update.Message.From.Id,
Vars.CurrentLang.Message_CurrentConf.Replace("$1", text),
parseMode: ParseMode.Markdown,
protectContent: false,
linkPreviewOptions: false,
disableNotification: Vars.CurrentConf.DisableNotifications,
messageThreadId: update.Message.MessageId).ConfigureAwait(false);
replyParameters: update.Message.MessageId).ConfigureAwait(false);
return true;
}
else
Expand All @@ -33,18 +33,18 @@ public async Task<bool> ExecuteAsync(TelegramBotClient botClient, Update update)
update.Message.From.Id,
Vars.CurrentLang.Message_CurrentConf.Replace("$1", texts[0]),
parseMode: ParseMode.Markdown,
protectContent: false,
linkPreviewOptions: false,
disableNotification: Vars.CurrentConf.DisableNotifications,
messageThreadId: update.Message.MessageId).ConfigureAwait(false);
replyParameters: update.Message.MessageId).ConfigureAwait(false);
for (int i = 1; i < texts.Count; i++)
{
_ = await botClient.SendTextMessageAsync(
update.Message.From.Id,
($"`{texts[i]}`"),
parseMode: ParseMode.Markdown,
protectContent: false,
linkPreviewOptions: false,
disableNotification: Vars.CurrentConf.DisableNotifications,
messageThreadId: update.Message.MessageId).ConfigureAwait(false);
replyParameters: update.Message.MessageId).ConfigureAwait(false);
}
return true;
}
Expand Down
8 changes: 4 additions & 4 deletions pmcenter/BotCommands/ChatCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ public async Task<bool> ExecuteAsync(TelegramBotClient botClient, Update update)
_ = await botClient.SendTextMessageAsync(update.Message.From.Id,
Vars.CurrentLang.Message_ContinuedChatEnabled.Replace("$1", replacementText),
parseMode: ParseMode.Markdown,
protectContent: false,
linkPreviewOptions: false,
disableNotification: Vars.CurrentConf.DisableNotifications,
messageThreadId: update.Message.MessageId).ConfigureAwait(false);
replyParameters: update.Message.MessageId).ConfigureAwait(false);
return true;
}
catch (Exception ex)
Expand All @@ -67,9 +67,9 @@ public async Task<bool> ExecuteAsync(TelegramBotClient botClient, Update update)
_ = await botClient.SendTextMessageAsync(update.Message.From.Id,
Vars.CurrentLang.Message_GeneralFailure.Replace("$1", ex.ToString()),
parseMode: ParseMode.Markdown,
protectContent: false,
linkPreviewOptions: false,
disableNotification: Vars.CurrentConf.DisableNotifications,
messageThreadId: update.Message.MessageId).ConfigureAwait(false);
replyParameters: update.Message.MessageId).ConfigureAwait(false);
return true;
}
}
Expand Down
12 changes: 6 additions & 6 deletions pmcenter/BotCommands/CheckUpdateCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ public async Task<bool> ExecuteAsync(TelegramBotClient botClient, Telegram.Bot.T
update.Message.From.Id,
updateString,
parseMode: ParseMode.Markdown,
protectContent: false,
linkPreviewOptions: false,
disableNotification: Vars.CurrentConf.DisableNotifications,
messageThreadId: update.Message.MessageId).ConfigureAwait(false);
replyParameters: update.Message.MessageId).ConfigureAwait(false);
}
else
{
Expand All @@ -45,9 +45,9 @@ public async Task<bool> ExecuteAsync(TelegramBotClient botClient, Telegram.Bot.T
.Replace("$2", Vars.AppVer.ToString())
.Replace("$3", latest.UpdateCollection[currentLocalizedIndex].Details),
parseMode: ParseMode.Markdown,
protectContent: false,
linkPreviewOptions: false,
disableNotification: Vars.CurrentConf.DisableNotifications,
messageThreadId: update.Message.MessageId).ConfigureAwait(false);
replyParameters: update.Message.MessageId).ConfigureAwait(false);
}
return true;
}
Expand All @@ -58,9 +58,9 @@ public async Task<bool> ExecuteAsync(TelegramBotClient botClient, Telegram.Bot.T
update.Message.From.Id,
errorString,
parseMode: ParseMode.Markdown,
protectContent: false,
linkPreviewOptions: false,
disableNotification: Vars.CurrentConf.DisableNotifications,
messageThreadId: update.Message.MessageId).ConfigureAwait(false);
replyParameters: update.Message.MessageId).ConfigureAwait(false);
return true;
}
}
Expand Down
4 changes: 2 additions & 2 deletions pmcenter/BotCommands/ClearMessageLinksCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public async Task<bool> ExecuteAsync(TelegramBotClient botClient, Update update)
update.Message.From.Id,
Vars.CurrentLang.Message_MsgLinksCleared,
parseMode: ParseMode.Markdown,
protectContent: false,
linkPreviewOptions: false,
disableNotification: Vars.CurrentConf.DisableNotifications,
messageThreadId: update.Message.MessageId).ConfigureAwait(false);
replyParameters: update.Message.MessageId).ConfigureAwait(false);
return true;
}
}
Expand Down
4 changes: 2 additions & 2 deletions pmcenter/BotCommands/DetectPermissionCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ public async Task<bool> ExecuteAsync(TelegramBotClient botClient, Update update)
.Replace("$2", langWritable.ToString())
,
parseMode: ParseMode.Markdown,
protectContent: false,
linkPreviewOptions: false,
disableNotification: Vars.CurrentConf.DisableNotifications,
messageThreadId: update.Message.MessageId).ConfigureAwait(false);
replyParameters: update.Message.MessageId).ConfigureAwait(false);
return true;
}
}
Expand Down
4 changes: 2 additions & 2 deletions pmcenter/BotCommands/DonateCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public async Task<bool> ExecuteAsync(TelegramBotClient botClient, Update update)
update.Message.From.Id,
Vars.CurrentConf.DonateString,
parseMode: ParseMode.Markdown,
protectContent: false,
linkPreviewOptions: false,
disableNotification: Vars.CurrentConf.DisableNotifications,
messageThreadId: update.Message.MessageId).ConfigureAwait(false);
replyParameters: update.Message.MessageId).ConfigureAwait(false);
return true;
}
}
Expand Down
12 changes: 6 additions & 6 deletions pmcenter/BotCommands/EditConfCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ public async Task<bool> ExecuteAsync(TelegramBotClient botClient, Update update)
update.Message.From.Id,
Vars.CurrentLang.Message_APIKeyChanged,
parseMode: ParseMode.Markdown,
protectContent: false,
linkPreviewOptions: false,
disableNotification: Vars.CurrentConf.DisableNotifications,
messageThreadId: update.Message.MessageId).ConfigureAwait(false);
replyParameters: update.Message.MessageId).ConfigureAwait(false);
Vars.RestartRequired = true;
}
if (temp.ConfSyncInterval == 0)
Expand All @@ -53,19 +53,19 @@ public async Task<bool> ExecuteAsync(TelegramBotClient botClient, Update update)
update.Message.From.Id,
Vars.CurrentLang.Message_ConfigUpdated,
parseMode: ParseMode.Markdown,
protectContent: false,
linkPreviewOptions: false,
disableNotification: Vars.CurrentConf.DisableNotifications,
messageThreadId: update.Message.MessageId).ConfigureAwait(false);
replyParameters: update.Message.MessageId).ConfigureAwait(false);
}
catch (Exception ex)
{
_ = await botClient.SendTextMessageAsync(
update.Message.From.Id,
Vars.CurrentLang.Message_GeneralFailure.Replace("$1", ex.Message),
parseMode: ParseMode.Markdown,
protectContent: false,
linkPreviewOptions: false,
disableNotification: Vars.CurrentConf.DisableNotifications,
messageThreadId: update.Message.MessageId).ConfigureAwait(false);
replyParameters: update.Message.MessageId).ConfigureAwait(false);
}
return true;
}
Expand Down
4 changes: 2 additions & 2 deletions pmcenter/BotCommands/GetStatsCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ public async Task<bool> ExecuteAsync(TelegramBotClient botClient, Update update)
.Replace("$3", Vars.CurrentConf.Statistics.TotalForwardedFromOwner.ToString())
.Replace("$4", Vars.CurrentConf.Statistics.TotalCommandsReceived.ToString()),
parseMode: ParseMode.Markdown,
protectContent: false,
linkPreviewOptions: false,
disableNotification: Vars.CurrentConf.DisableNotifications,
messageThreadId: update.Message.MessageId).ConfigureAwait(false);
replyParameters: update.Message.MessageId).ConfigureAwait(false);
return true;
}
}
Expand Down
4 changes: 2 additions & 2 deletions pmcenter/BotCommands/HelpCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ public async Task<bool> ExecuteAsync(TelegramBotClient botClient, Update update)
Vars.CurrentConf.OwnerUID,
Vars.CurrentLang.Message_Help,
parseMode: ParseMode.Markdown,
protectContent: false,
linkPreviewOptions: false,
disableNotification: Vars.CurrentConf.DisableNotifications,
messageThreadId: update.Message.MessageId).ConfigureAwait(false);
replyParameters: update.Message.MessageId).ConfigureAwait(false);
return true;
}
}
Expand Down
4 changes: 2 additions & 2 deletions pmcenter/BotCommands/InfoCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ public async Task<bool> ExecuteAsync(TelegramBotClient botClient, Update update)
update.Message.From.Id,
sb.ToString(),
parseMode: ParseMode.Markdown,
protectContent: false,
linkPreviewOptions: false,
disableNotification: Vars.CurrentConf.DisableNotifications,
messageThreadId: update.Message.MessageId).ConfigureAwait(false);
replyParameters: update.Message.MessageId).ConfigureAwait(false);
return true;
}
}
Expand Down
4 changes: 2 additions & 2 deletions pmcenter/BotCommands/PardonCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ public async Task<bool> ExecuteAsync(TelegramBotClient botClient, Update update)
update.Message.From.Id,
Vars.CurrentLang.Message_UserPardoned,
parseMode: ParseMode.Markdown,
protectContent: false,
linkPreviewOptions: false,
disableNotification: Vars.CurrentConf.DisableNotifications,
messageThreadId: update.Message.MessageId).ConfigureAwait(false);
replyParameters: update.Message.MessageId).ConfigureAwait(false);
return true;
}
}
Expand Down
8 changes: 4 additions & 4 deletions pmcenter/BotCommands/PardonIdCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ public async Task<bool> ExecuteAsync(TelegramBotClient botClient, Update update)
update.Message.From.Id,
Vars.CurrentLang.Message_UserPardoned,
parseMode: ParseMode.Markdown,
protectContent: false,
linkPreviewOptions: false,
disableNotification: Vars.CurrentConf.DisableNotifications,
messageThreadId: update.Message.MessageId).ConfigureAwait(false);
replyParameters: update.Message.MessageId).ConfigureAwait(false);
}
catch (Exception ex)
{
_ = await botClient.SendTextMessageAsync(
update.Message.From.Id,
Vars.CurrentLang.Message_GeneralFailure.Replace("$1", ex.Message),
parseMode: ParseMode.Markdown,
protectContent: false,
linkPreviewOptions: false,
disableNotification: Vars.CurrentConf.DisableNotifications,
messageThreadId: update.Message.MessageId).ConfigureAwait(false);
replyParameters: update.Message.MessageId).ConfigureAwait(false);
}
return true;
}
Expand Down
Loading

0 comments on commit c8697da

Please sign in to comment.