package org.jebot.handler.impl;

import com.pengrad.telegrambot.model.request.ParseMode;
import com.pengrad.telegrambot.request.SendMessage;
import org.jebot.handler.AbstractHandler;
import org.jebot.handler.dto.BotMessage;

import static org.jebot.constant.Constant.*;


public class HelpHandler extends AbstractHandler {
    @Override
    public boolean msgHandler(BotMessage botMessage) {
        if (!botMessage.messageTextIsEmpty() && botMessage.getMessageText().contains("/help")) {
            String helpMessage = String.format("%s: 查询支付宝价格\n" +
                            "%s: 查询微信价格\n" +
                            "%s: 查询银行价格\n" +
                            "10(+-*/)10: 加减乘除\n" +
                            "%s: 群组商户信息\n" +
                            "%s: 群组商户余额\n" +
                            "%s: 群组通道信息\n" +
                            "%s: 通道查询成功率\n" +
                            "%s: 商户查询成功率\n" +
                            "---下方命令需管理权限--\n" +
                            "%s: 添加管理(%s用户名)\n" +
                            "%s: 删除管理(%s用户名)\n" +
                            "%s: 关闭商户\n" +
                            "%s: 开启商户\n" +
                            "%s: 所有商户出账单\n" +
                            "%s商户号: “指定商户出账单”(%s2000000)\n" +
                            "%s: 代收预警阀值设置(%s10)\n" +
                            "%s: 代付预警阀值设置(%s10)\n" +
                            "%s商户号: \"绑定商户\"(%s2000000)\n" +
                            "%s: 解绑商户\n" +
                            "%s: 绑定商户固定支付地址\n" +
                            "%s: 查询商户固定地址\n" +
                            "%s通道编码: \"绑定通道\",多个用英文逗号隔开(%s1,2,3)\n" +
                            "%s通道编号: \"解绑通道\",多个用英文逗号隔开(%s1,2,3)\n" +
                            "%s通道编码: \"关闭通道\",多个用英文逗号隔开(%s1,2,3)\n" +
                            "%s通道编号: \"开启通道\",多个用英文逗号隔开(%s1,2,3)\n" +
                            "%s: \"代收记账\"(%s500或%s-500)\n" +
                            "%s: \"代付记账\"(%s500或%s-500)\n"+
                            "%s: 代收记账24小时历史\n"+
                            "%s: 代付记账24小时历史\n"+
                            "%s: 绑定码商\n"+
                            "%s: 解绑码商\n"+
                            "%s: 所有通道账单\n",
                    QUERY_USDT_TO_ALIPAY_CNY,
                    QUERY_USDT_TO_WECAHT_CNY,
                    QUERY_USDT_TO_BANK_CNY,
                    MCH_INFO,
                    QUERY_MCH_BALANCE,
                    QUERY_CHANNEL_INFO,
                    QUERY_CHANNEL_TODAY_SUCCESS_RATE,
                    QUERY_MCH_TODAY_SUCCESS_RATE,
                    ADD_ADMIN,
                    ADD_ADMIN,
                    DEL_ADMIN,
                    DEL_ADMIN,
                    DISABLE_MCH,
                    ENABLE_MCH,
                    SETTLE_MCH,
                    SETTLE_MCH,
                    SETTLE_MCH,
                    UPDATE_MCH_PAYMENT_WARN_THRESHOLD_FLAG,
                    UPDATE_MCH_PAYMENT_WARN_THRESHOLD_FLAG,
                    UPDATE_MCH_AGENT_WARN_THRESHOLD_FLAG,
                    UPDATE_MCH_AGENT_WARN_THRESHOLD_FLAG,
                    BIND_MCH_FLAG,
                    BIND_MCH_FLAG,
                    UNBIND_MCH_FLAG,
                    BIND_MCH_USTDURL,
                    MCH_URL_INFO,
                    BIND_CHANNEL_FLAG,
                    BIND_CHANNEL_FLAG,
                    UNBIND_CHANNEL_FLAG,
                    UNBIND_CHANNEL_FLAG,
                    DISABLE_CHANNEL_FLAG,
                    DISABLE_CHANNEL_FLAG,
                    ENABLE_CHANNEL_FLAG,
                    ENABLE_CHANNEL_FLAG,
                    PAYMENT_ACCOUNT_FLAG,
                    PAYMENT_ACCOUNT_FLAG,
                    PAYMENT_ACCOUNT_FLAG,
                    AGENT_ACCOUNT_FLAG,
                    AGENT_ACCOUNT_FLAG,
                    AGENT_ACCOUNT_FLAG,
                    PAYMENT_ACCOUNT_HISTORY_FLAG,
                    AGENT_ACCOUNT_HISTORY_FLAG,
                    BIND_CODEPRO_FLAG,   // 新增绑定码商
                    UNBIND_CODEPRO_FLAG,
                    SETTLE_PASSAGE);     // 新增所有通道账单
            SendMessage sendMessage = new SendMessage(botMessage.getMessage().chat().id(), helpMessage);
            botMessage.getTelegramBot().execute(sendMessage);
            return true;
        }
        return false;
    }
}
