Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mod Anonymous config option, Log Users Messages & Restrict amount of messages by Ticket #92

Closed
wants to merge 0 commits into from

Conversation

alambertt
Copy link
Contributor

@alambertt alambertt commented Apr 16, 2022

  • When a person of support staff answer a ticket this config shall allow to show or hide their name
  • The bot log all the users messages by Ticket
  • Added a parameter to Restrict the amount of messages by Ticket

Copy link
Owner

@bostrot bostrot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!
I have made two short comments in your code.
Please address them first before merging.

src/staff.ts Outdated Show resolved Hide resolved
src/inline.ts Outdated Show resolved Hide resolved
alambertt added a commit to alambertt/telegram-support-bot that referenced this pull request Apr 25, 2022
@alambertt alambertt changed the title Mod Anonymous config option Mod Anonymous config option & Log Users Messages Apr 25, 2022
@alambertt alambertt changed the title Mod Anonymous config option & Log Users Messages Mod Anonymous config option, Log Users Messages & Restrict amount of messages by Ticket Apr 25, 2022
@alambertt
Copy link
Contributor Author

alambertt commented Apr 25, 2022

Done @bostrot I solved your comments and added a new func to restrict the amount of messages by ticket. I think that this functionality will be great for add other options in the future and to solve some open issues like #85

src/staff.ts Outdated
`${middleware.escapeText(message.text)}\n\n`+
`${cache.config.language.regards}\n`+
`${message.from.first_name}`;
const first_name = !cache.config.mod_anonymous ? `${message.from.first_name}` : "";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I initially meant is that you remove the new line only if the first name is not sent. So when you from.first_name ist empty it does not add the new line at the end.
So please add something like this:

const first_name = !cache.config.mod_anonymous ? `${message.from.first_name}\n` : "";

Copy link
Owner

@bostrot bostrot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine except the new line thing, thank you.
Please edit that again as I wrote in the comment ;)

@bostrot bostrot added the needs edit This PR still needs an edit. label Nov 27, 2022
@alambertt alambertt closed this Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs edit This PR still needs an edit.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants