Skip to content

getNotificationSettings

Sahri Riza Umami edited this page Jun 25, 2018 · 4 revisions

Returns the notification settings for a given scope.

getNotificationSettings(scope, chat_id, callback, data)
Field Type Description
scope string Scope for which to return the notification settings information: Chat, PrivateChats, BasicGroupChats or AllChats.
chat_id int53 Chat identifier. Only for Chat scope.

NotificationSettingsScope

Describes kinds of chat for which notification settings are applied

notificationSettingsScope Description
Chat Notification settings applied to a particular chat.
PrivateChats Notification settings applied to all private chats.
BasicGroupChats Notification settings applied to all basic groups and channels. (Supergroups have no common settings).
AllChats Notification settings applied to all chats.

Example

  • Get Chat notification settings for chat 1234567890.

    getNotificationSettings('Chat', 1234567890)

    Response:

    {
      ["@type"] = "notificationSettings",
      mute_for = 617543182,
      show_preview = true,
      sound = "default"
    }
  • Get notification settings for basic group chats.

    getNotificationSettings('BasicGroupChats')

    Response:

    {
      ["@type"] = "notificationSettings",
      mute_for = 0,
      show_preview = true,
      sound = "default"
    }

Frequently Asked Questions
The Functions

Clone this wiki locally