Skip to content

Commit

Permalink
Merge branch 'beta'
Browse files Browse the repository at this point in the history
  • Loading branch information
ptkdev committed Jan 10, 2022
2 parents b9a037b + 29513d0 commit 620d01a
Show file tree
Hide file tree
Showing 13 changed files with 880 additions and 845 deletions.
34 changes: 34 additions & 0 deletions .github/workflows copy/beta.yml
@@ -0,0 +1,34 @@
name: Release Beta
on:
push:
branches:
- beta
jobs:
build:
runs-on: ubuntu-latest
if: "!startsWith(github.event.head_commit.message, '[🚀 Release]')"
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.GIT_TOKEN }}
- uses: actions/setup-node@v2
with:
node-version: "16.x"
registry-url: "https://registry.npmjs.org"
- run: git config --global user.name 'Patryk Rzucidlo (@PTKDev)'
- run: git config --global user.email 'support@ptkdev.io'
- run: npm ci
- run: npm run github-workflow-next-version -- --cmd beta
- run: npm run pre-commit
- id: pkgjson
run: chmod +x ./scripts/version.sh && ./scripts/version.sh
- run: git add . && git commit -m "[🚀 Release] v${{ steps.pkgjson.outputs.pkgversion }}" && git push
- run: npm publish --tag beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: git fetch --all && git checkout nightly
- run: npm run github-workflow-next-version -- --cmd nightly-next
- run: npm run pre-commit
- id: nextnightly
run: chmod +x ./scripts/version.sh && ./scripts/version.sh
- run: git add . && git commit -m "[🚀 Release] v${{ steps.nextnightly.outputs.pkgversion }}" && git push
46 changes: 46 additions & 0 deletions .github/workflows copy/main.yml
@@ -0,0 +1,46 @@
name: Release Stable
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
if: "!startsWith(github.event.head_commit.message, '[🚀 Release]')"
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.GIT_TOKEN }}
- uses: actions/setup-node@v2
with:
node-version: "16.x"
registry-url: "https://registry.npmjs.org"
- run: git config --global user.name 'Patryk Rzucidlo (@PTKDev)'
- run: git config --global user.email 'support@ptkdev.io'
- run: npm ci
- run: npm run github-workflow-next-version -- --cmd main
- run: npm run pre-commit
- id: pkgjson
run: chmod +x ./scripts/version.sh && ./scripts/version.sh
- run: git add . && git commit -m "[🚀 Release] v${{ steps.pkgjson.outputs.pkgversion }}" && git push
- run: npm publish --tag latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%B %d, %Y')"
- run: npm run github-workflow-changelog
- id: changelog
run: chmod +x ./scripts/changelog_release.sh && ./scripts/changelog_release.sh
- name: Release snapshot
id: release-snapshot
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.pkgjson.outputs.pkgversion }}
release_name: v${{ steps.pkgjson.outputs.pkgversion }}
body: |
### CHANGELOG: v${{ steps.pkgjson.outputs.pkgversion }} (${{ steps.date.outputs.date }})${{ steps.changelog.outputs.changelog }}
draft: false
prerelease: false
31 changes: 31 additions & 0 deletions .github/workflows copy/nightly.yml
@@ -0,0 +1,31 @@
name: Release Nightly
on:
schedule:
- cron: "30 23 * * *"
push:
branches:
- nightly
jobs:
build:
runs-on: ubuntu-latest
if: "!startsWith(github.event.head_commit.message, '[🚀 Release]') || startsWith(github.event.head_commit.message, '[🚀 Release] Nightly')"
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.GIT_TOKEN }}
ref: nightly
- uses: actions/setup-node@v2
with:
node-version: "16.x"
registry-url: "https://registry.npmjs.org"
- run: git config --global user.name 'Patryk Rzucidlo (@PTKDev)'
- run: git config --global user.email 'support@ptkdev.io'
- run: npm ci
- run: npm run github-workflow-next-version -- --cmd nightly
- run: npm run pre-commit
- id: pkgjson
run: chmod +x ./scripts/version.sh && ./scripts/version.sh
- run: git add . && git commit -m "[🚀 Release] v${{ steps.pkgjson.outputs.pkgversion }}" && git push
- run: npm publish --tag nightly
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Expand Up @@ -22,9 +22,9 @@ jobs:
- run: git config --global user.email 'support@ptkdev.io'
- run: npm ci
- run: npm run github-workflow-next-version -- --cmd nightly
- run: npm run pre-commit
- id: pkgjson
run: chmod +x ./scripts/version.sh && ./scripts/version.sh
- run: npm run pre-commit
- run: git add . && git commit -m "[🚀 Release] v${{ steps.pkgjson.outputs.pkgversion }}" && git push
- run: npm publish --tag nightly
env:
Expand Down
10 changes: 7 additions & 3 deletions CHANGELOG.md
@@ -1,7 +1,5 @@
# v0.6.0 (Deecember 04, 2021)
# v0.6.1 (Juanuary 10, 2022)

