PrivateParlorXT::SQLiteRobot9000
Inherits PrivateParlorXT::Robot9000 < Reference < Object
An implementation of Robot9000 using the Database to store unique text and media IDs
Constructors
new(connection : DB::Database, valid_codepoints : Array(Range(Int32, Int32)) = [(0..127)], check_text : Bool | Nil = nil, check_media : Bool | Nil = nil, check_forwards : Bool | Nil = nil, warn_user : Bool | Nil = nil, cooldown : Int32 = 0)
Generally this should use the same connection that was used for the database
Instance methods
ensure_schema
Ensures that both the text table and file_id table are created in the Database, according to the values of check_text and check_media
unoriginal_media?(id : String) : Bool | Nil
Returns true if the given file id has been sent before
Returns false otherwise
unoriginal_text?(text : String) : Bool | Nil
Returns true if the given text has been sent before
Returns false otherwise