summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorMatthias Hecker <mail@apoc.cc>2020-04-24 22:44:42 +0200
committerMatthias Hecker <mail@apoc.cc>2020-04-24 22:44:42 +0200
commitc1e2f3a2f2ada21d19b893795bd4d7d58962f8b6 (patch)
tree115f9beb0837f5db0eca1e5df68de1cc5abb6f7e /data
parent8218e3f05e8ccd95497dd3c7aa115cfde8b01a40 (diff)
plugin(keywords): remove export to file, see #42
Diffstat (limited to 'data')
-rw-r--r--data/rbot/plugins/keywords.rb32
1 files changed, 0 insertions, 32 deletions
diff --git a/data/rbot/plugins/keywords.rb b/data/rbot/plugins/keywords.rb
index da320780..ecb6cca8 100644
--- a/data/rbot/plugins/keywords.rb
+++ b/data/rbot/plugins/keywords.rb
@@ -325,8 +325,6 @@ class Keywords < Plugin
case plugin
when /keyword/
case topic
- when 'export'
- 'keyword export => exports definitions to keyword_factoids.rbot'
when 'stats'
'keyword stats => show statistics about static facts'
when 'wipe'
@@ -474,41 +472,11 @@ class Keywords < Plugin
m.reply "done"
end
- # export keywords to factoids file
- def keyword_factoids_export
- ar = Array.new
-
- debug @keywords.keys
-
- @keywords.each { |k, val|
- next unless val
- kw = Keyword.restore(val)
- ar |= kw.to_factoids(k)
- }
-
- # TODO check factoids config
- # also TODO: runtime export
- dir = @bot.path 'factoids'
- fname = File.join(dir,"keyword_factoids.rbot")
-
- Dir.mkdir(dir) unless FileTest.directory?(dir)
- Utils.safe_save(fname) do |file|
- file.puts ar
- end
- end
-
# privmsg handler
def privmsg(m)
case m.plugin
when "keyword"
case m.params
- when /^export$/
- begin
- keyword_factoids_export
- m.okay
- rescue
- m.reply _("failed to export keywords as factoids (%{err})" % {:err => $!})
- end
when /^set\s+(.+?)\s+(is|are)\s+(.+)$/
keyword_command(m, $1, $2, $3) if @bot.auth.allow?('keycmd', m.source, m.replyto)
when /^forget\s+(.+)$/