private void tell(String channel, String toNick) { List<TellItem> items = JWorm.getWith( TellItem.class, "where `to`='" + toNick + "' and `channel`='" + channel + "'"); for (TellItem item : items) { StringBuilder message = new StringBuilder(); message .append(item.getTo()) .append(": ") .append(item.getFrom()) .append(" told me to tell you this: ") .append(item.getMessage()); bot.msg(channel, message.toString()); item.delete(); } }
private void saveTell(String channel, String fromNick, String toNick, String msg) { TellItem newItem = new TellItem(fromNick, toNick, msg, new Date().getTime(), channel); newItem.insert(); bot.msg(channel, "I'll tell " + toNick + " this: " + msg); }