Red-discordbot: V3 Economy cog bugs

Created on 6 Mar 2018  路  5Comments  路  Source: Cog-Creators/Red-DiscordBot

Type:

  • [ ] Suggestion
  • [x] Bug

We noticed there were a lot of problems and bugs with the new economy cog. It would be great if we can list all of them there (just comment) so we can fix all of that.

For myself, I found the following problems

  • credits name is not used in the commands (there may be a problem with saving)
  • no warning when switching bank between global and per-guild (that wipe all banks) thx @aikaterna for finding it
  • error when using [p]bank reset
Exception in command 'bank reset'
Traceback (most recent call last):
  File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/core.py", line 62, in wrapped
    ret = yield from coro(*args, **kwargs)
  File "/home/palm/redv3/lib/python3.5/site-packages/redbot/cogs/economy/economy.py", line 227, in reset
    success = await bank.wipe_bank()
  File "/home/palm/redv3/lib/python3.5/site-packages/redbot/core/bank.py", line 285, in wipe_bank
    await _conf.clear_all_users()
  File "/home/palm/redv3/lib/python3.5/site-packages/redbot/core/config.py", line 1058, in clear_all_users
    await self._clear_scope(self.USER)
  File "/home/palm/redv3/lib/python3.5/site-packages/redbot/core/config.py", line 1011, in _clear_scope
    await group.clear()
  File "/home/palm/redv3/lib/python3.5/site-packages/redbot/core/config.py", line 153, in clear
    await self.driver.clear(*self.identifiers)
  File "/home/palm/redv3/lib/python3.5/site-packages/redbot/core/drivers/red_json.py", line 70, in clear
    del partial[identifiers[-1]]
KeyError: 'USER'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/bot.py", line 886, in invoke
    yield from ctx.command.invoke(ctx)
  File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/core.py", line 904, in invoke
    yield from ctx.invoked_subcommand.invoke(ctx)
  File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/core.py", line 498, in invoke
    yield from injected(*ctx.args, **ctx.kwargs)
  File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/core.py", line 71, in wrapped
    raise CommandInvokeError(e) from e
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: KeyError: 'USER'
  • error when using [p]bankset toggleglobal
Exception in command 'bankset toggleglobal'
Traceback (most recent call last):
  File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/core.py", line 62, in wrapped
    ret = yield from coro(*args, **kwargs)
  File "/home/palm/redv3/lib/python3.5/site-packages/redbot/cogs/bank/bank.py", line 66, in bankset_toggleglobal
    await bank.set_global(not cur_setting)
  File "/home/palm/redv3/lib/python3.5/site-packages/redbot/core/bank.py", line 422, in set_global
    await _conf.clear_all_users()
  File "/home/palm/redv3/lib/python3.5/site-packages/redbot/core/config.py", line 1058, in clear_all_users
    await self._clear_scope(self.USER)
  File "/home/palm/redv3/lib/python3.5/site-packages/redbot/core/config.py", line 1011, in _clear_scope
    await group.clear()
  File "/home/palm/redv3/lib/python3.5/site-packages/redbot/core/config.py", line 153, in clear
    await self.driver.clear(*self.identifiers)
  File "/home/palm/redv3/lib/python3.5/site-packages/redbot/core/drivers/red_json.py", line 70, in clear
    del partial[identifiers[-1]]
KeyError: 'USER'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/bot.py", line 886, in invoke
    yield from ctx.command.invoke(ctx)
  File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/core.py", line 904, in invoke
    yield from ctx.invoked_subcommand.invoke(ctx)
  File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/core.py", line 498, in invoke
    yield from injected(*ctx.args, **ctx.kwargs)
  File "/home/palm/redv3/lib/python3.5/site-packages/discord/ext/commands/core.py", line 71, in wrapped
    raise CommandInvokeError(e) from e
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: KeyError: 'USER'

thx @palmtree5 for finding the 2 last errors

If you have other errors or problem you found, please leave a comment

Bug

Most helpful comment

The reset and toggle global bugs should have both been fixed with #1374

All 5 comments

The reset and toggle global bugs should have both been fixed with #1374

What do you mean by "credits name is not used in the commands"?

All other bugs have been fixed.

I noticed that it was actually due to the recent switch (I set the bank global just after changing the name, so it was removed without warning (which is also fixed in aikaterna's PR))

So are all the issues here fixed?

All the known issues are fixed yeah.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Vexed01 picture Vexed01  路  3Comments

IdkGoodName picture IdkGoodName  路  3Comments

StaffTroll picture StaffTroll  路  5Comments

SieBrum picture SieBrum  路  3Comments

Fozar picture Fozar  路  4Comments