public async Task SupplyAsync([Remainder] string Remainder = "")
        {
            // Get supply
            decimal Supply = TrtlBotSharp.GetSupply();

            // Send reply
            await ReplyAsync(string.Format("The current circulating supply is **{0:n8}** {1}", Supply, TrtlBotSharp.coinSymbol));
        }
        public async Task DynamitAsync([Remainder] string Remainder = "")
        {
            // Get supply
            decimal Supply     = TrtlBotSharp.GetSupply();
            decimal Height     = TrtlBotSharp.GetHeight();
            decimal Hashrate   = TrtlBotSharp.GetHashrate();
            decimal Difficulty = TrtlBotSharp.GetDifficulty();

            string Message = string.Format("The current block height is **{0:N0}**" +
                                           "\nThe current global hashrate is **" + TrtlBotSharp.FormatHashrate(Hashrate) + "**" +
                                           "\nThe current difficulty is **{1:N0}**" +
                                           "\nThe current circulating supply is **{2:N4}** {3}", Height, Difficulty, Supply, TrtlBotSharp.coinSymbol);

            await ReplyAsync(string.Format(Message));
        }
Exemple #3
0
        public async Task MarketCapAsync([Remainder] string Remainder = "")
        {
            // Get current coin price
            JObject CoinPrice = Request.GET(TrtlBotSharp.marketEndpoint);

            if (CoinPrice.Count < 1)
            {
                await ReplyAsync("Failed to connect to " + TrtlBotSharp.marketSource);

                return;
            }

            // Get current BTC price
            JObject BTCPrice = Request.GET(TrtlBotSharp.marketBTCEndpoint);

            if (BTCPrice.Count < 1)
            {
                await ReplyAsync("Failed to connect to " + TrtlBotSharp.marketBTCEndpoint);

                return;
            }

            // Begin building a response
            string Response = string.Format("{0}'s market cap is **{1:c}** USD", TrtlBotSharp.coinName,
                                            (decimal)CoinPrice["price"] * (decimal)BTCPrice["last"] * TrtlBotSharp.GetSupply());

            // Send reply
            if (Context.Guild != null && TrtlBotSharp.marketDisallowedServers.Contains(Context.Guild.Id))
            {
                try { await Context.Message.DeleteAsync(); }
                catch { }
                await Context.Message.Author.SendMessageAsync(Response);
            }
            else
            {
                await ReplyAsync(Response);
            }
        }
Exemple #4
0
        public async Task MarketCapAsync([Remainder] string Remainder = "")
        {
            // Begin building a response
            await TrtlBotSharp.GetMarketCache();

            decimal CoinPrice = (decimal)Convert.ToDecimal(TrtlBotSharp.marketCacheArray[3]);

            // Begin building a response
            string Response = string.Format("{0}'s market cap is **{1:c}** USD", TrtlBotSharp.coinName,
                                            ((decimal)CoinPrice * (decimal)decimal.Parse(TrtlBotSharp.marketCacheArray[11])) * TrtlBotSharp.GetSupply());

            // Send reply
            if (Context.Guild != null && TrtlBotSharp.marketDisallowedServers.Contains(Context.Guild.Id))
            {
                try { await Context.Message.DeleteAsync(); }
                catch { }
                await Context.Message.Author.SendMessageAsync(Response);
            }
            else
            {
                await ReplyAsync(Response);
            }
        }