Skip to content

Commit

Permalink
Added types
Browse files Browse the repository at this point in the history
  • Loading branch information
bostrot committed Jun 26, 2022
1 parent 09f8017 commit 72b8b36
Show file tree
Hide file tree
Showing 24 changed files with 752 additions and 770 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
"eslint.workingDirectories": [
"./src",
],
"typescript.tsdk": "node_modules/typescript/lib",
}
24 changes: 14 additions & 10 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "tsc",
"problemMatcher": [],
"label": "npm: tsc",
"detail": "tsc"
}
]
"version": "2.0.0",
"tasks": [
{
"type": "typescript",
"tsconfig": "tsconfig.json",
"problemMatcher": [
"$tsc"
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16-alpine
FROM node:18.4-alpine
WORKDIR /bot

COPY ./src /bot/src
Expand Down
103 changes: 51 additions & 52 deletions config/config-sample.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# bot settings
bot_token: "YOUR_BOT_TOKEN" # support bot tok en
staffchat_id: "SUPERGROUP_CHAT_ID" # eg. -123456789
owner_id: "YOUR_TELEGRAM_ID"
bot_token: 'YOUR_BOT_TOKEN' # support bot tok en
staffchat_id: 'SUPERGROUP_CHAT_ID' # eg. -123456789
owner_id: 'YOUR_TELEGRAM_ID'
spam_time: 5 * 60 * 1000 # time (in MS) in which user may send 5 messages
spam_cant_msg: 5

parse_mode: "MarkdownV2" # Markdown, HTML or MarkdownV2
parse_mode: 'MarkdownV2' # Markdown, HTML or MarkdownV2

allow_private: false # Allow / disallow option for staff to chat privately
direct_reply: false # Set this to true to just forward staff users to a user chat when allow_private
auto_close_tickets: true # Close tickets after answering
anonymous_tickets: true # Include userid in tickets or not
show_auto_replied: false # Send auto replied msgs to staff chat
show_user_ticket: false # Show ticket id to user

signal_enabled: false # Enable/disable signal
signal_number: '+12345689' # Your signal number / account
Expand All @@ -25,56 +26,56 @@ dev_mode: true # Enable/disable dev mode

# customize your language
language:
startCommandText: "Welcome in our support chat! Ask your question here."
faqCommandText: "This bot is <a href='https://github.com/bostrot/telegram-support-bot'>Open Source</a>. You can host it yourself here <a href='https://botspace.bostrot.com'>Botspace</a>."
helpCommandText: "<b>Available commands:</b>\n/help\n/faq\n/id"
contactMessage: "Thank you for contacting us. We will answer as soon as possible.\n"
blockedSpam: "You sent quite a number of questions in the last while. Please calm down and wait until staff reviews them."
ticket: "Ticket"
closed: "closed"
acceptedBy: "was accepted by"
dear: "Dear"
regards: "Best regards,"
from: "from"
language: "Language"
msg_sent: "Message sent to user"
file_sent: "File sent to user"
usr_with_ticket: "User with ticket"
banned: "banned"
replyPrivate: "Reply in private"
services: "Select a service from the list below"
customer: "customer"
msgForwarding: "You messages will now be forwarded to vendors of the group: "
back: "Go back"
whatSubCategory: "Which subcategory describes your needs the best? "
prvChatEnded: "Private chat ended."
prvChatOpened: "Private Chat opened with customer."
prvChatEnd: "End Private chat"
prvChatOpenedCustomer: "Opened private chat"
instructionsSent: "Instructions were sent to you in private chat."
openTickets: "Open Tickets"
support: "Support"
prvChatOnly: "This command can be used in private chat only."
ticketClosed: "Your ticket was closed by our staff. You can open a new ticket at any time."
links: "Direct support links"
textFirst: "Please send us a message before sending an image so that we can help you better."
ticketClosedError: "You cannot reply to a closed ticket."
automatedReply: "This is an automated reply."
automatedReplyAuthor: "BottyBot."
doesntHelp: "This does not help."
automatedReplySent: "Automated reply was send to the user."
ticketReopened: "Ticket reopened."
startCommandText: 'Welcome in our support chat! Ask your question here.'
faqCommandText: "This bot is <a href='https://github.com/bostrot/telegram-support-bot'>Open Source</a>. You can host it yourself here <a href='https://botspace.bostrot.com'>Botspace</a>."
helpCommandText: "<b>Available commands:</b>\n/help\n/faq\n/id"
contactMessage: "Thank you for contacting us. We will answer as soon as possible.\n"
blockedSpam: 'You sent quite a number of questions in the last while. Please calm down and wait until staff reviews them.'
ticket: 'Ticket'
closed: 'closed'
acceptedBy: 'was accepted by'
dear: 'Dear'
regards: 'Best regards,'
from: 'from'
language: 'Language'
msg_sent: 'Message sent to user'
file_sent: 'File sent to user'
usr_with_ticket: 'User with ticket'
banned: 'banned'
replyPrivate: 'Reply in private'
services: 'Select a service from the list below'
customer: 'customer'
msgForwarding: 'You messages will now be forwarded to vendors of the group: '
back: 'Go back'
whatSubCategory: 'Which subcategory describes your needs the best? '
prvChatEnded: 'Private chat ended.'
prvChatOpened: 'Private Chat opened with customer.'
prvChatEnd: 'End Private chat'
prvChatOpenedCustomer: 'Opened private chat'
instructionsSent: 'Instructions were sent to you in private chat.'
openTickets: 'Open Tickets'
support: 'Support'
prvChatOnly: 'This command can be used in private chat only.'
ticketClosed: 'Your ticket was closed by our staff. You can open a new ticket at any time.'
links: 'Direct support links'
textFirst: 'Please send us a message before sending an image so that we can help you better.'
ticketClosedError: 'You cannot reply to a closed ticket.'
automatedReply: 'This is an automated reply.'
automatedReplyAuthor: 'BottyBot.'
doesntHelp: 'This does not help.'
automatedReplySent: 'Automated reply was send to the user.'
ticketReopened: 'Ticket reopened.'
yourTicketId: 'Your ticket ID is'

autoreply:
- question: "install"
- question: 'install'
answer: "If you want to install the bot, you can use the following link:\n\
[Getting Started](https://github.com/bostrot/telegram-support-bot/wiki/Getting-started)\n\n\
Alternatively you can also use our one-click setup & hosting service:\n\
[Botspace](https://botspace.bostrot.com/)"
- question: "are you sure?"
answer: "Yes."

# categories:
- question: 'are you sure?'
answer: 'Yes.'
# categories:
# - name: "Category1"
# subgroups:
# - name: "Sub1"
Expand All @@ -84,7 +85,7 @@ autoreply:
# - name: "Sub3"
# group_id: "-12345678910"
# - name: "Category2"
# subgroups:
# subgroups:
# - name: "Sub4"
# group_id: "-12345678910"
# - name: "Sub5"
Expand All @@ -94,9 +95,7 @@ autoreply:
# - name: "Category with no subcategories"
# group_id: "-12345678910"
# - name: "Admin Chat"
# group_id: "-12345678910"
# group_id: "-12345678910"
# - name: "Contact"
# msg: "Check out our Website"



Loading

0 comments on commit 72b8b36

Please sign in to comment.