Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add allowed_channels #217

Merged
merged 3 commits into from May 17, 2021
Merged

add allowed_channels #217

merged 3 commits into from May 17, 2021

Conversation

ghost
Copy link

@ghost ghost commented May 14, 2021

As i need this for my personal instance, i decided to try and implement a filter for channels.
The reason is that i dont want the bot to work in every channel.

I just took the allowed_users filter and adapted it to channels, i didnt test it yet.

TODO:

  • Documentation
  • Testing

Add allowed_channels feature
@ghost
Copy link
Author

ghost commented May 14, 2021

Basic testing resulted that it works. In channels, that are not listed in allowed_channels, the bot replies with:
You do not have permission to perform this action!

I may patch this for myself so it just ignores the message...

@attzonko
Copy link
Owner

This seems like a useful feature. And the code looks fine to me. I think the message about permission seems confusing. Technically it has nothing to do with permissions. I think the message should be something like "This bot is not allowed to be used in this channel".

I am not sure why the unit tests are failing. Do you think you can figure that out or do you need help?

@attzonko
Copy link
Owner

Just FYI the unit test failure does not seem to be related to your changes. I am looking into it. I think this can go in as is.

@attzonko
Copy link
Owner

FYI I pushed a fix 013b852 for the unit test. You should be able to rebase and pass the checks.

@attzonko attzonko marked this pull request as ready for review May 14, 2021 19:48
@ghost
Copy link
Author

ghost commented May 17, 2021

FYI: Im currently using my master with pip3 for bot development and it works, so im marking "Tested" as done.

@attzonko attzonko merged commit 8b1d258 into attzonko:master May 17, 2021
@attzonko
Copy link
Owner

@aconitumnapellus Thanks for your contribution to this project. Glad you are finding it useful enough to enhance it 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant