Skip to content

Commit

Permalink
Merge pull request #33 from U2FsdGVkX1/pmcenter-lazer
Browse files Browse the repository at this point in the history
fix variable naming
  • Loading branch information
Elepover authored May 11, 2020
2 parents 0c6885e + 3e08758 commit dd05fa4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 28 deletions.
11 changes: 6 additions & 5 deletions pmcenter/BotCommands/DetectPermissionCommand.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.IO;
using System;
using System.IO;
using System.Threading.Tasks;
using Telegram.Bot;
using Telegram.Bot.Types;
Expand All @@ -15,13 +16,13 @@ internal class DetectPermissionCommand : IBotCommand

public async Task<bool> ExecuteAsync(TelegramBotClient botClient, Update update)
{
var confWritable = FlipBool((new FileInfo(Vars.ConfFile)).IsReadOnly);
var langWritable = FlipBool((new FileInfo(Vars.LangFile)).IsReadOnly);
var confWritable = !(new FileInfo(Vars.ConfFile)).IsReadOnly;
var langWritable = !(new FileInfo(Vars.LangFile)).IsReadOnly;
_ = await botClient.SendTextMessageAsync(
update.Message.From.Id,
Vars.CurrentLang.Message_ConfAccess
.Replace("$1", BoolStr(confWritable))
.Replace("$2", BoolStr(langWritable))
.Replace("$1", confWritable.ToString())
.Replace("$2", langWritable.ToString())
,
ParseMode.Markdown,
false,
Expand Down
6 changes: 3 additions & 3 deletions pmcenter/BotProcess/BotProcess.OwnerCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ private static async Task OwnerCommand(Update update)
// Process locale.
if (Vars.CurrentConf.EnableRepliedConfirmation)
{
var ReplyToMessage = Vars.CurrentLang.Message_ReplySuccessful;
ReplyToMessage = ReplyToMessage.Replace("$1", $"[{Vars.CurrentConf.ContChatTarget}](tg://user?id={Vars.CurrentConf.ContChatTarget})");
_ = await Vars.Bot.SendTextMessageAsync(update.Message.From.Id, ReplyToMessage, ParseMode.Markdown, false, false, update.Message.MessageId).ConfigureAwait(false);
var replyToMessage = Vars.CurrentLang.Message_ReplySuccessful;
replyToMessage = replyToMessage.Replace("$1", $"[{Vars.CurrentConf.ContChatTarget}](tg://user?id={Vars.CurrentConf.ContChatTarget})");
_ = await Vars.Bot.SendTextMessageAsync(update.Message.From.Id, replyToMessage, ParseMode.Markdown, false, false, update.Message.MessageId).ConfigureAwait(false);
}
Log($"Successfully passed owner's reply to UID: {Vars.CurrentConf.ContChatTarget}", "BOT");
return;
Expand Down
10 changes: 0 additions & 10 deletions pmcenter/Methods/Methods.BoolStr.cs

This file was deleted.

10 changes: 0 additions & 10 deletions pmcenter/Methods/Methods.FlipBool.cs

This file was deleted.

0 comments on commit dd05fa4

Please sign in to comment.