Giter Site home page Giter Site logo

Timeout Improvements about nano-chan HOT 4 CLOSED

dashwav avatar dashwav commented on June 23, 2024
Timeout Improvements

from nano-chan.

Comments (4)

dashwav avatar dashwav commented on June 23, 2024

I created a branch Christmas-miracle (probably should change the name) for the new implementation of this

from nano-chan.

dashwav avatar dashwav commented on June 23, 2024

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.

dashwav avatar dashwav commented on June 23, 2024

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.

dashwav avatar dashwav commented on June 23, 2024

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)

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.