پرش به مطلب اصلی

setCommands

افزودن دستور به ربات.

ورودی‌ها

نامنوعتوضیح
chat_idstringآیدی چتی که پیام باید به آن ارسال شود.
commandsCommend[]لیست دستورات

خروجی

  • هیچ مقداری باز نمی‌گرداند. در صورت خطا، یک استثناء پرتاب می‌شود.

نحوه استفاده

const { Bot } = require("rubjs");

const bot = new Bot("YOUR_TOKEN");

bot.command("/command", async (ctx) => {
await bot.setCommands(ctx.chat_id, [
{
command: "command1",
description: "description1",
},
{
command: "command2",
description: "description2",
},
]);
});

bot.run();