diff options
-rw-r--r-- | data/rbot/plugins/alias.rb | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/data/rbot/plugins/alias.rb b/data/rbot/plugins/alias.rb index 581cde1f..1496755d 100644 --- a/data/rbot/plugins/alias.rb +++ b/data/rbot/plugins/alias.rb @@ -44,15 +44,16 @@ class AliasPlugin < Plugin @data_file = "#{@data_path}/aliases.yaml" # hash of alias => command entries data = nil - @aliases = if File.exist?(@data_file) && - (data = YAML.load_file(@data_file)) && - data.respond_to?(:each_pair) - data - else - warning _("Data file is not found or corrupt, reinitializing data") - Hash.new + aliases = if File.exist?(@data_file) && + (data = YAML.load_file(@data_file)) && + data.respond_to?(:each_pair) + data + else + warning _("Data file is not found or corrupt, reinitializing data") + Hash.new end - @aliases.each_pair do |a, c| + @aliases = Hash.new + aliases.each_pair do |a, c| begin add_alias(a, c) rescue AliasDefinitionError |