Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

137
Views
Autocode - user storage

I have such a problem. I have a command / role where the menu comes out and there admin can choose a certain role for the user who created the command. But the problem is that when someone creates the command second and I want to cast the role to the first user who used the command, then it gives the role to the last user, see photo. Does anyone please know how to solve this problem? Thank youenter image description here

Prefix code:

const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});

const uzivatel = context.params.event.author.id;


await lib.utils.kv.set({
  key: `uzivatel`,
  value: `${context.params.event.author.id}`
});

console.log();

await lib.discord.channels['@0.2.0'].messages.create({
  "channel_id": `${context.params.event.channel_id}`,
  "content": "",
  "tts": false,
  "components": [
    {
      "type": 1,
      "components": [
        {
          "style": 1,
          "label": `Nahodit roli`,
          "custom_id": `poslat`,
          "disabled": false,
          "emoji": {
            "id": null,
            "name": `📧`
          },
          "type": 2
        }
      ]
    }
  ],
  "embeds": [
    {
      "type": "rich",
      "title": "",
      "description": `Zkouška aby vše fungovalo jak ma`,
      "color": 0x00FFFF
    }
  ]
});

Buttons code:

const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});

let uzivatel = await lib.utils.kv.get({
  key: `uzivatel`
});


console.log()
await lib.discord.channels['@0.2.0'].messages.create({
  "channel_id": `${context.params.event.channel_id}`,
  "content":  `Uspesne si nahodil roli: <@${uzivatel}>`,
  "tts": false
});
console.log();

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!