Skip to content
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

The wiretapping module can't correctly determine if the "FISA Court" category exists (or doesn't correctly create it). #3

Open
royalPanic opened this issue Feb 23, 2021 · 0 comments
Assignees
Labels
bug Something isn't working main Issues for the main branch.

Comments

@royalPanic
Copy link
Owner

When attempting to wiretap a user before the FISA Court category is created, the program will return:

  File "/home/ubuntu/Wiretapping-Bot/cogs/wiretappingmodule.py", line 25, in startWiretap
    categoryid = get(guild.categories, name="FISA Court").id
AttributeError: 'NoneType' object has no attribute 'id'

This issue is caused by the fact that categoryid is assigned before the in-command check to verify if the category exists in the first place.

--| ...
25|        categoryid = get(guild.categories, name="FISA Court").id
26|        overwrites = {guild.default_role: discord.PermissionOverwrite(read_messages=False)}
27|        userid = pinguser.id
28|
29|        if category is None:
30|            category = await guild.create_category_channel("FISA Court")
31|            categoryid = get(guild.categories, name="FISA Court").id
--| ...

Line 25 needs to be moved down, which will most likely going to make line 31 redundant, so a minor refactor will be needed to both clean the code and correct this bug.

@royalPanic royalPanic added bug Something isn't working main Issues for the main branch. labels Feb 23, 2021
@royalPanic royalPanic self-assigned this Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working main Issues for the main branch.
Projects
None yet
Development

No branches or pull requests

1 participant