src/main/java/io/github/biezhi/wechat/api/WeChatApiImpl.java
@Override
    public boolean sendText(String toUserName, String msg) {
        DateUtils.sendSleep();
        String url   = String.format("%s/webwxsendmsg?pass_ticket=%s", bot.session().getUrl(), bot.session().getPassTicket());
        String msgId = System.currentTimeMillis() / 1000 + StringUtils.random(6);

        JsonResponse response = this.client.send(new JsonRequest(url).post().jsonBody()
                .add("BaseRequest", bot.session().getBaseRequest())
                .add("Msg", new SendMessage(1, msg, bot.session().getUserName(), toUserName, msgId, msgId))
        );
        return null != response && response.success();
    }
@Override
    public boolean sendText(String toUserName, String msg) {
        DateUtils.sendSleep();
        String url   = String.format("%s/webwxsendmsg?pass_ticket=%s", bot.session().getUrl(), bot.session().getPassTicket());
        String msgId = System.currentTimeMillis() / 1000 + StringUtils.random(6);

        JsonResponse response = this.client.send(new JsonRequest(url).post().jsonBody()
                .add("BaseRequest", bot.session().getBaseRequest())
                .add("Msg", new SendMessage(1, msg, bot.session().getUserName(), toUserName, msgId, msgId))
        );
        return null != response && response.success();
    }
发送文本消息

@param msg        文本消息
@param toUserName 发送给谁