当前位置: 首页>>代码示例>>Java>>正文


Java EmojiParser.parseToAliases方法代码示例

本文整理汇总了Java中com.vdurmont.emoji.EmojiParser.parseToAliases方法的典型用法代码示例。如果您正苦于以下问题:Java EmojiParser.parseToAliases方法的具体用法?Java EmojiParser.parseToAliases怎么用?Java EmojiParser.parseToAliases使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.vdurmont.emoji.EmojiParser的用法示例。


在下文中一共展示了EmojiParser.parseToAliases方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: newTopic

import com.vdurmont.emoji.EmojiParser; //导入方法依赖的package包/类
@Override
public void newTopic(String title, String content) {
    mView.startLoading();

    title = EmojiParser.parseToAliases(title);
    content = EmojiParser.parseToAliases(content);

    NetworkTaskScheduler.getInstance().execute(new NewTopicTask(mView.getUrl(),
            title,
            content,
            new OnResponseListener<String>() {
                @Override
                public void onSucceed(String data) {
                    mView.stopLoading();
                    mView.onNewTopicSucceed();
                }

                @Override
                public void onFailed(String msg) {
                    mView.stopLoading();
                    mView.onNewTopicFailed(msg);
                }
    }));
}
 
开发者ID:mzlogin,项目名称:guanggoo-android,代码行数:25,代码来源:NewTopicPresenter.java

示例2: comment

import com.vdurmont.emoji.EmojiParser; //导入方法依赖的package包/类
@Override
public void comment(String content) {
    mView.startLoading();
    content = EmojiParser.parseToAliases(content);
    NetworkTaskScheduler.getInstance().execute(new CommentTask(getUrl(), content, new OnResponseListener<String>() {
        @Override
        public void onSucceed(String data) {
            mView.stopLoading();
            mView.onCommentSucceed();
        }

        @Override
        public void onFailed(String msg) {
            mView.stopLoading();
            mView.onCommentFailed(msg);
        }
    }));
}
 
开发者ID:mzlogin,项目名称:guanggoo-android,代码行数:19,代码来源:TopicDetailPresenter.java

示例3: onMessage

import com.vdurmont.emoji.EmojiParser; //导入方法依赖的package包/类
@Override
public void onMessage(String message) {
    message = EmojiParser.parseToAliases(message);
    if (message.startsWith("PING")) {
        sendPong();
    }

    if (message.startsWith(":") || message.startsWith("@")) {
        try {
            MessageRunnable messageRunnable = new MessageRunnable(message);
            new Thread(messageRunnable).start();
        } catch (Exception ex) {
            twitchWSIRCParser.parseData(message);
        }
    }
}
 
开发者ID:GloriousEggroll,项目名称:quorrabot,代码行数:17,代码来源:IRC.java

示例4: setGuildReactionOnMention

import com.vdurmont.emoji.EmojiParser; //导入方法依赖的package包/类
public final Config setGuildReactionOnMention(long guild_id, String reaction_on_mention) {
    if (reaction_on_mention == null) {
        final ConfigData configData = getConfigData(guild_id, 0, KEY_GUILD_REACTION_ON_MENTION);
        if (configData != null) {
            configData.delete();
        }
        return this;
    }
    if (!reaction_on_mention.startsWith(":") && !reaction_on_mention.endsWith(":")) {
        reaction_on_mention = EmojiParser.parseToAliases(reaction_on_mention);
    }
    setValue(guild_id, 0, KEY_GUILD_REACTION_ON_MENTION, reaction_on_mention);
    return this;
}
 
开发者ID:Panzer1119,项目名称:Supreme-Bot,代码行数:15,代码来源:Config.java

示例5: setGuildReactionOnCommandNotFound

import com.vdurmont.emoji.EmojiParser; //导入方法依赖的package包/类
public final Config setGuildReactionOnCommandNotFound(long guild_id, String reaction_on_command_not_found) {
    if (reaction_on_command_not_found == null) {
        final ConfigData configData = getConfigData(guild_id, 0, KEY_GUILD_REACTION_ON_COMMAND_NOT_FOUND);
        if (configData != null) {
            configData.delete();
        }
        return this;
    }
    if (!reaction_on_command_not_found.startsWith(":") && !reaction_on_command_not_found.endsWith(":")) {
        reaction_on_command_not_found = EmojiParser.parseToAliases(reaction_on_command_not_found);
    }
    setValue(guild_id, 0, KEY_GUILD_REACTION_ON_COMMAND_NOT_FOUND, reaction_on_command_not_found);
    return this;
}
 
开发者ID:Panzer1119,项目名称:Supreme-Bot,代码行数:15,代码来源:Config.java

示例6: setUserReactionOnCommandNotFound

