Git Product home page Git Product logo

Comments (13)

docmarionum1 avatar docmarionum1 commented on July 21, 2024

Odd. Is Slack API Tester the name of your archive bot?
Did you somehow add the bot user to a DM with another user? I didn't think that was possible.

The only path into handle_query which returns that error is if the message is in a DM channel. It only checks if it's a DM, not who the DM is between. But, as far as I understood, a bot wouldn't be listening to messages in a DM between two other users.

I have a fix that I think would ensure it only responds in DMs to itself, but I don't know how I would test it because I don't know how to get it into another DM, if that is indeed the problem.

from slack-archive-bot.

stalltron avatar stalltron commented on July 21, 2024

Thought I answered this earlier. Slack API Tester is a Slack tool that I believe is enabled automatically so that apps can call the Slack API. Name of my archive bot is timescale_ab.

Did not add the bot to private DMs.

from slack-archive-bot.

docmarionum1 avatar docmarionum1 commented on July 21, 2024

I don't have Slack API Tester and couldn't find any documentation about it. Do you have any docs that I can see about setting it up?

As I said, I think I have the fix but I can't recreate your issue to test it.

from slack-archive-bot.

rjbergerud avatar rjbergerud commented on July 21, 2024

I found the issue had to do at least partly with messages being responded too only if the user name wasn't bot, however the user name for my bot seemed to be Slack API Tester, so the bot would start trying to respond to the same messages it just put out and loop.

from slack-archive-bot.

docmarionum1 avatar docmarionum1 commented on July 21, 2024

Oh, how did you create the slack integration? Is it a bot or an app?

@stalltron @rjbergerud

from slack-archive-bot.

rjbergerud avatar rjbergerud commented on July 21, 2024

@docmarionum1 I was setting up the bot following this guide
"Setting up your bot users"
https://api.slack.com/bot-users
So its set up as a bot within an app.

But then, I used the Slack PI Legacy token
https://api.slack.com/custom-integrations/legacy-tokens

from slack-archive-bot.

docmarionum1 avatar docmarionum1 commented on July 21, 2024

I'm still baffled by how you two got that. I created a bot using an app as you did. But it still shouldn't be active in DMs between two human users. Is there a way to invite a bot to a DM?

from slack-archive-bot.

stalltron avatar stalltron commented on July 21, 2024

@docmarionum1 no, I don't think so. It seems the bot is triggering the API Tester somehow...

from slack-archive-bot.

maxkan avatar maxkan commented on July 21, 2024

the issue is still there and it makes the bot unusable. each time you search for something it first gives you search results and then goes to endless "not found" loop. Bot name is "history", The search response goes under app name: "History", capital 'H'.
Also here is what I see in the log:
image

from slack-archive-bot.

alehkot avatar alehkot commented on July 21, 2024

Bot is trying to reply to its own messages. I suggest trying to resolve the issue by changing this line
to
if event['type'] == 'message' and ('subtype' not in event or event['subtype'] != 'bot_message'):
It works on my local :)

from slack-archive-bot.

docmarionum1 avatar docmarionum1 commented on July 21, 2024

@maxkan A recent change, #14 allows you to specify the username of the bot, which, I think, will fix that issue. Have you tried this?

If not, try running with the flag -b History.

I've never actually been able to replicate this issue after setting up the app in a couple of different methods, so I can't verify that it in fact works, but it looks like it should.

from slack-archive-bot.

alehkot avatar alehkot commented on July 21, 2024

@docmarionum1 Thanks, your solution works on my env as well. I think it's a little bit confusing that App name should be used as is instead of using its machine name, i.e. if an app name is "Acme Test Bot", the machine name is "acme_test_bot", but parameter -b should be used with "Acme Test Bot".

from slack-archive-bot.

docmarionum1 avatar docmarionum1 commented on July 21, 2024

Seems to be fixed.

from slack-archive-bot.

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.