예제 #1
0
  @Override
  public void onMessage(IUser user, VKUser vkUser, Message message, String arg) {
    try {

      if (user.getPerm() >= 50)
        MessageBuffer.addMessage(
            Command.download.addMedia(
                new VkFile(ToText.getAsFile(MainParser.getBook(arg)), vkUser).getAsVkMedia()),
            user);
      else MessageBuffer.addMessage(Error.permErr, user);
    } catch (FileNotFoundException e) {
      MessageBuffer.addMessage(Error.error404, user);
    }
  }