#"Working with the Interaction Framework" vs "Slash Command Basics"

1 messages · Page 1 of 1 (latest)

devout oar
#

hello, i was reading the guide and i noticed these two are very similar. do they do entirely different things? if not, which one should i follow? thanks

undone cipher
#

interaction framework

unborn hinge
#

Interaction Framework is the more everyone friendly approach, and is similar to the old Text/Chat Commands.

They both work with application interactions.

Slash Command Basics is if you want to manually manage everything yourself.

devout oar
#

ok thanks

devout oar
#

it's working i'm so happy!

#

but i don't have the config singletons, is that okay?

#

also, the parameter name is "filter" but i want it to be "sort-by". how do i specify the name with interaction framework?

devout oar
#

thanks!

undone cipher
#

[Summary("name", "desc")] Type param

devout oar
#

how do i leave the description empty?

#

it keeps using my parameter name in code

undone cipher
#

[Summary("name")]

devout oar
#

it keeps saying "filter"

undone cipher
devout oar
#

yea

#

i always register it in guild

undone cipher
#

ehmm

devout oar
#

public async Task Browse([Summary("sort-by")] CustomMapBrowseFilter filter)

#

if i put Summary("sort-by", "b") then the description will show in discord

#

but if empty, it will keep using "filter" because it's my param name

undone cipher
#

huh

#

what if you reload your client?

#

might be a UI bug

devout oar
#

now this is "b"

undone cipher
#

make sure the attribute is from Discord.Interactions namespace

devout oar
#

now this is empty second argument

undone cipher
#

huh

#

well
that's odd

#

it should've just worked™

devout oar
#
Discord.Net.HttpException: The server responded with error 50035: Invalid Form Body
Inner Errors:
BASE_TYPE_BAD_LENGTH: Must be between 1 and 100 in length.

this is what happens if i do Summary("sort-by", " ")

#

maybe it needs something

undone cipher
#

cuz it's an empty string

devout oar
#

oh it auto trims

#

it keeps showing filter, and i don't want to use zws

undone cipher
#

oh

#

wait

devout oar
#

can't even use zws

undone cipher
#

ik what's happening

#

so

devout oar
#

i think description is a must to have

undone cipher
#

no

#

add a handler to InteractionService.Log event

devout oar
#

ok wait

undone cipher
#

but that actual issue is - you can't have - in parameter names iirc

#

I might be wrong here
but try without one

devout oar
#

[Summary("sortby")]

#

i don't see anything in interactionservice.log

undone cipher
#

hmm
nvm then

devout oar
#

i think descriptions must always be there

#

if null, follow filter name

undone cipher
devout oar
#

no, this is parameter name

undone cipher
#

yeah... I'm just dumb sometimes

devout oar
#

description cannot be empty

#

that's so stupid

undone cipher
#

yeah
dnet set's it to param name if you don't specify one

devout oar
#

why isn't it nullable? literally just don't show any text in the ui

undone cipher
#

discord moment

devout oar
#

discord moment

#

anyway, thanks for the help. i'll go think of a good description for an extremely self explanatory parameter

undone cipher
#

.

devout oar
#

genius

unborn hinge
#

Try a zero width space lmao:

devout oar
#
Discord.Net.HttpException: The server responded with error 50035: Invalid Form Body
Inner Errors:
BASE_TYPE_BAD_LENGTH: Must be between 1 and 100 in length.
#

no luck

#

i think discord trims it

unborn hinge
#

Try the one in the code block, idk if it’s different

devout oar
#

yea i tried the one in the codeblock

unborn hinge
#

Probably c# trim being good dead

devout oar
#

i'm gonna go with a dot or maybe this emoji

#

📊

unborn hinge
#

Maybe try rtl then ltr marker lmao

devout oar
#

ok sec

unborn hinge
devout oar
#

no way, same error

#

yea i tried like 9 of them and all same error

undone cipher
#

It's just discord being gud

#

at least it's good in something lel

unborn hinge
#

i didn't want to give discord a W considering it takes common Ls dead