Class LanguageSelectionController

java.lang.Object
com.fussuchalice.bot.controllers.LanguageSelectionController

public class LanguageSelectionController extends Object
The LanguageSelectionController class is responsible for managing language selection and messages in a Telegram bot.
  • Constructor Details

    • LanguageSelectionController

      public LanguageSelectionController()
  • Method Details

    • sendLanguageSelectionMessage

      public static void sendLanguageSelectionMessage(DropboxUnofficialBot bot, long chatId, Properties languagePack)
      Sends a language selection message with inline keyboard buttons for language options.
      Parameters:
      bot - The Telegram bot instance.
      chatId - The chat identifier where the message will be sent.
      languagePack - The language pack containing text messages.
    • sendLanguageChangedMessage

      public static void sendLanguageChangedMessage(DropboxUnofficialBot bot, long chatId, String messageText)
      Sends a message to the user to indicate a change in language or provide language-specific content.
      Parameters:
      bot - The Telegram bot instance.
      chatId - The chat identifier where the message will be sent.
      messageText - The text message to be sent.
    • getLanguageFileByCode

      public static Properties getLanguageFileByCode(String code)
      Retrieves a language-specific properties file based on the specified language code.
      Parameters:
      code - The language code to determine the language-specific properties file.
      Returns:
      The loaded language-specific properties.
    • handleCallbackData

      public static Properties handleCallbackData(String data, long chatId)
      Handles callback data and returns the language-specific properties based on the selected language.
      Parameters:
      data - The callback data representing the selected language.
      chatId - The chat identifier associated with the user.
      Returns:
      The language-specific properties for the selected language.