andrewthetechie / err-topic-a-day

An errbot plugin to post a topic a day to a channel for discussion
GNU General Public License v3.0
3 stars 4 forks source link

Add admin approval system for adding topics #3

Open andrewthetechie opened 4 years ago

andrewthetechie commented 4 years ago

It would be great if anyone can add a topic, but only admins can approve them to be posted

ghost commented 4 years ago

You can create two tables in any database of your choice(working with python, sqlite is your best friend in this situation). One of the tables will store a person's topic they want to be added and the other will store the finalized topics, errbot can prompt the admins and by displaying the topic to approve it and if it is approved it gets added to the finalized topics table and if not it gets remove from the first table. Also one thing to look for is duplicates, you can set up a system where by when a topic is first requested to be added through errbot, it checks if has a duplicate waiting to approved in the first table or already has been added to the finalized table. If it is already in the finalized table, it tells the person that the topic has already been added and if its in the first table waiting to approved, it will accept the persons topic but will not add it to the first table but instead you can add a topic request counter that increases more a topic to be added is requested, this way the admins can tell which topics people want to be added more than the others. If you need help with this, I can help as I have already has experience working with bots, mostly chat bots but the same systems I used there can be implemented into errbot as well.

andrewthetechie commented 4 years ago

@Marcus-Mangru I'm open to any implementation as long as it sticks to a few things:

  1. Awareness that this is an errbot plugin and first using errbot provided functions for things like storage, api access, pollers, etc before creating new code
  2. Awareness that this plugin may be run in many different environments. It could be run inside of a docker container with no persistent storage where the user wants to configure any backend to use an external service. I.e. if you use a database, be sure it can be configured to use an external database server or the user can configure the path for the sqlite db.