Giter Club home page Giter Club logo

Comments (6)

sgratzl avatar sgratzl commented on September 6, 2024

is tech-setup a public channel? it if is a private one you have to use the --group instead

can you do me a favor and try the develop version of this package: https://github.com/sgratzl/slack-cleaner/tree/develop

it has a different idea and requires python coding but you will have way more control what you wanna do

pip install slack_cleaner2
from slack_cleaner2 import *
s = SlackCleaner('XXXXXXXXXXXXXXXXX', sleep_for=1)

tech_setup = [c for c in s.conversations if c.name == 'tech-setup'][0]

for msg in tech_setup.msgs():
  msg.delete()

s.log.summary()

from slack-cleaner.

sgratzl avatar sgratzl commented on September 6, 2024

@titaniumbones did you have time to try out the slack_cleaner2 version?

from slack-cleaner.

simmessa avatar simmessa commented on September 6, 2024

Hello sgratzl, I've been experimenting with the dev branch (slack_cleaner2), but I'm not sure, how could I delete all dm between two users? Any examples? I can see conversations bearing user names but I don't understand how I'd code this... Many thanks!

from slack-cleaner.

sgratzl avatar sgratzl commented on September 6, 2024

first, you can only delete the direct messages from the owner of the token but not other ones :(

from slack_cleaner2 import *
s = SlackCleaner('XXXXXXXXXXXXXXXXX', sleep_for=1)

total_delete = 0
for c in s.ims:
  for msg in c.msgs():
    if (c.user and c.user.bot) or msg.user == s.myself or msg.bot:
      if msg.delete() is None:
        total_delete += 1

should delete all direct instant messages that are accessible from the current token (s.ims), iterate over all messages of each channel (c.msgs()), and tries to delete the message if it is written by me (msg.user == s.myself) a bot message (msg.botI or by a bot user (c.user and c.user.bot)

from slack-cleaner.

titaniumbones avatar titaniumbones commented on September 6, 2024

I think this is resolved with the current version! Closing for now but @simmessa feel free to open a new issue if yours isn't resolved.

from slack-cleaner.

simmessa avatar simmessa commented on September 6, 2024

Unfurtunately I lost access to the slack environment where I ran slack-cleaner so I won't be able to test this again but hey @titaniumbones thanks for the update!

from slack-cleaner.

Related Issues (20)

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.