Giter VIP home page Giter VIP logo

Comments (11)

bitog avatar bitog commented on September 3, 2024 1

Ok wow! You implemented everything. Awesome man! Also love the new ticket number option #tID. Sleek! Love it!

I just tried the /ban command by reply. Also getting the User with ticket #t646148857 banned however my the user is still being able to use the support bot / messages are being forwarded...

I was also wondering is there a command like /unban?

Also, am I able to turn off webpage preview in the /faq command?

I also noticed that lang_contactMessage seems to pop up more frequently now, is that the case?

Thanks for your continuous help!

from telegram-support-bot.

bostrot avatar bostrot commented on September 3, 2024

Something like this is not yet implemented in the public version. You can however restrict a user in the code itself by changing some lines:

Wrap everything from line 101 to 157:

ticket_handler.js (line 101):

var bannedUsers = [ // ticket numbers of users to be banned
                                '907093210', // banned user 1
                                '422589730', // banned user 2
                                '521741214' // banned user 3
                                 ];
if (
  JSON.stringify(bannedUsers).indexOf(ctx.from.id) > -1
) {
  cache.tickedID = ctx.message.from.id;

[ ... ] (keep everything from line 101 to 157 as it is and wrap it in the if-statement)

  console.log(
    'Ticket: ' +
    ' #' +
    cache.tickedID +
    userInfo.replace('\n\n', ': ') +
    ctx.message.text
  );
};

Where you can define the banned users with their ticket ids. Please report back how this works.

EDIT: updated the above example. Here is the full code if you need it: https://gist.github.com/bostrot/d48b8951d0cb0bcf808616feb03251cd

from telegram-support-bot.

bitog avatar bitog commented on September 3, 2024

Hi there,

Thanks for your reply.

I did update it and replaced it with my test accounts ID however the message keeps being forwarded. I just attached a snipped of my code https://imgur.com/vMYd0Eh.png.

I was also wondering, am I able to use markdown in startCommandText;faqCommandText;lang_contactMessage;lang_blockedSpam?

Thanks again for your help, much appreciated!

from telegram-support-bot.

bitog avatar bitog commented on September 3, 2024

Oh! I just think we misunderstood each other. In terms of restricting I meant to restrict a user from being able to contact the support / communicate with the bot. So I can ban/restrict spammers lets say.

from telegram-support-bot.

bostrot avatar bostrot commented on September 3, 2024

My mistake, I sent you the wrong section where to implement it. Wrap everything from line 101 to 157 into the statement. See updated reply #15 (comment)

Also you currently cannot use markdown in those variables you mentioned. You can however use something like \n for line breaks e.g. I plan to include the markdown support in an upcoming version.

from telegram-support-bot.

bitog avatar bitog commented on September 3, 2024

No worries, thanks for the update will try that out.

Alright, yes I was using \n already was just hoping to hide links behind text / make text bold. But thats is ok. Looking forward for the update ;)

I was also wondering - the user first name, username (or undefined) can simply be a tag/mention so that I am also able to click on the telegrams profile of a user which did not setup a username. That would prob help a lot.

Anyways, great working bot!

from telegram-support-bot.

bostrot avatar bostrot commented on September 3, 2024

The latest commit ef08eea adds the ability to use the /ban option (just like you use /close) to restrict users from not being able to write to your staff chat anymore. I also included the way to mention users as you proposed. So there is no username anymore, instead you can click on the users name and see the profile with its id.
Some more minor things are included too. Spam filter is down from 6 messages to 5 per [time you define in config]. Reply how it goes.

from telegram-support-bot.

bostrot avatar bostrot commented on September 3, 2024

Done e147f48.

Yes, initially I intended to use the Telegram hashtag system to find older tickets of that user. I didn't expect that a Telegram hashtag has to begin with a normal character and not a number though. Fixed that by putting t in front of it.

You can disable webpage preview by changing l. 192 from:

ctx.reply(config.faqCommandText, cache.html);

to

ctx.reply(config.faqCommandText, Extra.webPreview(false));

I couldn't verify the lang_contactMessage popping up more often than before. Should only popup first time a user writes a message and after the staff has replied to a message.

About the unban command. Thats a nice idea although I have no plans to implement it right now as you can unban a user by /close ing their ticket. I think that should be enough for now.

from telegram-support-bot.

bitog avatar bitog commented on September 3, 2024

Awesome, it's all working now perfectly. Didnt know that the /close would unban a user. Thats totally fine, good to know.

Was prob something on my end then, as lang_contactMessage works just fine now.

I was wondering, how do I trigger the lang_acceptedBy message? I haven't seen that being used, yet.

from telegram-support-bot.

bostrot avatar bostrot commented on September 3, 2024

The lang_acceptedBy message is triggered by replying me to a ticket. This was useful back then when there was no staff chat and staff members wrote directly to the bot. Kind of redundant now.

from telegram-support-bot.

bitog avatar bitog commented on September 3, 2024

Alright, cool!

from telegram-support-bot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.