Comments (4)
I created a branch Christmas-miracle (probably should change the name) for the new implementation of this
from nano-chan.
First implementation idea:
Iterate through all the react-assign messages, grab all the users that reacted to the message and remove the user's perms from the target_channel of the message. When .untimeout
is ran, go through the channels again and restore perms to the target_channels that the user reacted to.
Benefits:
No need to store any DB values
No need for user to re-react to any channels to gain access again.
Simple to code and maintain
Issues:
For some reason message. for user in message.reactions
(seen here)[https://github.com/dashwav/nano-chan/blob/christmas-miracle/cogs/moderation.py#L122 ]isn't a reliable function. When I run this command with my alt as the user it only finds the user in 1 out of 12 channels the user has reacted in.
If I am just doing something dumb this is still the route I would like to take, but I am doubtful
from nano-chan.
Second Implementation idea:
Iterate through all the target_channels and view the users individual permissions using permissions_for
Found here. If the user has access to the channel, deny the permission.
Benefits:
Might actually work
Much quicker, less logic
Issues:
This would be very frustrating for a single day timeout, because all of the reacts would still be there, meaning the user would have to go through and double react on each channel they want back into.
from nano-chan.
Last Implementation idea:
Same as the second implementation, except a list of all the channels the user has been removed from is kept and stored in the database, and when .untimeout
is called, the list is restored, and the user given access back to the channels they were removed from.
Benefits:
End user functionality same as first implementation
More consistency, less user frustration than second implementation
Issues:
Much more complex than the other two ideas
Have to create and manage db table.
from nano-chan.
Related Issues (16)
- Change clover logs to embeds HOT 1
- Not storing stats on emoji usage. HOT 1
- Unit Testing HOT 1
- rebuild reports
- Ban Users botwide HOT 1
- Month End (in janitor.py) HOT 2
- Create a save image reaction HOT 1
- Add reporter ID to message in report body
- Get docker to work
- Remove all of the instances of print HOT 3
- Rename all instances of Postgres controller HOT 1
- Set up Github actions
- Seems to be an issue with the react-channel spam logging HOT 1
- feature/speedups
- Add dedicated and limited to roles to remove HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nano-chan.