Explicit account modification #42

Merged
waifu merged 7 commits from 35_Explicit_account_modification into dev 2025-06-03 19:06:14 -07:00
Owner

Following the issue #35

Following the issue #35
waifu added the
Refactoring
label 2025-06-01 13:56:26 -07:00
waifu self-assigned this 2025-06-01 13:56:26 -07:00
waifu added 1 commit 2025-06-01 13:56:28 -07:00
waifu added 1 commit 2025-06-01 17:43:22 -07:00
waifu added 1 commit 2025-06-01 19:05:06 -07:00
Author
Owner

Added two functions:

  • delete_account
  • confirm_delete

delete_account does nothing, it just tells the player to confirm using confirm_delete. confirm_delete, actually deletes the account. We could add a confirmation logic but this should be enough to defer most people from instantly deleting their account on accident. As the confirm_delete command doesn't appear in the help, only delete_account does.

Added two functions: - `delete_account` - `confirm_delete` `delete_account` does nothing, it just tells the player to confirm using `confirm_delete`. `confirm_delete`, actually deletes the account. We could add a confirmation logic but this should be enough to defer most people from instantly deleting their account on accident. As the `confirm_delete` command doesn't appear in the help, only `delete_account` does.
waifu changed title from WIP Explicit account modification to Explicit account modification 2025-06-01 19:13:15 -07:00
waifu added 4 commits 2025-06-01 20:14:21 -07:00
waifu added 1 commit 2025-06-01 20:17:24 -07:00
waifu added 1 commit 2025-06-01 20:42:53 -07:00
Author
Owner

Should be ok for review

Should be ok for review
nai requested changes 2025-06-02 19:16:53 -07:00
nai left a comment
Collaborator

Very good how you are working hard my friend, huge respect

Very good how you are working hard my friend, huge respect
@ -56,0 +61,4 @@
user = CURSOR.fetchone()
if not user:
return False # No such user
Collaborator

I mean, you do expect this username to be deleted anyway, right. False if the user does exist and the operation failed for some reason. Though depends on the use-case

I mean, you do expect this username to be deleted anyway, right. False if the user does exist and the operation failed for some reason. Though depends on the use-case
bot/response.py Outdated
@ -150,9 +187,11 @@ def generate_response(notification: ParsedNotification) -> BotResponse | None:
# Unrestricted commands
match command:
case 'signup':
res = do_signup()
Collaborator

Oh, you already do have the mapping! now just move the functions away to their own separate places, to unload the file

Oh, you already do have the mapping! now just move the functions away to their own separate places, to unload the file
@ -8,3 +8,3 @@
def do_roll(full_user: str) -> BotResponse:
def do_roll(author: str) -> BotResponse:
Collaborator

The function seems to grow too big too huge. Instead of piling every action in one file response.py, splitting every do_* into separate files could help. The file will be very heavy on a lot of unrelated to each other changes, hence every function belongs to a separate "domain", that could be expressed by splitting

The function seems to grow too big too huge. Instead of piling every action in one file `response.py`, splitting every do_* into separate files could help. The file will be very heavy on a lot of unrelated to each other changes, hence every function belongs to a separate "domain", that could be expressed by splitting
@ -97,4 +116,4 @@
be a number between 1 and 5',
'attachment_urls': None
}
if not (is_float(arguments[2]) and 0.0 < float(arguments[2]) <= 1.0):
Collaborator

it'd be more readable if you unpacked the array into variables that have names. is_float(arguments[2])) is too low-level if you are not someone who wrote this function.
For example, is_float(rarity) seems better and less bug prone, since you can't fuck up accessing by a wrong index

it'd be more readable if you unpacked the array into variables that have names. `is_float(arguments[2]))` is too low-level if you are not someone who wrote this function. For example, `is_float(rarity)` seems better and less bug prone, since you can't fuck up accessing by a wrong index
waifu added 1 commit 2025-06-03 19:04:58 -07:00
waifu merged commit 0a2f7fe00d into dev 2025-06-03 19:06:14 -07:00
waifu deleted branch 35_Explicit_account_modification 2025-06-03 19:07:19 -07:00
Sign in to join this conversation.
No reviewers
nai
No milestone
No project
No assignees
2 participants
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: waifu/kemoverse#42
No description provided.