Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
windkh committed Jul 21, 2021
1 parent e57583b commit 1ccfa3d
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions telegrambot/99-telegrambot.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,24 +292,23 @@ module.exports = function (RED) {

for (let language in botCommandsByLanguage) {
let botCommands = botCommandsByLanguage[language];

if (botCommands && botCommands.length > 0) {
let telegramBot = self.getTelegramBot();
if (telegramBot) {
let options = {
// scope : { type : 'default' }, // TODO: in future we should support scopes.
};

if (language !== '')
{
if (language !== '') {
options.language_code = language;
}

telegramBot
.setMyCommands(botCommands, options)
.then(function (result) {
if (!result) {
self.warn('Failed to call /setMyCommands for language' + language );
self.warn('Failed to call /setMyCommands for language' + language);
}
})
.catch(function (err) {
Expand Down Expand Up @@ -533,7 +532,7 @@ module.exports = function (RED) {
description: description,
registerCommand: registerCommand,
language: language,
scope: scope
scope: scope,
};
self.commands.push(commandInfo);

Expand Down Expand Up @@ -971,14 +970,14 @@ module.exports = function (RED) {
let node = this;
let command = config.command;
let description = config.description;

let registerCommand = config.registercommand;
let language = config.language || "";
let scope = config.scope || "default";
let language = config.language || '';
let scope = config.scope || 'default';

let useRegex = config.useregex || false;
let removeRegexCommand = config.removeregexcommand || false;

let regEx;
if (useRegex) {
try {
Expand Down

0 comments on commit 1ccfa3d

Please sign in to comment.