Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Question

deleted 1 character in body; edited title
Source Link
marc_s
  • 760.2k
  • 186
  • 1.4k
  • 1.5k

Conversation is not working wihtoutwithout any errors in grammyjs

There isI have a problem with CovnersationConversation. I wrote the following code in Conversation.:

if (ctx.session.in_conversation == true) return;
 conversation.session.in_conversation = true;
 await ctx.replyWithChatAction("typing");
 await ctx.reply("Mahsulot nomini kiriting:", {
 reply_markup: cancelKeyboard,
 });
 const nameMsg = await conversation.waitFor(["message"], {
 otherwise: () => ctx.reply("Iltimos matn ko'rinishida kiriting!"),
 });
 const name = nameMsg.message?.text;
 if (name == "❌ Bekor qilish") {
 conversation.session.in_conversation = false;
 await ctx.reply("πŸ™…β€β™‚οΈ Amal bekor qilindi", { reply_markup: mainKeyboard });
 return;
 }
 await ctx.reply("Mahsulot haqida ma'lumot:");
 const descryptionMsg = await conversation.waitFor(["message"]);
 let descryption = descryptionMsg.message.text;
 await ctx.reply(`${descryption}`);
 conversation.session.in_conversation = false;
 return;

Conversation is stopping by itself without returning any error.await ctx.reply("Mahsulot haqida ma'lumot:"); The

await ctx.reply("Mahsulot haqida ma'lumot:");

The text has been sent and the conversation is stuck. Where did I go wrong?

All are working until 2nd reply. But nothing is working after that. replies, conversation logs ... nothing. I solved the previous ones by completely deleting the conversation or rebuilding the project from 0.

Conversation is not working wihtout any errors in grammyjs

There is a problem with Covnersation. I wrote the following code in Conversation.

if (ctx.session.in_conversation == true) return;
 conversation.session.in_conversation = true;
 await ctx.replyWithChatAction("typing");
 await ctx.reply("Mahsulot nomini kiriting:", {
 reply_markup: cancelKeyboard,
 });
 const nameMsg = await conversation.waitFor(["message"], {
 otherwise: () => ctx.reply("Iltimos matn ko'rinishida kiriting!"),
 });
 const name = nameMsg.message?.text;
 if (name == "❌ Bekor qilish") {
 conversation.session.in_conversation = false;
 await ctx.reply("πŸ™…β€β™‚οΈ Amal bekor qilindi", { reply_markup: mainKeyboard });
 return;
 }
 await ctx.reply("Mahsulot haqida ma'lumot:");
 const descryptionMsg = await conversation.waitFor(["message"]);
 let descryption = descryptionMsg.message.text;
 await ctx.reply(`${descryption}`);
 conversation.session.in_conversation = false;
 return;

Conversation is stopping by itself without returning any error.await ctx.reply("Mahsulot haqida ma'lumot:"); The text has been sent and the conversation is stuck. Where did I go wrong?

All are working until 2nd reply. But nothing is working after that. replies, conversation logs ... nothing. I solved the previous ones by completely deleting the conversation or rebuilding the project from 0.

Conversation is not working without any errors in grammyjs

I have a problem with Conversation. I wrote the following code in Conversation:

if (ctx.session.in_conversation == true) return;
 conversation.session.in_conversation = true;
 await ctx.replyWithChatAction("typing");
 await ctx.reply("Mahsulot nomini kiriting:", {
 reply_markup: cancelKeyboard,
 });
 const nameMsg = await conversation.waitFor(["message"], {
 otherwise: () => ctx.reply("Iltimos matn ko'rinishida kiriting!"),
 });
 const name = nameMsg.message?.text;
 if (name == "❌ Bekor qilish") {
 conversation.session.in_conversation = false;
 await ctx.reply("πŸ™…β€β™‚οΈ Amal bekor qilindi", { reply_markup: mainKeyboard });
 return;
 }
 await ctx.reply("Mahsulot haqida ma'lumot:");
 const descryptionMsg = await conversation.waitFor(["message"]);
 let descryption = descryptionMsg.message.text;
 await ctx.reply(`${descryption}`);
 conversation.session.in_conversation = false;
 return;

Conversation is stopping by itself without returning any error.

await ctx.reply("Mahsulot haqida ma'lumot:");

The text has been sent and the conversation is stuck. Where did I go wrong?

All are working until 2nd reply. But nothing is working after that. replies, conversation logs ... nothing. I solved the previous ones by completely deleting the conversation or rebuilding the project from 0.

Source Link

Conversation is not working wihtout any errors in grammyjs

There is a problem with Covnersation. I wrote the following code in Conversation.

if (ctx.session.in_conversation == true) return;
 conversation.session.in_conversation = true;
 await ctx.replyWithChatAction("typing");
 await ctx.reply("Mahsulot nomini kiriting:", {
 reply_markup: cancelKeyboard,
 });
 const nameMsg = await conversation.waitFor(["message"], {
 otherwise: () => ctx.reply("Iltimos matn ko'rinishida kiriting!"),
 });
 const name = nameMsg.message?.text;
 if (name == "❌ Bekor qilish") {
 conversation.session.in_conversation = false;
 await ctx.reply("πŸ™…β€β™‚οΈ Amal bekor qilindi", { reply_markup: mainKeyboard });
 return;
 }
 await ctx.reply("Mahsulot haqida ma'lumot:");
 const descryptionMsg = await conversation.waitFor(["message"]);
 let descryption = descryptionMsg.message.text;
 await ctx.reply(`${descryption}`);
 conversation.session.in_conversation = false;
 return;

Conversation is stopping by itself without returning any error. await ctx.reply("Mahsulot haqida ma'lumot:"); The text has been sent and the conversation is stuck. Where did I go wrong?

All are working until 2nd reply. But nothing is working after that. replies, conversation logs ... nothing. I solved the previous ones by completely deleting the conversation or rebuilding the project from 0.

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /