Skip to main content

Detect temporal expressions in Slack messages (_tomorrow at 5 pm_) and translate them for readers in other timezones.

Project description

Slack Time Localization Bot

Detect temporal expressions in Slack messages (tomorrow at 5 pm) and translate them for readers in other timezones.

Quickstart

Create a Slack app with the following manifest:

display_information:
  name: Time Localization
  description: Detect temporal expressions in Slack messages ("tomorrow at 5 pm") and translate them for readers in other timezones.
  background_color: "#240b24"
features:
  app_home:
    home_tab_enabled: false
    messages_tab_enabled: true
    messages_tab_read_only_enabled: false
  bot_user:
    display_name: Time Localization
    always_online: true
oauth_config:
  scopes:
    bot:
      - app_mentions:read
      - channels:history
      - chat:write
      - groups:history
      - groups:write
      - im:history
      - im:write
      - mpim:history
      - mpim:write
      - users:read
      - channels:read
      - groups:read
      - mpim:read
      - im:read
settings:
  event_subscriptions:
    bot_events:
      - app_home_opened
      - app_mention
      - channel_history_changed
      - group_history_changed
      - im_history_changed
      - message.channels
      - message.groups
      - message.im
      - message.mpim
  interactivity:
    is_enabled: true
  org_deploy_enabled: false
  socket_mode_enabled: true
  token_rotation_enabled: false

Create and get the bot token (under "OAuth & Permissions") and app token (under "Basic Information") for your Slack app.

pip install slack-time-localization-bot

ℹ️ Currently only Linx x86_64 is supported

Finally you can run it with

export SLACK_BOT_TOKEN=xoxb-...
export SLACK_APP_TOKEN=xapp-...
slack-time-localization-bot

You can now invite the bot to a conversation is slack and the bot will translate temporal expressions for every message.

Running Tests

Install poetry and run

poetry install
poetry run pytest ./slack_time_localization_bot

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

slack_time_localization_bot-0.1.0.dev0.tar.gz (5.3 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page