#Arc Prefix Commands

1 messages · Page 1 of 1 (latest)

forest slate
#

Hi there, I am wondering if Arc includes prefix commands or if there is something else I can use to add prefix commands to hikari.

hidden pelican
#

No

#

no command handler is maintained that supports prefix commands

#

your only option is to either
A) use an old version of lightbulb (not recommended)
or
B) Roll your own prefix command handler

forest slate
mild fable
#

Curious to know what uses you have for prefix commands that slash commands can't/don't cover?

forest slate
#

For some actions, it is handy to do the following, for example I am making a profile system where people can basically describe themselves and give themselves tags, and if a moderator needs to set someones name set it their profile, it is easier to reply to a message the user send and do ?profilename <new-name> rather than /profile setname <new-name> <member>. And that also reduces the possibility of changing the wrong users name. Or just for quick commands like cooldowns. to do ?cd 10s is easier than doing /cooldown 10s. Especially if those commands have the new time as optional as I have to select to add the time value. Whereas with a prefix command it is just, ?cd 10s or ?cd

#

Hope that helps :)

hidden pelican
#

what about user commands

#

user command + modal would do exactly as you described.

#

only downside being you'd have to show them the new way

mild fable
#

it is easier to do ?profilename <new-name> rather than /profile setname <new-name> <member>
other than one extra arg (which really is not all that extra effort), i'm not seeing how that's easier? on one hand it's an extra arg - on the other, you're literally writing far more code to correctly handle prefixes and then also have to ensure that you handle terminating args with no pre-interaction validation

#

i'd also say that making the command only work when it's being used while a specific message sent by a specific user is being replied to is... wonky

#

because you then have to handle

  • what if the user doesn't reply to a message
  • what if the user replies to the wrong message
    having that explicit <member> arg is yet more validation that the action being performed is the correct one
forest slate
#

Oooh, thats an idea, the only problem is there is lots of different commands. So Profile Name, Profile Age, Profile Location. And so I would probably need to make a Manage Profile with a select menu for the option and then submit the modal then it shows another letting you to set the option to what you choose. And as much as it is annoying to handle the prefix commands, it does give fast actions. And the command would work with ?profilename <new-name> if you replied to a message but you would still be able to do ?profilename <member> <new-name> so you can specify a member tag.

mild fable
#

of course, it's your bot, we're happy to help you make it however you want it - but we give everyone the same spiel about prefix commands here lol :P

hidden pelican
mild fable
#

as much as it is annoying to handle the prefix commands, it does give fast actions
you're really going to hate me after this with how much i'm going to critique every aspect of prefix commands but
from past experience i found it much slower to have to bring up the help menu, remember what the command is, and then do the command - than it is to have the slash command menu show up and show me every command when i do /

forest slate
#

Yeah thats why I like the hybrid approach of both, because all commands are slash commands, and also prefix commands. Which gives users the option of both, which allows advanced users to do ?profilename <new-name> with extra features or just do /profile setname <new-name>

hidden pelican
# mild fable > it is easier to do `?profilename <new-name>` rather than `/profile setname <ne...

No offence but I agree with ben? (hope its okay to shrink your name to that).
Slash commands are the wrong fit here. Its not that it doesn't work, but it is extra work, and people are lazy. if the command is as simple as replying to someone with ?nick beans and it sets there nickname, then I think thats reasonably fine, but tbh this is exactly where user commands shine, and its quite literally there purpose to do exactly things as described here

mild fable
#

a user command would be ideal, but i think it's the specific action of having to hit "Reply" on a message before doing ?nick - there have definitely been times in an active chat where a message has popped up right as i went to hit a button on a message and hit that button on the wrong message

forest slate
#

Yeah its fine to shorten my name to that(my name is Ben haha). Yeah I know, stuff like this could also be user commands, but I want to develop a bot that gives users the choice between what to do.

mild fable
#

the <member> arg on a slash command makes it explicit - "i want to target this user specifically"

#

also i'm very biased towards slash commands because i love the aspect of ephemerality - i used to hate the way prefix commands were just unnecessary clutter in a live chat

forest slate
#

A modal and Apps but that relies on Right Click -> Apps -> Manage Profile then selecting Set Name then submit then Entering a name. Which is great for someone who doesn't know the commands, but for a admin needing to quickly set an inappropriate name its quicker to do ?profilename <new>

mild fable
#

i guess it's 6 and two 3s

hidden pelican
mild fable
#

just all interaction-based commands vs prefix commands

forest slate
mild fable
#

precisely that last point

hidden pelican
#

ngl, for a reasonably simple command its not the worst thing to do it that way. I mean, prefix commands are nice to also hide specific commands from specific users which can be useful (but I do not believe your doing that here)

#

It gets significantly worse imo when commands have multiple arguments. If you have multiple arguments, or need strict validation just use slash commands.

forest slate
forest slate
mild fable
#

i'm like 90% sure if you remove permissions on a slash command in the integrations tab in server settings it removes it from view if a user can't execute it
i might be wrong though

hidden pelican
forest slate
hidden pelican
#

plus, its server controlled, which means as a developer you can't force hidden commands if needed

forest slate
#

And it only allows you to do it for the root command, so if you have /ticket open /ticket manage. I can't get /ticket manage to show just for mods and /ticket open for everyone.

forest slate
hidden pelican
#

yup

#

one command I see quite often is !sync for syncing global commands (thankfully doesn't need to exist on any command handlers in hikari because they are built by devs that have more than 2 brain cells) but thats a good example. You can't have it as a slash command, because well... it could get outdated, slash commands may have never been synced, etc, whereas a prefix command, that simply checks if the message has the prefix checks if the user is the application owner, and the word sync it syncs the slash commands. Its a pretty basic concept but its an example of a command that literally cannot be a slash command

forest slate
#

Yeah, lol thankfully, I would probably be the one to release an update to slash commands and forget to !sync hahahaha

hidden pelican
#

yep

#

thats why its a terrible design idea