Skip to content

Commit

Permalink
config setting rename
Browse files Browse the repository at this point in the history
  • Loading branch information
Duckle29 committed Apr 21, 2019
1 parent bc2363d commit bc27d40
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sopel/modules/currency.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
# Config
class CurrencySection(StaticSection):
fixer_io_key = ValidatedAttribute('fixer_io_key', default=None)
enable_regex = ValidatedAttribute('enable_regex', parse=bool, default=False)
auto_convert = ValidatedAttribute('auto_convert', parse=bool, default=False)


def configure(config):
config.define_section('currency', CurrencySection, validate=False)
config.currency.configure_setting('fixer_io_key', 'API key for fixer IO. Leave blank to use exchangeratesapi.io:')
config.currency.configure_setting('enable_regex', 'Automatically respond to regex matches?')
config.currency.configure_setting('auto_convert', 'Automatically respond to regex matches?')


def setup(bot):
Expand Down Expand Up @@ -171,7 +171,7 @@ def exchange_cmd(bot, trigger):
@rule(EXCHANGE_REGEX)
@example('100 usd in btc cad eur')
def exchange_re(bot, trigger):
if bot.config.currency.enable_regex:
if bot.config.currency.auto_convert:
match = EXCHANGE_REGEX.match(trigger)
exchange(bot, match)

Expand Down

0 comments on commit bc27d40

Please sign in to comment.