import com.vdurmont.emoji.EmojiParser; //导入方法依赖的package包/类
public final Config setUserReactionOnCommandNotFound(long user_id, String reaction_on_command_not_found) {
    if (reaction_on_command_not_found == null) {
        final ConfigData configData = getConfigData(0, user_id, KEY_USER_REACTION_ON_COMMAND_NOT_FOUND);
        if (configData != null) {
            configData.delete();
        }
        return this;
    }
    if (!reaction_on_command_not_found.startsWith(":") && !reaction_on_command_not_found.endsWith(":")) {
        reaction_on_command_not_found = EmojiParser.parseToAliases(reaction_on_command_not_found);
    }
    setValue(0, user_id, KEY_USER_REACTION_ON_COMMAND_NOT_FOUND, reaction_on_command_not_found);
    return this;
}
 
开发者ID:Panzer1119,项目名称:Supreme-Bot,代码行数:15,代码来源:Config.java

示例7: comment

import com.vdurmont.emoji.EmojiParser; //导入方法依赖的package包/类
/**
 * 评论操作
 */
@PostMapping(value = "comment")
@ResponseBody
public RestResponseBo comment(HttpServletRequest request, HttpServletResponse response,
                              @RequestParam Integer cid, @RequestParam Integer coid,
                              @RequestParam String author, @RequestParam String mail,
                              @RequestParam String url, @RequestParam String text, @RequestParam String _csrf_token) {

    String ref = request.getHeader("Referer");
    if (StringUtils.isBlank(ref) || StringUtils.isBlank(_csrf_token)) {
        return RestResponseBo.fail(ErrorCode.BAD_REQUEST);
    }

    String token = cache.hget(Types.CSRF_TOKEN.getType(), _csrf_token);
    if (StringUtils.isBlank(token)) {
        return RestResponseBo.fail(ErrorCode.BAD_REQUEST);
    }

    if (null == cid || StringUtils.isBlank(text)) {
        return RestResponseBo.fail("请输入完整后评论");
    }

    if (StringUtils.isNotBlank(author) && author.length() > 50) {
        return RestResponseBo.fail("姓名过长");
    }

    if (StringUtils.isNotBlank(mail) && !TaleUtils.isEmail(mail)) {
        return RestResponseBo.fail("请输入正确的邮箱格式");
    }

    if (StringUtils.isNotBlank(url) && !PatternKit.isURL(url)) {
        return RestResponseBo.fail("请输入正确的URL格式");
    }

    if (text.length() > 200) {
        return RestResponseBo.fail("请输入200个字符以内的评论");
    }

    String val = IPKit.getIpAddrByRequest(request) + ":" + cid;
    Integer count = cache.hget(Types.COMMENTS_FREQUENCY.getType(), val);
    if (null != count && count > 0) {
        return RestResponseBo.fail("您发表评论太快了,请过会再试");
    }

    author = TaleUtils.cleanXSS(author);
    text = TaleUtils.cleanXSS(text);

    author = EmojiParser.parseToAliases(author);
    text = EmojiParser.parseToAliases(text);

    CommentVo comments = new CommentVo();
    comments.setAuthor(author);
    comments.setCid(cid);
    comments.setIp(request.getRemoteAddr());
    comments.setUrl(url);
    comments.setContent(text);
    comments.setMail(mail);
    comments.setParent(coid);
    try {
        String result = commentService.insertComment(comments);
        cookie("tale_remember_author", URLEncoder.encode(author, "UTF-8"), 7 * 24 * 60 * 60, response);
        cookie("tale_remember_mail", URLEncoder.encode(mail, "UTF-8"), 7 * 24 * 60 * 60, response);
        if (StringUtils.isNotBlank(url)) {
            cookie("tale_remember_url", URLEncoder.encode(url, "UTF-8"), 7 * 24 * 60 * 60, response);
        }
        // 设置对每个文章1分钟可以评论一次
        cache.hset(Types.COMMENTS_FREQUENCY.getType(), val, 1, 60);
        if (!WebConst.SUCCESS_RESULT.equals(result)) {
            return RestResponseBo.fail(result);
        }
        return RestResponseBo.ok();
    } catch (Exception e) {
        String msg = "评论发布失败";
        LOGGER.error(msg, e);
        return RestResponseBo.fail(msg);
    }
}
 
开发者ID:ZHENFENG13,项目名称:My-Blog,代码行数:80,代码来源:IndexController.java

示例8: getRawContent

import com.vdurmont.emoji.EmojiParser; //导入方法依赖的package包/类
public String getRawContent() {
  return EmojiParser.parseToAliases(messageReceivedEvent.getMessage().getRawContent());
}
 
开发者ID:Svetroid,项目名称:Hobbes-v1,代码行数:4,代码来源:Input.java


注:本文中的com.vdurmont.emoji.EmojiParser.parseToAliases方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。