///-------------------------------------------------------------------------------------------------------- /// 기동 시 자동 스테이킹 시작 private async static Task StartupAutoStaking() { if (Config.StartupAutoStaking) { Logger.Log("StartupAutoStaking"); await UserList.ForeachSendMsg(strings.Format("자동 채굴 시작이 설정되어 있습니다. 채굴을 시작합니다.")); Command.ICommand command = Command.CommandFactory.CreateCommand(Command.eCommand.StartStaking); if (command != null) { await command.Process(-1, "", DateTimeHandler.GetTimeZoneNow()); } } }
///-------------------------------------------------------------------------------------------------------- /// 등록된 유저들에게 시작 알람을 보냅니다. private static async Task BroadcastStartupNotify() { async Task unban(long userId) { try { await TelegramBot.Bot.UnbanChatMemberAsync(userId, Convert.ToInt32(userId)); } catch (Exception) { } } await UserList.ForeachAsync(unban); await UserList.ForeachSendMsg("//////////////////////////////////////////////////////"); await UserList.ForeachSendMsg(strings.Format("퀀텀 지갑이 구동되었습니다. {0}", DateTimeHandler.GetTimeZoneNow())); await UserList.ForeachSendMsg(Command.CommandFactory.GetCommandHelpString()); }
private static async Task BroadcastTxNotify(DateTime startTime, List <QtumTxInfo> txList) { if (txList == null) { return; } if (startTime == DateTime.MinValue) { return; } await UserList.ForeachSendMsg("---------------------------------"); await UserList.ForeachSendMsg("A new transaction has occurred!\n"); for (int i = txList.Count - 1; i >= 0; --i) { QtumTxInfo txInfo = txList[i]; DateTime txTime = QtumHandler.BlockTimeToUtcTime(txInfo.time); if (txTime < startTime) { break; } string notifyStr = txInfo.GetString(); Logger.Log(notifyStr); Logger.Log(""); await UserList.ForeachSendMsg(notifyStr); } await UserList.ForeachSendMsg("---------------------------------"); }