#(Zemen) Correct way to add role

63 messages · Page 1 of 1 (latest)

signal vigil
#

So, I want to add role with

        on discord user joins:
        - ~discord id:myid add_role user:<context.user> role:<[⠀⠀⠀⠀⠀⠀⠀↓ Status ↓⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀]>

Is there a better way to do this?

hexed skiffBOT
#

(Zemen) Correct way to add role

hexed skiffBOT
#

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>

signal vigil
#

Or am I doing it entirely wrong?

serene copper
#

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

crude pollenBOT
# serene copper !s discordroletag
Search Results

[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.

serene copper
#

!objecttype discordroletag

crude pollenBOT
# serene copper !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"

Required Plugins or Platforms

dDiscordBot

Prefix

discordrole

Base Type

ElementTag

Implements

FlaggableObject

Format

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

serene copper
#

You can see the format here, it should be used inside the role tag

signal vigil
#

oh sorry, forgot to turn off the pings

serene copper
#

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

crude pollenBOT
serene copper
#

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

serene copper
signal vigil
serene copper
#

!с discord

#

uh

#

and why it didn't worked calihair

#

!c discord

crude pollenBOT
# serene copper !c discord
Required Plugins or Platforms

dDiscordBot

Group

external

Syntax

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>)

Short Description

Interacts with Discord.

Description

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.

serene copper
#

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

crude pollenBOT
# serene copper !e discord user joins
Required Plugins or Platforms

dDiscordBot

Group

Discord

Event Lines

discord user joins

Switches

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.

Triggers

when a Discord user joins a guild.

Context

<context.bot> returns the relevant DiscordBotTag.
<context.group> returns the DiscordGroupTag.
<context.user> returns the DiscordUserTag.

serene copper
#

Yeah. Just specify it, you can use context.group - then bot will be giving user a role on the server that they joined to

signal vigil
uncut bladeBOT
serene copper
#

Are you using cyrillic letters?

signal vigil
serene copper
#

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

signal vigil
#

yeah, that what I was thinking about, just didn't know how to do it in Denizen, thanks again

serene copper
#

maybe that should be reported btw, cause it works perfectly with english text and can be fixed with cyrillic...

agile hawk
#

^ that can be fixed

serene copper
#

I will make a thread :)

rose wigeonBOT
signal vigil
#

The message that can only he see

serene copper
#

Only in events with interaction like when button clicked, command used, modal submitted

#

!c discordinteraction

crude pollenBOT
# serene copper !c discordinteraction
Required Plugins or Platforms

dDiscordBot

Group

external

Syntax

discordinteraction [defer/reply/delete] [interaction:<interaction>] (ephemeral) (attach_file_name:<name>) (attach_file_text:<text>) (rows:<rows>) (<message>)

Short Description

Manages Discord interactions.

Description

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...

serene copper
#

^ 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

signal vigil
#

I will probably make a thread about that

#

later

floral belfry
#

I’m pretty sure you can reply with ephemeral set to true

signal vigil
floral belfry
#

Ohhh

#

I’m not sure then

signal vigil
#

okie-dokie then

#

Thanks for helping me out!