From 42e45240341fe5902659ab82a2f0aca9b3568c3f Mon Sep 17 00:00:00 2001 From: snipe_blaze <72265661+notsniped@users.noreply.github.com> Date: Sat, 23 Jul 2022 19:11:02 +0530 Subject: [PATCH] Replace import with direct class It was observed in https://github.com/PyBotDevs/isobot-lazer/pull/103 that importing the currency module from the framework would cause an import error due to the colours library. So I replaced the import with a direct class which actually lets the framework run properly. --- isobot/currency.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/isobot/currency.py b/isobot/currency.py index aae3c79..c01905d 100644 --- a/isobot/currency.py +++ b/isobot/currency.py @@ -1,6 +1,12 @@ import json import discord -from colors import Colors + +class Colors(): + """Contains general stdout colors.""" + cyan = '\033[96m' + red = '\033[91m' + green = '\033[92m' + end = '\033[0m' class CurrencyAPI(Colors): """The isobot API used for managing currency. @@ -42,4 +48,4 @@ def withdraw(self, user:discord.User, amount:int): currency["wallet"][str(user.id)] += amount currency["bank"][str(user.id)] -= amount save() - print(f"[Framework/CurrencyAPI] Moved {amount} coins to wallet. User: {user} [{user.id}]") \ No newline at end of file + print(f"[Framework/CurrencyAPI] Moved {amount} coins to wallet. User: {user} [{user.id}]")