Skip to content
This repository was archived by the owner on Aug 25, 2023. It is now read-only.

Commit 7ebc535

Browse files
committed
Fixes for thingsbot
1 parent de260ce commit 7ebc535

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
console.log()
2-
3-
const nodeogram = require('nodeogram'),
1+
const nodeogram = require('nodeogram'),
42
bot = new nodeogram.Bot('TOKEN');
53

64
bot.init();
75

8-
bot.command('start', 'Start', false, (args, message, markup) => {
6+
bot.command('start', 'Start', false, (args, message) => {
97
message.reply("Hi, i am simple calculator bot. send me /help to view a list of commands!");
108
});
119

examples/thingsbot/thingsbot.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const nodeogram = require('../../index'),
33
Bot = nodeogram.Bot,
44
InlineQueryResultArticle = nodeogram.InlineQueryResultArticle;
55

6-
bot = new Bot(config.token);
6+
bot = new Bot(config.token, {profiles_path: __dirname + '/profiles.json', enableHelp: false});
77
bot.init();
88

99
function search(query, limit) {
@@ -332,11 +332,12 @@ bot.on('message', (message) => {
332332
var keyboard = new nodeogram.Keyboard();
333333
results.forEach((result) => {
334334
list += `${i}\u20E3 *${result.label}* - ${result.is}\n`;
335-
keyboard.addButton(0, i - 1, {text: "" + i, callback_data: result.id});
335+
var row = i > 8 ? 1 : 0;
336+
keyboard.addButton(row, row == 0 ? i - 1 : i - 9, {text: "" + i, callback_data: result.id});
336337
i++;
337338
});
338339
keyboard.toInline();
339-
message.reply(list, {reply_markup: keyboard, parse_mode: 'Markdown'})
340+
message.reply(list, {reply_markup: keyboard, parse_mode: 'Markdown'});
340341
console.timeEnd(message.message_id);
341342
}
342343
})

0 commit comments

Comments
 (0)