-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Development refactor/listeners #48
Conversation
cogs/listeners/member_events_cog.py
Outdated
|
||
@commands.Cog.listener("on_member_join") | ||
async def on_member_join(self, member: discord.Member): | ||
SupabaseInterface().updateContributor(member) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interfaces are generally meant to be extended and not make instances of. Maybe you can refactor to making a helper class and define static methods on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refactored into helpers/supabaseClient
interfaces/supabase.py
Outdated
@@ -29,19 +31,33 @@ def update(self, update, query_key, query_value): | |||
def insert(self, data): | |||
data = self.client.table(self.table).insert(data).execute() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible case of self.table
being equal to ''
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in supabase refactor, class no longer specifies table on initialisation
helpers.py
Outdated
@@ -0,0 +1,18 @@ | |||
import discord |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import not getting used ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
made import more specific
A bunch of observations:
These linters can be added in as a Here is a PR you can refer to for pre-commit setup - Flagsmith/flagsmith-python-client#70 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interfaces are generally meant to be extended and not make instances of. Maybe you can refactor to making a helper class and define static methods on it.
Tasks:
|
Hey @tushar5526 made some changes
Could you take another look? |
Looks fine to me, a bit more nitpicking but I see Also marking the |
Appreciate the nitpicking! |
No description provided.