コード例 #1
0
 public BotReply(IUser user, BotReplyType botReplyType,
                 Dictionary <string, Dictionary <string, string> > symbolParameters)
 {
     User             = user;
     ReplyType        = botReplyType;
     SymbolParameters = symbolParameters;
 }
コード例 #2
0
        public string RenderReply(BotReplyType botReplyType)
        {
            var text = "SUPERMAN!";

            switch (botReplyType)
            {
            case BotReplyType.Help:
                text = "You can control the bot by sending these commands:\n\n" +
                       "/signin - sign in\n" +
                       "/addsymbol - add new symbol(s) to your library\n" +
                       "/removesymbol - remove symbol(s) from the library\n" +
                       "/getprices - get your symbols` current prices";
                break;

            case BotReplyType.RequestForChoseParser:
                text = "Enter parser";
                break;

            case BotReplyType.RequestForEnterParserPublicTokenIEXCloud:
                text = "Sign in <a href=\"https://iexcloud.io/cloud-login?r=https%3A%2F%2Fiexcloud.io%2Fconsole%2F#/register\">link</a> and enter your public token";
                break;

            case BotReplyType.RequestForEnterParserPublicTokenFinhub:
                text = "Sign in <a href=\"https://finnhub.io/register\">link</a> and enter your public token";
                break;

            case BotReplyType.RequestForEnterSymbol:
                text = "Enter symbol";
                break;

            case BotReplyType.SingleSymbolInfo:
                break;

            case BotReplyType.MultipleSymbolInfo:
                break;

            case BotReplyType.UnknownParser:
                text = "You enter unknown parser";
                break;

            case BotReplyType.SuccessfullyRemoveSymbol:
                text = "You successfully removed symbol";
                break;

            case BotReplyType.SuccessfullyAddSymbol:
                text = "You successfully added symbol";
                break;

            case BotReplyType.SuccessfullyEnterToken:
                text = "You successfully entered token";
                break;

            case BotReplyType.UnknownCommand:
                break;

            case BotReplyType.ImpossibleAction:
                text = "Incorrect command";
                break;

            case BotReplyType.UserAlreadyRegister:
                text = "You have already signed in";
                break;

            case BotReplyType.UserNotRegistered:
                text = "Before using <b>StocksWallet</b> sign in using /signin";
                break;

            case BotReplyType.EmptySymbolSubscriptions:
                text = "You don`t have any symbols in the library. Use /addsymbol";
                break;

            case BotReplyType.NoSuchSymbolSubscription:
                text = "You don`t have this symbol in the library";
                break;

            default:
                throw new NotImplementedException();
            }
            return(text);
        }