summaryrefslogtreecommitdiff
path: root/lib/rbot/plugins.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rbot/plugins.rb')
-rw-r--r--lib/rbot/plugins.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/rbot/plugins.rb b/lib/rbot/plugins.rb
index 4d51cfc5..9d5523e4 100644
--- a/lib/rbot/plugins.rb
+++ b/lib/rbot/plugins.rb
@@ -349,6 +349,20 @@ module Plugins
@bot.plugins.mark_priorities_dirty
end
end
+
+ # Directory name to be joined to the botclass to access data files. By
+ # default this is the plugin name itself, but may be overridden, for
+ # example by plugins that share their datafiles or for backwards
+ # compatibilty
+ def dirname
+ name
+ end
+
+ # Filename for a datafile built joining the botclass, plugin dirname and
+ # actual file name
+ def datafile(*fname)
+ @bot.path dirname, *fname
+ end
end
# A CoreBotModule is a BotModule that provides core functionality.