class

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

Source

Instance methods

add_file_id(id : String) : Nil

Stores the file id to be referenced later

Source
add_line(text : String) : Nil

Stores the stripped line of text to be referenced later

Source
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

Source
unoriginal_media?(id : String) : Bool | Nil

Returns true if the given file id has been sent before Returns false otherwise

Source
unoriginal_text?(text : String) : Bool | Nil

Returns true if the given text has been sent before Returns false otherwise

Source