|
@@ -1,5 +1,6 @@
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
+using System.Configuration;
|
|
|
using System.Linq;
|
|
|
using System.Text;
|
|
|
using System.Threading.Tasks;
|
|
@@ -15,6 +16,7 @@ namespace EthermineBotTelegram
|
|
|
class Program
|
|
|
{
|
|
|
static ITelegramBotClient botClient;
|
|
|
+
|
|
|
static void Main(string[] args)
|
|
|
{
|
|
|
botClient = new TelegramBotClient("1785154817:AAGhXD9yQVn9HPdWTcmGJUBeZ8nA50SzHbY");
|
|
@@ -22,6 +24,10 @@ namespace EthermineBotTelegram
|
|
|
Console.WriteLine(
|
|
|
$"Hello, World! I am user {me.Id} and my name is {me.FirstName}."
|
|
|
);
|
|
|
+
|
|
|
+ //here will be enstablishing connection to DB
|
|
|
+
|
|
|
+ //ask for username and password for db
|
|
|
|
|
|
botClient.OnMessage += BotOnMessage;
|
|
|
botClient.StartReceiving();
|
|
@@ -78,8 +84,8 @@ namespace EthermineBotTelegram
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- var url = "https://api.ethermine.org/miner/" + e.Message.Text.Substring(8) + "/currentStats";
|
|
|
- var currnentStats = _download_serialized_json_data<jsonCurrnentStats>(url);
|
|
|
+ var url = AppSettings.poolApiUrl + "/miner/" + e.Message.Text.Substring(8) + "/currentStats";
|
|
|
+ var currnentStats = _download_serialized_json_data<JsonCurrnentStats>(url);
|
|
|
await botClient.SendTextMessageAsync(
|
|
|
chatId: e.Message.Chat,
|
|
|
text: "Updated: " + DateTimeOffset.FromUnixTimeSeconds(currnentStats.data.time).LocalDateTime.ToString("f") + "\n"
|