[V3 Economy] Bank errors in DM while bank is per-guild #1912

Closed
opened 2018-07-01 06:17:49 +02:00 by aikaterna · 0 comments
aikaterna commented 2018-07-01 06:17:49 +02:00 (Migrated from github.com)

Command name

[p]bank balance, bank set, and bank transfer are all available in DMs and error out when the bank is per-guild.

What cog is this command from?

Economy

What were you expecting to happen?

These commands shouldn't work in DM when the bank is per-guild.

What actually happened?

[30/06/2018 19:05] ERROR events on_command_error 215: Exception in command 'bank balance'
Traceback (most recent call last):
  File "C:\Program Files\Python36\lib\site-packages\discord\ext\commands\core.py", line 62, in wrapped
    ret = yield from coro(*args, **kwargs)
  File "C:\Program Files\Python36\lib\site-packages\redbot\cogs\economy\economy.py", line 153, in balance
    bal = await bank.get_balance(user)
  File "C:\Program Files\Python36\lib\site-packages\redbot\core\bank.py", line 128, in get_balance
    acc = await get_account(member)
  File "C:\Program Files\Python36\lib\site-packages\redbot\core\bank.py", line 394, in get_account
    acc_data = (await _conf.member(member)()).copy()
  File "C:\Program Files\Python36\lib\site-packages\redbot\core\config.py", line 822, in member
    return self._get_base_group(self.MEMBER, member.guild.id, member.id)
AttributeError: 'User' object has no attribute 'guild'
[30/06/2018 19:07] ERROR events on_command_error 215: Exception in command 'bank set'
Traceback (most recent call last):
  File "C:\Program Files\Python36\lib\site-packages\discord\ext\commands\core.py", line 62, in wrapped
    ret = yield from coro(*args, **kwargs)
  File "C:\Program Files\Python36\lib\site-packages\redbot\cogs\economy\economy.py", line 187, in _set
    currency = await bank.get_currency_name(ctx.guild)
  File "C:\Program Files\Python36\lib\site-packages\redbot\core\bank.py", line 540, in get_currency_name
    raise RuntimeError("Guild must be provided.")
RuntimeError: Guild must be provided.
[30/06/2018 19:09] ERROR events on_command_error 215: Exception in command 'bank transfer'
Traceback (most recent call last):
  File "C:\Program Files\Python36\lib\site-packages\discord\ext\commands\core.py", line 62, in wrapped
    ret = yield from coro(*args, **kwargs)
  File "C:\Program Files\Python36\lib\site-packages\redbot\cogs\economy\economy.py", line 162, in transfer
    currency = await bank.get_currency_name(ctx.guild)
  File "C:\Program Files\Python36\lib\site-packages\redbot\core\bank.py", line 540, in get_currency_name
    raise RuntimeError("Guild must be provided.")
RuntimeError: Guild must be provided.

#### How can we reproduce this issue?

Use [p]bank balance, [p]bank set, and [p]bank transfer when the bank is per-guild.
#### Command name [p]bank balance, bank set, and bank transfer are all available in DMs and error out when the bank is per-guild. #### What cog is this command from? Economy #### What were you expecting to happen? These commands shouldn't work in DM when the bank is per-guild. #### What actually happened? ``` [30/06/2018 19:05] ERROR events on_command_error 215: Exception in command 'bank balance' Traceback (most recent call last): File "C:\Program Files\Python36\lib\site-packages\discord\ext\commands\core.py", line 62, in wrapped ret = yield from coro(*args, **kwargs) File "C:\Program Files\Python36\lib\site-packages\redbot\cogs\economy\economy.py", line 153, in balance bal = await bank.get_balance(user) File "C:\Program Files\Python36\lib\site-packages\redbot\core\bank.py", line 128, in get_balance acc = await get_account(member) File "C:\Program Files\Python36\lib\site-packages\redbot\core\bank.py", line 394, in get_account acc_data = (await _conf.member(member)()).copy() File "C:\Program Files\Python36\lib\site-packages\redbot\core\config.py", line 822, in member return self._get_base_group(self.MEMBER, member.guild.id, member.id) AttributeError: 'User' object has no attribute 'guild' ``` ``` [30/06/2018 19:07] ERROR events on_command_error 215: Exception in command 'bank set' Traceback (most recent call last): File "C:\Program Files\Python36\lib\site-packages\discord\ext\commands\core.py", line 62, in wrapped ret = yield from coro(*args, **kwargs) File "C:\Program Files\Python36\lib\site-packages\redbot\cogs\economy\economy.py", line 187, in _set currency = await bank.get_currency_name(ctx.guild) File "C:\Program Files\Python36\lib\site-packages\redbot\core\bank.py", line 540, in get_currency_name raise RuntimeError("Guild must be provided.") RuntimeError: Guild must be provided. ``` ``` [30/06/2018 19:09] ERROR events on_command_error 215: Exception in command 'bank transfer' Traceback (most recent call last): File "C:\Program Files\Python36\lib\site-packages\discord\ext\commands\core.py", line 62, in wrapped ret = yield from coro(*args, **kwargs) File "C:\Program Files\Python36\lib\site-packages\redbot\cogs\economy\economy.py", line 162, in transfer currency = await bank.get_currency_name(ctx.guild) File "C:\Program Files\Python36\lib\site-packages\redbot\core\bank.py", line 540, in get_currency_name raise RuntimeError("Guild must be provided.") RuntimeError: Guild must be provided. #### How can we reproduce this issue? Use [p]bank balance, [p]bank set, and [p]bank transfer when the bank is per-guild.
Sign in to join this conversation.
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Mrcoolgamer11/Red-DiscordBot#1912
No description provided.