Skip to content

[Casino] mebership_updater error #258

@ColorOfSilence

Description

@ColorOfSilence

I noticed an issue when trying to get the auto-membership assignment working. We first noticed that the membership wasn't doing what it was supposed to do every 5 minutes. We had edited/added VIP and set the requirement to be 1,000,000 credits (just for testing and messing around).

I looked at the wiki and noticed it said that both economy/bank and casino had to be in the same mode so we switched them both to Global. After doing that and resetting some of the balances the auto-updated still wasn't working.

I checked the logs and saw this (user altered):

[2022-04-26 17:53:41] [ERROR] red.jumper-plugins.casino: Casino error in membership_updater:
Traceback (most recent call last):
  File "/foo/bar/Red-DiscordBot/data/neko/cogs/CogManager/cogs/casino/casino.py", line 809, in membership_updater
    await self.global_updater()
  File "/foo/bar/Red-DiscordBot/data/neko/cogs/CogManager/cogs/casino/casino.py", line 833, in global_updater
    await self.process_user(memberships, user_obj, _global=True)
  File "/foo/bar/Red-DiscordBot/data/neko/cogs/CogManager/cogs/casino/casino.py", line 875, in process_user
    if requirements["Credits"] and bal < requirements["Credits"]:
UnboundLocalError: local variable 'bal' referenced before assignment

This is on a basically stock Casino cog, only a few cooldown and payout changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions