GithubHelp home page GithubHelp logo

slack_message_delete's Introduction

Python Slack App

This Python script connects to Slack and deletes all messages in a specified channel using the Slack API and the requests library without slack python api.

it is simple.

Prerequisites

  • Python 3.x
  • requests library

Setting Up Your Slack App

1. Create a New Slack App

Go to https://api.slack.com/apps and click on the 'Create New App' button. Fill in the 'App Name' and 'Development Slack Workspace', then click on 'Create App'.

2. Generate a Slack API Token

Once your app is created, go to the 'OAuth & Permissions' page in the app settings. Under 'Scopes', add the necessary scopes for your app. For this application, you'll need the following scopes:

  • channels:read
  • channels:history
  • chat:write

After adding the scopes, click on 'Install App to Workspace'. This will generate an OAuth Access Token. This token starts with xoxb-. Please keep this token secure and do not share it publicly.

3. Get Channel Id, My User id from Slack Application

channel id

click to Home button left column. click to user or channel in middle column click to user name or channel name on top of right side. You see bottom of opened form. Screenshot

my user id

click to Home button left column. click to your user name in middle column click to user name or channel name on top of right side. click to view full profile middle of opened form. click to member id of opened form. Screenshot

3. To run this application, first install the necessary Python dependencies:

pip3 install -r requirements.txt

4. Then, you can run the application with:

python main.py

LICENSE

MIT

slack_message_delete's People

Contributors

ureyni avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.