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

customcommands: link to ccs in cc command #1624

Merged
merged 2 commits into from
Apr 9, 2024

Conversation

SoggySaussages
Copy link
Contributor

Link to the CC's corresponding edit page on the dashboard when examining a single CC with the CustomCommands command. The link is masked by the CC ID so the user-facing response doesn't get any more bulky.

Also suppresses embeds so said links do not become embeds.

Screenshot 2024-03-23 at 23 10 25

Signed-off-by SoggySaussages [email protected]

@mrbentarikau
Copy link
Contributor

mrbentarikau commented Mar 24, 2024

if control panel is not publicly, membersOnly or rolesOnly readable, then it should not add that link there.

publicly does not really matter, because non-members can't see command's return : )

@SoggySaussages
Copy link
Contributor Author

if control panel is not publicly, membersOnly or rolesOnly readable, then it should not add that link there.

publicly does not really matter, because non-members can't see command's return : )

I thought about only returning the links if the executing user has read permission. The reason I didn't was the logs command doesn't do that by default either. It doesn't check if the executing user has log read permission before sending the link, it just shows an error message on the dash if you try to click it without the right permission.

I could see implementing said check for the executing user, but currently I am against only returning links if the guild members or roles readable. I think it should match the behaviour of "if this link isn't for you, ignore it" exhibited by the logs command.

I am interested to hear your thoughts.

@ashishjh-bst ashishjh-bst merged commit 97b021d into botlabs-gg:dev Apr 9, 2024
1 check passed
l-zeuch added a commit to l-zeuch/yagpdb that referenced this pull request May 31, 2024
Also return `*discordgo.MessageSend` after executing a command via a
fake message.

Commit 97b021d ("customcommands: link to ccs in cc command ") via
PR botlabs-gg#1624 introduced a side effect where constructs such as
`{{ exec "cc" "1" }}` no longer worked, thus resulting in breakage.

This patch does *not* fully restore the former state, however seeing as
the aforementioned commit broke things in a very subtle way it seems
acceptable to introduce a new, different behaviour.
Admittedly, with the current state of in-built commands responding with
all sorts of things that may or may not be writable to a CC variable,
this only confuses things further, but at least it is working again(TM).

At some point in the future we could consider sorting these
"inconsistencies" out and making it "just werk" with custom commands. In
light of the currently ongoing migration from GORM to sqlboiler, this
undertaking does not seem too far-fetched.

Signed-off-by: Luca Zeuch <[email protected]>
ashishjh-bst pushed a commit that referenced this pull request May 31, 2024
Also return `*discordgo.MessageSend` after executing a command via a
fake message.

Commit 97b021d ("customcommands: link to ccs in cc command ") via
PR #1624 introduced a side effect where constructs such as
`{{ exec "cc" "1" }}` no longer worked, thus resulting in breakage.

This patch does *not* fully restore the former state, however seeing as
the aforementioned commit broke things in a very subtle way it seems
acceptable to introduce a new, different behaviour.
Admittedly, with the current state of in-built commands responding with
all sorts of things that may or may not be writable to a CC variable,
this only confuses things further, but at least it is working again(TM).

At some point in the future we could consider sorting these
"inconsistencies" out and making it "just werk" with custom commands. In
light of the currently ongoing migration from GORM to sqlboiler, this
undertaking does not seem too far-fetched.

Signed-off-by: Luca Zeuch <[email protected]>
@SoggySaussages SoggySaussages deleted the cc-cmd-links branch June 26, 2024 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants