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

editMessageText

ویرایش متن یک پیام قبلاً ارسال شده در یک چت.

ورودی‌ها

نامنوعتوضیح
chat_idstringآیدی چتی که پیام باید در آن ویرایش شود.
textstringمتن پیام
message_idstringشناسه پیام

خروجی

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

نحوه استفاده

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

const bot = new Bot("YOUR_TOKEN");

bot.command("/edit", async (ctx) => {
const { message_id } = await bot.sendMessage(ctx.chat_id, "ربات استارت شد.");

await bot.editMessageText(ctx.chat_id, "پیام ویرایش شد!", message_id);
});

bot.run();