Skip to content
Permalink
Browse files

Media replying fixed, language bug fixed

  • Loading branch information...
bostrot committed Feb 13, 2019
1 parent 7af0625 commit edc1a2cc9ef43920b3b744bdf3d46702304321a4
Showing with 19 additions and 6 deletions.
  1. +1 −1 bin/support.js
  2. +18 −5 bin/ticket_handler.js
@@ -265,7 +265,7 @@ bot.command('close', (ctx) => {
admins.indexOf(ctx.from.id) > -1
) {
let replyText = ctx.message.reply_to_message.text;
let userid = replyText.match(new RegExp('#' + '(.*)' + ' from'));
let userid = replyText.match(new RegExp('#' + '(.*)' + ' ' + config.lang_from));
cache.ticketStatus[userid[1]] = false;
}
});
@@ -24,11 +24,18 @@ function staffChat(ctx, bot) {
ctx.message.reply_to_message !== undefined &&
admins.indexOf(ctx.from.id) > -1
) {
// try whether a text or an image/video is replied to
try {
replyText = ctx.message.reply_to_message.text;
let userid = replyText.match(new RegExp('#' + '(.*)' + ' from'));
let name = replyText.match(new RegExp('from ' + '(.*)' + ' @'));
if (ctx.message.text === 'me') {
if (replyText === undefined) {
replyText = ctx.message.reply_to_message.caption;
}
let userid = replyText.match(new RegExp('#' + '(.*)' + ' ' + config.lang_from));
if (userid === null || userid === undefined) {
userid = replyText.match(new RegExp('#' + '(.*)' + '\n' + config.lang_from));
}
let name = replyText.match(new RegExp(config.lang_from + ' ' + '(.*)' + ' @'));
if (ctx.message.text !== undefined && ctx.message.text === 'me') {
// accept ticket
bot.telegram.sendMessage(
config.staffchat_id,
@@ -76,7 +83,13 @@ function staffChat(ctx, bot) {
);
}
cache.ticketSent[cache.tickedID] = undefined;
} catch (e) {}
} catch (e) {
console.log(e)
bot.telegram.sendMessage(
config.staffchat_id, 'An error occured, please report this to your admin: \n\n' + e,
cache.noSound
);
}
}
})
.catch(function(noAdmin) {
@@ -224,7 +237,7 @@ function fowardHandler(ctx, callback) {
userInfo +=
'@' +
ctx.message.from.username +
'\n' +
' ' +
config.lang_language +
': ' +
ctx.message.from.language_code +

0 comments on commit edc1a2c

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.