Recommend quotes


#1

Hey there :slight_smile:

I’ve set up my bot so that viewers can use !quote to display a random quote, pretty standart.

Now I’ve been wondering if it would be possible to set up a command with which users could suggest a quote,
kinda like !suggest “Quote” which saves the Quote into a txt or something mods or the broadcaster could access to later add the quote to the quote module…

Is that possible somehow? Thanks in advance!


#2

Sure it’s possible but you’d have to create a custom script for it.

All you’d have to do is have the script append the text after the command to the file on a new line, very simple.


#3

I set the permissions on addquote so anyone can add, then I (or a mod) can delete the quote and change the name that the quote is attributed to. This of course assumes that you trust people in chat, and I get why you are looking for the ‘suggested’ system :slight_smile:

Anyway, you can create a custom command in chat that does what you want, I think, if I understand your request:

addcom suggest Writing quote to file for review (writefile suggest.txt, true, (echo))
[01-03-2018 @ 14:03:37.347 MST] [MUTED] @IllusionaryBot, Command !suggest has been created!
suggest This quote.
[01-03-2018 @ 14:03:41.254 MST] [MUTED] Writing quote to file for review 
suggest That quote.
[01-03-2018 @ 14:03:43.144 MST] [MUTED] Writing quote to file for review 
[morpheus] /opt/iobot/addons
illusion% cat suggest.txt 
This quote.
That quote.

The command says “write to the suggest.txt file in the addons folder (directory) and keep appending (true) data from the parameters in chat (echo).”

I would make a copy of the file and wipe out the file, just in case the bot is writing to it while you are working in it. I assume you would want to remove older quotes once you have approved and added manually back into the bot via !addquote.

SIDE NOTE: If you want to log who put in the quote:
addcom suggest Writing quote to file for review (writefile suggest.txt, true, (sender): (echo))

Example lines in file:

IllusionaryBot: this quote is neat
IllusionaryBot: that quote is neat

(Note that I am running from the Console, so the (sender) is the bot account.)


#4

This actually has inspired an idea in me that I am going to throw on our Trello board.

!quote autoapprove [true|false]
!quote autoapprovegroup [group ID]
!quote approve [ID]
!quote deny [ID]

The idea would be, you could disable an auto-approval mechanism and have quotes not approved (if they are at or below the autoapprovegroup you set). Then, they would not show up in the random list nor could be queried directly (!quote number) until approved/denied (by a mod or above, depending what permission you give to !quote approve/deny).

This wouldn’t be implemented anytime in the near future, so, I would use the custom command for now.