- Feature: /version command
- Feature: /ral command
- Fix: minor issues

<!-- all-shields/sponsors-badges:START -->
Expand All @@ -10,6 +8,12 @@

<!-- all-shields/sponsors-badges:END -->

# v0.6.0 (December 04, 2021)

- Feature: /version command
- Feature: /ral command
- Fix: minor issues

# v0.5.0 (November 21, 2021)

- Porting: from Telegraf to Grammy Framework
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -4,7 +4,7 @@

<!-- all-shields/header-badges:START -->

[![v0.6.0](https://img.shields.io/badge/version-v0.6.0-lightgray.svg?style=flat&logo=)](https://github.com/ptkdev/aboutmeinfo-telegram-bot/blob/main/CHANGELOG.md) [![](https://img.shields.io/npm/v/@ptkdev/aboutmeinfo-telegram-bot?color=CC3534&logo=npm)](https://www.npmjs.com/package/@ptkdev/aboutmeinfo-telegram-bot) [![License: MIT](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat&logo=license)](https://github.com/ptkdev/aboutmeinfo-telegram-bot/blob/main/LICENSE.md) [![Language: TypeScript](https://img.shields.io/badge/language-typescript-blue.svg?style=flat&logo=typescript)](https://www.typescriptlang.org/) [![Framework: Grammy](https://img.shields.io/badge/powered%20by-grammy-009dca.svg?style=flat&logo=telegram)](https://grammy.dev/) [![ECMAScript: 2019](https://img.shields.io/badge/ES-9-F7DF1E.svg?style=flat&logo=javascript)](https://github.com/tc39/ecma262) [![Discord Server](https://discordapp.com/api/guilds/383373985666301975/embed.png)](https://discord.ptkdev.io)
[![v0.6.1-beta.1](https://img.shields.io/badge/version-v0.6.1--beta.1-lightgray.svg?style=flat&logo=)](https://github.com/ptkdev/aboutmeinfo-telegram-bot/blob/main/CHANGELOG.md) [![](https://img.shields.io/npm/v/@ptkdev/aboutmeinfo-telegram-bot?color=CC3534&logo=npm)](https://www.npmjs.com/package/@ptkdev/aboutmeinfo-telegram-bot) [![License: MIT](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat&logo=license)](https://github.com/ptkdev/aboutmeinfo-telegram-bot/blob/main/LICENSE.md) [![Language: TypeScript](https://img.shields.io/badge/language-typescript-blue.svg?style=flat&logo=typescript)](https://www.typescriptlang.org/) [![Framework: Grammy](https://img.shields.io/badge/powered%20by-grammy-009dca.svg?style=flat&logo=telegram)](https://grammy.dev/) [![ECMAScript: 2019](https://img.shields.io/badge/ES-9-F7DF1E.svg?style=flat&logo=javascript)](https://github.com/tc39/ecma262) [![Discord Server](https://discordapp.com/api/guilds/383373985666301975/embed.png)](https://discord.ptkdev.io)

<!-- all-shields/header-badges:END -->

Expand Down
19 changes: 10 additions & 9 deletions app/configs/config.js.tpl
Expand Up @@ -19,19 +19,20 @@ module.exports = {
debug: process.env.DEBUG || true,

// LOGS
// https://github.com/ptkdev/ptkdev-logger
logger: {
path: {
debug_log: "./logs/debug.log",
error_log: "./logs/errors.log",
},
language: "en", // set language of log type, NOTE: please help with translations! (optional, default en - values: en|it|pl)
colors: true, // enable/disable colors in terminal (optional, default enabled - values: true|enabled or false|disabled)
debug: process.env.DEBUG || true, // enable/disable all logs with method debug (optional, default enabled - values: true|enabled or false|disabled)
info: true, // enable/disable all logs with method info (optional, default enabled - values: true|enabled or false|disabled)
warning: true, // enable/disable all logs with method warning (optional, default enabled - values: true|enabled or false|disabled)
error: true, // enable/disable all logs with method errors (optional, default enabled - values: true|enabled or false|disabled)
sponsor: true, // enable/disable all logs with method sponsor (optional, default enabled - values: true|enabled or false|disabled)
write: false, // write the logs into a file, you need set path values (optional, default disabled - values: true|enabled or false|disabled)
type: "log", // format of logs in files (optional, default log - values: log|json)
language: "en",
colors: true,
debug: process.env.LOGGER || "enabled",
info: process.env.LOGGER || "enabled",
warning: process.env.LOGGER || "enabled",
error: process.env.LOGGER || "enabled",
sponsor: process.env.LOGGER || "enabled",
write: process.env.LOGGER_WRITE || false,
type: "log",
},
};
28 changes: 20 additions & 8 deletions app/functions/commands/ral.ts
Expand Up @@ -17,14 +17,26 @@ const version = async (): Promise<void> => {
group_id: telegram.api.message.getChatID(ctx),
});

await telegram.api.message.send(
ctx,
telegram.api.message.getChatID(ctx),
translate(lang.language, "ral_command", {
username: telegram.api.message.getText(ctx).replace("/ral ", "").trim(),
ral: Math.floor(Math.random() * (120 - 18) + 18),
}),
);
if (
telegram.api.message.getText(ctx).trim() === "/ral" ||
telegram.api.message.getText(ctx).trim() === `/ral@${telegram.api.bot.getUsername(ctx)}`
) {
await telegram.api.message.send(
ctx,
telegram.api.message.getChatID(ctx),
translate(lang.language, "ral_command_error"),
);
} else {
await telegram.api.message.send(
ctx,
telegram.api.message.getChatID(ctx),
translate(lang.language, "ral_command", {
username: telegram.api.message.getText(ctx).replace("/ral ", "").replace(/_/g, "\\_").trim(),
ral: Math.floor(Math.random() * (120 - 18) + 18),
}),
{ parse_mode: "MarkdownV2" },
);
}
});
};

