作者:拍友2502883387 | 来源:互联网 | 2023-05-19 18:36
classDatabaseincludeCinch::PluginDBSQLite3::Database.new(development.sqlite3)match
class Database
include Cinch::Plugin
DB = SQLite3::Database.new('development.sqlite3')
match /(select .* from gears where .* like .*)/i
def execute(m)
@db = SQLite3::Database.new('development.sqlite3')
#m.reply @db.execute("select * from gears where lab like 'Primary'")
end
end
This part of an IRC bot. I am trying to have the matched regex that the user inputs directly inputed to the @db.execute to be able perform the query. Any help or suggestions for a different way to go would be appreciated.
这部分是IRC机器人。我正在尝试将用户输入的匹配正则表达式直接输入@ db.execute以执行查询。任何有关不同方式的帮助或建议将不胜感激。
1 个解决方案