Skip to main content

A slack helper library to get history (messages and replies) of a channel

Project description

Slack History

A Slack helper library to get the history (messages and replies) of a channel

Installation

pip install slackhistory

Quick start

import asyncio
from slackhistory import SlackHelper
from slackhistory.type.slack_types import SlackMessageAndReply
from os import environ


async def main():
    slack_helper = SlackHelper(token=environ.get("TOKEN", ""))

    # end_date is optional
    message_and_replies: SlackMessageAndReply = await slack_helper.get_message_and_replies(
        "alex-playground", start_date="2023-10-28 08:00:00", end_date="2023-11-4 22:00:00")

    # the result can be converted to dict or json
    print(message_and_replies.to_dict())
    print(message_and_replies.to_json())


if __name__ == "__main__":
    asyncio.run(main())

Example Result: example_result.json

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

slackhistory-0.3.4.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

slackhistory-0.3.4-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file slackhistory-0.3.4.tar.gz.

File metadata

  • Download URL: slackhistory-0.3.4.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for slackhistory-0.3.4.tar.gz
Algorithm Hash digest
SHA256 3b80bb2ce8750bcbdf504e08d1849c14bb6c3820331651b25c2e3a827b04e877
MD5 dc181311b0593f9b97da15721a35d91f
BLAKE2b-256 6dbb1bf21d2066cbc3278ff75c48bb6f647663c6b7701aaf3dc98c64bf416db9

See more details on using hashes here.

File details

Details for the file slackhistory-0.3.4-py3-none-any.whl.

File metadata

File hashes

Hashes for slackhistory-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 19843be816dea88846efe232709da7d2eed1f0520905f07fa435a138060686ca
MD5 d3673fa26bf0bfd4213d74f2aff93075
BLAKE2b-256 a899114df3cc82231ea4de1d5e71259133617b10ab18b788f538f5b6f213d9d1

See more details on using hashes here.

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