Expand Down
3 changes: 2 additions & 1 deletion app/translations/en.json
Expand Up @@ -51,5 +51,6 @@
"about_command_user_not_found": "😿 The user @{{username}} did not set his profiles, ask him to do it by typing in private to the bot: @{{bot_nickname}}",
"start_command_nickname_empty": "🚷 You have not set a nickname in your telegram account: enter the settings of the app and insert one, then you do again /start",
"start_command_intro_group": "This bot allows you to share your social profiles and links with Telegram users. Use the command /about @nickname to see a user's profiles and links, for example:\n\n/about @ptkdev\n\nType in private to @{{bot_nickname}} to set your links and social media.",
"ral_command": "The RAL of {{username}} is {{ral}}k!"
"ral_command": "||The RAL of {{username}}, {{ral}}k\\!||",
"ral_command_error": "The correct format is:\n\n/ral @nickname\n\nexample: /ral @ptkdev. Try again!"
}
3 changes: 2 additions & 1 deletion app/translations/it.json
Expand Up @@ -51,5 +51,6 @@
"about_command_user_not_found": "😿 L'utente @{{username}} non ha impostato i suoi profili, chiedigli di farlo scrivendo in privato al bot: @{{bot_nickname}}",
"start_command_nickname_empty": "🚷 Non hai impostato un nickname nel tuo account di Telegram, entra nelle impostazioni dell'app e inseriscine uno. Poi fai nuovamente /start",
"start_command_intro_group": "Questo bot permette di condividere i tuoi profili social e link con gli utenti di telegram. Usa il comando /about @nickname per vedere i profili e link di un utente, ad esempio:\n\n/about @ptkdev\n\nScrivi in privato a @{{bot_nickname}} per impostare i tuoi profili.",
"ral_command": "La RAL di {{username}} è {{ral}}k!"
"ral_command": "||La RAL di {{username}}, {{ral}}k\\!||",
"ral_command_error": "Il formato corretto è:\n\n/ral @nickname\n\nesempio: /ral @ptkdev. Riprova!"
}

0 comments on commit 620d01a

Please sign in to comment.