sharkbound / PythonTwitchBotFramework

asynchronous twitchbot framework made in pure python
MIT License
100 stars 26 forks source link

add random quote command #32

Open sharkbound opened 3 years ago

sharkbound commented 3 years ago

few issues i ran into when trying this: 1) the sql random functions change per database 2) the universal solutions involves loading ALL quotes into a list, then choosing one, this has the potential to use quite a bit of memory with a larger quote DB

to get around this, i can pick a random int (based on max id quote), then see if it exists, then choose it, but it has potential to failed A LOT if the ID's are wide in range, (aka 1, 100, 101) exists, so it can draw 2-99 quite a few times before it draws 1,100, or 101.

will continue to investigate