Tabnine Logo
Chat
Code IndexAdd Tabnine to your IDE (free)

How to use
Chat
in
it.rebase.rebot.api.object

Best Java code snippets using it.rebase.rebot.api.object.Chat (Showing top 6 results out of 315)

origin: it.rebase/rebot-jboss-books-service

/**
 * Send notification messages to the Telegram group that this service is active.
 *
 * @param msg
 */
private void notify(String msg) {
  Chat chat = new Chat();
  chat.setId(Long.parseLong(chatId));
  message.setChat(chat);
  message.setText(msg);
  messageSender.processOutgoingMessage(message);
}
origin: it.rebase/rebot-telegram-api-objects

  @Override
  public String toString() {
    return "EditedMessage{" +
        "messageId=" + messageId +
        ", from=" + from.toString() +
        ", chat=" + chat.toString() +
        ", date=" + date +
        ", editDate=" + editDate +
        ", text='" + text + '\'' +
        ", entities=" + entities.toString() +
        ", additionalProperties=" + additionalProperties +
        '}';
  }
}
origin: it.rebase/rebot-packt-free-learning-plugin

public String registerNotification(MessageUpdate message) {
  String channel = null;
  if (message.getMessage().getChat().getType().equals("group") || message.getMessage().getChat().getType().equals("supergroup")) {
    channel = message.getMessage().getChat().getTitle();
  } else {
    channel = message.getMessage().getFrom().getFirstName();
  }
  return repository.register(new PacktNotification(message.getMessage().getChat().getId(), channel));
}
origin: it.rebase/rebot-welcome-message-plugin

  /**
   * When a member join, left or gets excluded from an Telegram group a msg will be sent to the target group.
   * If the member added or removed is a bot, no message is sent.
   * @param update {@link MessageUpdate}
   * @return true if the message is to inform a new member or if a member left the chat
   */
  private String chatMember(MessageUpdate update) {
    ObjectMapper mapper = new ObjectMapper();
    final Message message = new Message();
    for (Map.Entry<String, Object> entry : update.getMessage().getAdditionalProperties().entrySet()) {
      log.fine("Additional Properties: KEY + " + entry.getKey() + " - VALUE " + entry.getValue().toString());
      if (entry.getKey().equals("new_chat_member") && !update.getMessage().getFrom().isIsBot()) {
        NewChatMember member = mapper.convertValue(entry.getValue(), NewChatMember.class);
        message.setText(String.format(WELCOME_MESSAGE, member.getFirst_name(), update.getMessage().getChat().getTitle()));

      } else if (entry.getKey().equals("left_chat_participant") && !update.getMessage().getFrom().isIsBot()) {
        LeftChatMember member = mapper.convertValue(entry.getValue(), LeftChatMember.class);
        message.setText(String.format(GOODBYE_MESSAGE, member.getFirst_name()));
      }
    }
    return message.getText();
  }
}
origin: it.rebase/rebot-packt-free-learning-plugin

public String unregisterNotification(MessageUpdate message) {
  String channel = null;
  if (message.getMessage().getChat().getType().equals("group") || message.getMessage().getChat().getType().equals("supergroup")) {
    channel = message.getMessage().getChat().getTitle();
  } else {
    channel = message.getMessage().getFrom().getFirstName();
  }
  return repository.unregister(new PacktNotification(message.getMessage().getChat().getId(), channel));
}
origin: it.rebase/rebot-packt-free-learning-plugin

private void notify(BigInteger chatId) {
  Chat chat = new Chat();
  chat.setId(chatId.longValue());
  Message message = new Message();
  message.setChat(chat);
  message.setText(this.get());
  messageSender.processOutgoingMessage(message);
}
it.rebase.rebot.api.objectChat

Most used methods

  • <init>
  • getTitle
  • setId
  • getId
  • getType
  • toString

Popular in Java

  • Reactive rest calls using spring rest template
  • runOnUiThread (Activity)
  • getSystemService (Context)
  • setScale (BigDecimal)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now