Skip to content
This repository has been archived by the owner on Dec 24, 2021. It is now read-only.

Added dmOnly option for commands #312

Closed
wants to merge 3 commits into from
Closed

Added dmOnly option for commands #312

wants to merge 3 commits into from

Conversation

mah51
Copy link

@mah51 mah51 commented Jun 6, 2020

not a clue what im doing but saw this in #295 so tried to implement it...

src/commands/base.js Outdated Show resolved Hide resolved
Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
@lmf-git
Copy link

lmf-git commented Jan 22, 2021

not a clue what im doing but saw this in #295 so tried to implement it...

Kinda looks like you do know what you're doing, nice work and attention to detail.

@arifali123
Copy link

Does anyone know when this will merge, it would be super useful in my current project. Thanks

@Gawdl3y
Copy link
Member

Gawdl3y commented Mar 28, 2021

I had plans for generalising the functionality for guildOnly into a feature called "filters" that allow for a cleaner, more extensible method of specifying multiple conditions to check before a command is run (other than permissions). filters: ['guild-only', 'nsfw'] as an example. In addition to being more flexible and allowing the registration of custom ones, this would avoid the spam of simple boolean properties for things like this.

That being said, I don't see the purpose of a DM only filter like this. What's the use-case?

@arifali123
Copy link

That filter option is fine with me but there are some commands which should just be done in dms. The feature has already been written and can be removed once your filters come out. Thanks.

@Gawdl3y
Copy link
Member

Gawdl3y commented Mar 31, 2021

Okay, but if there are commands that should only be used in DMs, wouldn't you want to delete the message triggering it if it isn't in a DM, when possible (assuming it may have sensitive info)? In order for that to happen, you still need the command being processed.

@Elara-Discord-Bots
Copy link

Well the way I see it, since adding the filters field would be a big breaking change and DM-only commands would be a useful feature for bots to have at the moment it would be good to merge this and get the feature out there and have the breaking change (i.e: guildOnly, nsfw, dmOnly fields be replaced in the next major version with filters: ["guild", "dm", "nsfw"] as a good replacement)

The only issue I can see in this code is a validation issue in the base.js file, there should be a check if both guildOnly and dmOnly is set to true then throw an error saying you can't have both set to true (as that would just disable it)

@arifali123
Copy link

Yeah I agree wtih @Elara-Discord-Bots I think we should just merge it cause its a good solution until filters come out and can be removed l ater.

@GoldenAngel2
Copy link

Any news on this @Gawdl3y or @dragonfire535 ?

@mah51
Copy link
Author

mah51 commented Nov 13, 2021

Closing due to inactivity and discontinuation of Commando

@mah51 mah51 closed this Nov 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants