#(Zemen) Correct way to add role
63 messages · Page 1 of 1 (latest)
(Zemen) Correct way to add role
Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>
Or am I doing it entirely wrong?
Hi again :)
role:<[⠀⠀⠀⠀⠀⠀⠀↓ Status ↓⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀]>
is incorrect, denizen has it's own tags for almost any object. The role has their own tag that allows commands to recognize them too:
!objecttag discordroletag
!s discordroletag
[Perfect Name Match] !ObjectType discordroletag,
[Partial Name Match] !Tag discordroletag.id, !Tag discordroletag.name, !Tag discordroletag.group, !Tag discordroletag.color, !Tag discordroletag.users, !Tag discordroletag.mention, !Tag discordroletag.permissions,
[Partial Synonym Match] !Tag flaggableobject.flag, !Tag flaggableobject.has_flag, !Tag flaggableobject.flag_map, !Tag flaggableobject.list_flags, !Tag flaggableobject.flag_expiration,
[Semi-Decent Match] !Tag discord_role, !Command discordcreatechannel, !Event discord user role changes,
[Backup Match] !Tag discordgrouptag.role,
[Just Barely Matched] !Tag discordgrouptag.roles, !Tag discordusertag.roles.
!objecttype discordroletag
A DiscordRoleTag is an object that represents a role on Discord, either as a generic reference,
or as a guild-specific reference, or as a bot+guild-specific reference.
This object type is flaggable.
Flags on this object type will be stored in: plugins/dDiscordBot/flags/bot_(botname).dat, under special sub-key "__roles"
dDiscordBot
discordrole
ElementTag
FlaggableObject
The identity format for Discord roles is the bot ID (optional), followed by the guild ID (optional), followed by the role ID (required).
For example: 4321
Or: 1234,4321
Or: mybot,1234,4321
You can see the format here, it should be used inside the role tag
hello again and ughh... I'm a bit stupid, can you give an example of that?
oh sorry, forgot to turn off the pings
No problem!
Tags in Denizen is a construction that looks like that: <tag[Data]>. A bit rough example but I want to make it clear for you.
For discord role, the tag will be <discord_role[Data]>
!t discord_role
Returns a Discord Role object constructed from the input value.
Refer to !objecttype DiscordRoleTag.
dDiscordBot
DiscordRoleTag
Combine that tag + Format from here ^
it'll be something like <discord_role[bot,1234,5555]> or just a <discord_role[5555]> where 5555 is a role ID provided by discord
You can ping me if you want, I don't mind
Oh ok, thanks. I'm starting to get it, but why do I get this error?
dDiscordBot
external
discord [id:<id>] [disconnect/add_role/start_typing/remove_role/status (status:<status>) (activity:<activity>)/rename] (<value>) (message_id:<id>) (channel:<channel>) (user:<user>) (group:<group>) (role:<role>) (url:<url>)
Interacts with Discord.
Interacts with Discord.
Commands may fail if the bot does not have permission within the Discord group to perform them.
When setting the status of the Discord bot, the status argument can be: ONLINE, DND, IDLE, or INVISIBLE,
and the activity argument can be: PLAYING, STREAMING, LISTENING, or WATCHING.
Streaming activity requires a 'url:' input.
The command should always be ~waited for. See !language ~waitable.
Ah, simply add group: with a proper group tag. It should be there cause bot will never understand on which exact server he should give that role (since the same bot can be on 2+ servers)
!e discord user joins
dDiscordBot
Discord
discord user joins
for:<bot> to only process the event for a specified Discord bot.
group:<group_id> to only process the event for a specified Discord group.
when a Discord user joins a guild.
<context.bot> returns the relevant DiscordBotTag.
<context.group> returns the DiscordGroupTag.
<context.user> returns the DiscordUserTag.
oh so THAT what he wanted
Yeah. Just specify it, you can use context.group - then bot will be giving user a role on the server that they joined to
ok it works, thanks a lot. Btw do you how to make it not case sensitive?
- if <context.new_message.text.contains_text[something]>
for example it to check not only for something, but Something, SoMEthINg and etc. too
Tag parse results for <element[SOMEthing].contains_text[something]>: https://paste.denizenscript.com/View/109695
true
Are you using cyrillic letters?
Yes
Yeh that problem appears only in cyrillic. The only solution I found for my project is to convert the text to a lowercase, for example:
<context.new_message.text.to_lowercase.contains_text[something]>
SOMEthing SoMeThInG will be converted to something and only then compared to something, that should work in most of the cases
yeah, that what I was thinking about, just didn't know how to do it in Denizen, thanks again
maybe that should be reported btw, cause it works perfectly with english text and can be fixed with cyrillic...
^ that can be fixed
I will make a thread :)
also, is there a way to reply to user with ephemeral message?
The message that can only he see
Only in events with interaction like when button clicked, command used, modal submitted
!c discordinteraction
dDiscordBot
external
discordinteraction [defer/reply/delete] [interaction:<interaction>] (ephemeral) (attach_file_name:<name>) (attach_file_text:<text>) (rows:<rows>) (<message>)
Manages Discord interactions.
Manages Discord interactions.
You can defer, reply to, edit, or delete an interaction. These instructions all require the "interaction" argument.
The "ephemeral" argument can be used to have the reply message be visible to that one user.
You can defer an interaction before replying, which is useful if your reply may take more than a few seconds to be selected.
If you defer, the 'ephemeral' option can only be set by the defer - you cannot change it with the later reply.
Replying to an interact...
Oh, ok
^ ephemeral here. You can try to make a feature request thread but it all will depend on discord API. If it allows to send ephemeral messages without interactions then it can be implemented
I’m pretty sure you can reply with ephemeral set to true
Like, on message? Reply on message of a user I mean
