Merge pull request 'main' (#21) from main into feature/admin-section
Reviewed-on: https://git.softuniq.eu/Telegram-Market/telegram-shop/pulls/21
This commit is contained in:
commit
18e09119b3
@ -1,4 +1,5 @@
|
|||||||
name: "Telegram Shop Bot CI [DEMO]"
|
name: "Telegram Shop Bot CI [DEMO]"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ["demo"]
|
branches: ["demo"]
|
||||||
@ -7,7 +8,23 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
runs-on: node:22-alpine
|
runs-on: ubuntu-latest # Запускаем на универсальной платформе
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Node.js 22
|
||||||
|
run: |
|
||||||
|
# Устанавливаем nvm (Node Version Manager)
|
||||||
|
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
|
||||||
|
export NVM_DIR="$HOME/.nvm"
|
||||||
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
||||||
|
nvm install 22
|
||||||
|
nvm use 22
|
||||||
|
node -v # Проверка установленной версии Node.js
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm install
|
||||||
|
|
||||||
|
- name: Run lint
|
||||||
|
run: npm run lint
|
||||||
|
@ -1,13 +1,33 @@
|
|||||||
name: "Telegram Shop Bot CI [DEV]"
|
name: "Telegram Shop Bot CI [DEV]"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ["dev"]
|
branches:
|
||||||
|
- dev
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: ["dev"]
|
branches:
|
||||||
|
- dev
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
runs-on: node:22-alpine
|
runs-on: ubuntu-latest # Запуск на Ubuntu
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Node.js 22
|
||||||
|
run: |
|
||||||
|
echo "Устанавливаем Node.js 22"
|
||||||
|
curl -sL https://deb.nodesource.com/setup_22.x | sudo -E bash -
|
||||||
|
sudo apt-get install -y nodejs
|
||||||
|
node -v # Проверка установленной версии Node.js
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
echo "Устанавливаем зависимости"
|
||||||
|
npm install
|
||||||
|
|
||||||
|
- name: Run lint
|
||||||
|
run: |
|
||||||
|
echo "Запуск линтинга"
|
||||||
|
npm run lint
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
name: "Telegram Shop Bot CI [PROD]"
|
name: "Telegram Shop Bot CI [PROD]"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ["prod"]
|
branches: ["prod"]
|
||||||
@ -7,7 +8,23 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
runs-on: node:22-alpine
|
runs-on: ubuntu-latest # Запускаем на универсальной платформе
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Node.js 22
|
||||||
|
run: |
|
||||||
|
# Устанавливаем nvm (Node Version Manager)
|
||||||
|
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
|
||||||
|
export NVM_DIR="$HOME/.nvm"
|
||||||
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
||||||
|
nvm install 22
|
||||||
|
nvm use 22
|
||||||
|
node -v # Проверка установленной версии Node.js
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm install
|
||||||
|
|
||||||
|
- name: Run lint
|
||||||
|
run: npm run lint
|
10
src/index.js
10
src/index.js
@ -79,6 +79,16 @@ bot.on('message', async (msg) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (msg.text.toLowerCase() === '/start') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const canUse = await userHandler.canUseBot(msg);
|
||||||
|
|
||||||
|
if (!canUse) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Check for admin location input
|
// Check for admin location input
|
||||||
if (await adminLocationHandler.handleLocationInput(msg)) {
|
if (await adminLocationHandler.handleLocationInput(msg)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user