F
F
falsescam2020-04-29 23:01:25
JavaScript
falsescam, 2020-04-29 23:01:25

How to create an admin array for a telegram?

For example, there is this code:

bot.command('start', (ctx) => {
  const options = {
    inline: false,
    duplicates: false,
    newline: false,
  };
  const keyboard = new Keyboard(options);
  keyboard
    .add(' /Help ', '✔️ /Tos ✔️', '❓ /Methods ❓')
  ctx.reply('Open Started Menu!', keyboard.draw());
})


And there is this one:

bot.command('clear', async (ctx) => {
  var args = ctx.message.text.split(' ');
  args.shift()
  console.log(' host: ' + args[0] + ' port: ' + args[1] + ' time: ' + args[2] + ' method: ' +args[3])


How can I make an array for 2 commands so that some users can use
for example
var users = [123]:

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sanders Rocket, 2020-04-29
@sandersik

if I understand correctly, then

let admin = ['1232', '32434'] 
const checkadmin = admin.find(u => u.admin === тут ид пользователей, хз какие они у тебя)
if (checkadmin)
// admin
} else {
// no admin
}

I don’t really rummage because I recently started, but try this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question