diff options
| author | 2020-02-19 17:22:37 +0000 | |
|---|---|---|
| committer | 2020-02-19 17:22:37 +0000 | |
| commit | 70db97f64e0d6dbdd60f4d6d147d11c5b6b6a204 (patch) | |
| tree | 353f18c924b00683d7565dd6699360e4e0bc4d78 /modules/coins.py | |
| parent | show when a badge was updated, not added, by "!badge add" (diff) | |
| signature | ||
support @utils.export on functions, to export those functions
Diffstat (limited to 'modules/coins.py')
| -rw-r--r-- | modules/coins.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/modules/coins.py b/modules/coins.py index 1ea228c3..4f366500 100644 --- a/modules/coins.py +++ b/modules/coins.py @@ -39,10 +39,6 @@ class CoinParseException(Exception): pass class Module(ModuleManager.BaseModule): - def on_load(self): - self.exports.add("command-spec.coins", self._coins_spec) - self.exports.add("command-spec.coinsmany", self._coins_many_spec) - def _coin_spec_parse(self, word): try: out = decimal.Decimal(word) @@ -54,11 +50,14 @@ class Module(ModuleManager.BaseModule): else: raise utils.parse.SpecTypeError( "Please provide a positive coin amount") + + @utils.export("command-spec.coins") def _coins_spec(self, server, channel, user, args): if args: return self._coin_spec_parse(args[0]), 1 else: raise utils.parse.SpecTypeError("No coin amount provided") + @utils.export("command-spec.coinsmany") def _coins_many_spec(self, server, channel, user, args): out = [] for arg in args: |
