Skip to content
This repository was archived by the owner on Jul 11, 2023. It is now read-only.
This repository was archived by the owner on Jul 11, 2023. It is now read-only.

Ensure that transparency is enabled before searching for an audit channel #91

@joker314

Description

@joker314

This issue is migrated from discussions in Discord
/cc @glynnw


We're searching for the audit channel before checking if audit transparency is enabled. This has two flaws:

  • when the value is not provided, it errors despite never needing to perform the search
  • this is inefficient

We could take advantage of && short-circuiting, but this would require an assignment to stay efficient. Assignments inside ifs are scary for those who aren't experienced with C-based languages; as they look like equality. In addition, it's again hard to tell if it's intentional. On the other hand, this leaves the code compact.

As an alternative, we could add something like

if(!config.auditTransparency) return;

This is more explicit, but also makes the code longer.

Consensus seems to be with the latter solution.


The bot should also

  • crash
  • with a really explicit error message
    if you try to set up audit transparency with a channel doesn't exist.

It should do the former but not the latter. It should say something like 'Value must not be undefined' -- but we should state what should be set.

In addition, would it be a good idea to make it clear to users that the bot is being transparent/not. This would rely on non-technical users of the bot not knowing how to modify e.g. the 'Playing' field, and then using it to display 'transparent'/'not transparent'. I think this is a bad idea as it could create a false level of trust to this forgeable field.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions