BaboucheOne / BaboucheOne/BuggyBot

Register bug

Open
#121 1 comment 0 reactions 0 assignees View on GitHub
bot bug
Dominant language
Python
Stars
6
Forks
1
PR merge metrics
No merged PRs in 30d

Description

When a new user enter the discord and type the command `!register 111111111`. See logs below:
```
2024-07-29 11:16:41,771 - BuggyBotLogger - INFO - {"version": 2, "method": "register", "message": "Exécution de la commande par a_mystery_user"}
2024-07-29 11:16:41,772 - BuggyBotLogger - INFO - {"version": 2, "method": "register_student", "message": "Réception de la requête RegisterStudentRequest(111111111, 223525355096933401)"}
2024-07-29 11:16:41,975 - BuggyBotLogger - INFO - {"version": 2, "method": "find_student_by_ni", "message": "L'étudiant Student(111111111, Clemou, DuPain, B-IFT, False, -1) a bien été ajouté à la cache."}
2024-07-29 11:16:42,180 - BuggyBotLogger - INFO - {"version": 2, "method": "update_student", "message": "NI(111111111) a bien été marqué comme sale."}
2024-07-29 11:16:42,385 - BuggyBotLogger - INFO - {"version": 2, "method": "register_student", "message": "L'étudiant NI(111111111) DiscordUserId(223525355096933401) a bien été enregistré."}
2024-07-29 11:16:42,578 - BuggyBotLogger - INFO - {"version": 2, "method": "find_student_by_ni", "message": "L'étudiant Student(111111111, Clemou, DuPain, B-IFT, False, 223525355096933401) a bien été ajouté à la cache."}
Task exception was never retrieved
future: exception=AttributeError("'NoneType' object has no attribute 'add_roles'")>
Traceback (most recent call last):
File "/buggybot/bot/application/discord/discord_service.py", line 122, in __add_member_roles
await member.add_roles(role)
AttributeError: 'NoneType' object has no attribute 'add_roles'
Task exception was never retrieved
future: exception=AttributeError("'NoneType' object has no attribute 'edit'")>
Traceback (most recent call last):
File "/buggybot/bot/application/discord/discord_service.py", line 102, in __set_member_nick_name
await member.edit(nick=nickname)
AttributeError: 'NoneType' object has no attribute 'edit'
2024-07-29 11:16:43,027 - BuggyBotLogger - INFO - {"version": 2, "method": "register", "message": "La commande a été exécutée avec succès."}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing `!register 111111111` and reading the traceback in `bot/application/discord/discord_service.py`, especially `__add_member_roles` at line 120 and `__set_member_nick_name` at line 100. Trace why `member` is `None` before the `add_roles` and `edit` calls. Done means registration completes without either AttributeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.