Skip to content

add allowed_channels - #217

Merged
attzonko merged 3 commits into
masterfrom
unknown repository
May 17, 2021
Merged

add allowed_channels#217
attzonko merged 3 commits into
masterfrom
unknown repository

Conversation

@ghost

@ghost ghost commented May 14, 2021

Copy link
Copy Markdown

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

ghost commented May 14, 2021

Copy link
Copy Markdown
Author

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

ghost commented May 17, 2021

Copy link
Copy Markdown
Author

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
Copy Markdown
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