This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var a = prompt('вводите', 'упс:('); | |
console.log(a); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var a = read("введи"); | |
console.log(a); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const prompt = require('prompt-sync')(); | |
let name = []; | |
for (let i = 0; name[i] !== undefined; i++) { | |
name[i] = prompt('Введите имя'); | |
} | |
console.log(name); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const prompt = require('prompt-sync')(); | |
let names = []; | |
var i = 0; | |
//while (true) { | |
for (; true; i++) { | |
if (i == 0) { | |
names[i] = prompt('Введите первое имя. Для завершения ввода оставьте строку пустой и просто нажмите Enter: ', 'Спасибо. Ввод имен завершен.'); | |
if (names[i] === 'Спасибо. Ввод имен завершен.' || names[i] === null || names[i] === '') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const prompt = require('prompt-sync')(); | |
let names = []; | |
for (let i = 0; true; i++) { | |
if (i == 0) { | |
let answer = prompt('Введите первое имя. Для завершения ввода оставьте строку пустой и просто нажмите Enter: ', 'Спасибо. Ввод имен завершен.'); | |
if (answer = '') { | |
console.log('Вы не ввели ни одного имени'); | |
break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ахах, спасибо большое. Я обискал все словари, поспрашивал у знакомых... | |
Видимо, пора к окулисту) | |
*И да, пишу тут, и о там на русском запрещено) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Пишу тут, чтобы не нарушать правила чата) опять же, я дам ссылку, а не форвард сообщения на русском, что определенно нарушает правила. | |
В общем, что я хотел сказать: | |
Я еще не на уровне свободного общения и честно, мее лень переводить Ваше сообщение. Закрыли тему, спасибо за дискуссию. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bot.start((ctx) => { | |
(ctx.reply('Начали! Выберите бренд:', {reply_markup: {keyboard: data.brands, resize_keyboard: true}})) | |
}) | |
bot.on('text', (ctx) => { | |
//Для тех случаев, когда человек ввел что-то сам. Он почему-то срабатывает и после нажатия на кнопки категории | |
if(typeof(ctx.message.text) === 'string' && (ctx.message.text) !== '⬅️ Назад' && (ctx.message.text) !== 'Artel' && (ctx.message.text) !== 'Royal' && (ctx.message.text) !== 'Shivaki' && (ctx.message.text) !== 'Samsung') | |
ctx.reply('Вы не выбрали бренд. Пожалуйста, нажмите одну из кнопок ниже:', {reply_markup: {keyboard: data.brands, resize_keyboard: true}}) | |
switch (ctx.message.text) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*Мне нужно узнать, на чье сообщение отвечает юзер | |
Пишу | |
console.log(ctx.update.message.reply_to_message.from.id) | |
для: | |
{"update_id":271606609,"message":{"message_id":294,"from":{"id":62253745,"is_bot":false,"first_name":"Endorphine","username":"Khuzha","language_code":"ru"},"chat":{"id":62253745,"first_name":"Endorphine","username":"Khuzha","type":"private"},"date":1536767250,"reply_to_message":{"message_id":283,"from":{"id":667423748,"is_bot":true,"first_name":"Khuzha","username":"KhuzhaBot"},"chat":{"id":62253745,"first_name":"Endorphine","username":"Khuzha","type":"private"},"date":1536766748,"forward_from":{"id":346724642,"is_bot":false,"first_name":"Jakhongir","username":"itashpik","language_code":"en-US"},"forward_date":1536766748,"text":"Не работает"},"text":";\\"}} | |
Выходит ошибка: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Вот тут: | |
bot.on('text', (ctx) => { | |
if (ctx.chat.id == data.myid){ | |
if(ctx.update.message && ctx.update.message.reply_to_message) { | |
ctx.sendMessage(ctx.update.message.reply_to_message.from.id, ctx.message) | |
}......... | |
Выдает вот эту ошибку: |
OlderNewer