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.6.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: slackhistory-0.3.6.tar.gz
  • Upload date:
  • Size: 6.1 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.6.tar.gz
Algorithm Hash digest
SHA256 fedb01897fc833e39e61ad49a538db7f6af5a2a98c18204e3494cfc1ffaa0618
MD5 6e18700f7a7e7f7358c67143cb086073
BLAKE2b-256 31ddf46331eb936ddbe75df38a4e327274c3bc39bad3c3e50e84d274093825c1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for slackhistory-0.3.6-py3-none-any.whl
Algorithm Hash digest
SHA256 da7bf3a80ac0b87e2460087ea76addcbf21ab598cd2dfa2fec31128bcc04686d
MD5 765fb0b6fad9037c95d9881d649ef917
BLAKE2b-256 aaa6a303b38bec478f8ffd5518ef931c893b6a3fda4f90e41206e1a5edcc8361

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