Skip to content

Commit

Permalink
Multi-language bot description & short description without BotFather
Browse files Browse the repository at this point in the history
  • Loading branch information
kubk committed Dec 23, 2023
1 parent c0f8762 commit e329ee0
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
43 changes: 43 additions & 0 deletions botfather/update.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { Bot } from "grammy";

const bot = new Bot(process.env.BOT_TOKEN);

const main = async () => {
await bot.api.setMyShortDescription(
"Improve your memory with spaced repetition. Learn languages, history or other subjects with the proven flashcard method.",
{ language_code: "en" },
);

await bot.api.setMyDescription(
"People tend to forget information. Within an hour, up to 60% of new information can slip away, and by the end of a week, only about 10% may remain. However, consistent revisiting of the information can combat this decline. This bot uses the proven flashcard method, assisting users in retaining and mastering languages, history, and more.",
{
language_code: "en",
},
);

await bot.api.setMyShortDescription(
"Улучшайте свою память с помощью интервального повторения. Изучайте языки, историю и другие предметы с помощью бота.",
{ language_code: "ru" },
);

await bot.api.setMyDescription(
"Люди склонны забывать информацию. В течение часа забывается до 60% новой информации, а к концу недели может остаться около 10%. Однако постоянное повторение информации может предотвратить эту проблему. Этот бот использует метод интервального повторения, помогая пользователям сохранять и усваивать языки, историю и многое другое.",
{
language_code: "ru",
},
);

await bot.api.setMyShortDescription(
"Mejora tu memoria con la repetición espaciada.",
{ language_code: "es" },
);

await bot.api.setMyDescription(
"Las personas tienden a olvidar la información. En una hora, hasta el 60% de la información nueva puede desaparecer, y al final de una semana, solo puede quedar alrededor del 10%. Sin embargo, la revisión constante de la información puede combatir este declive. Este bot utiliza el probado método de tarjetas de memoria, ayudando a los usuarios a retener y dominar idiomas, historia y más.",
{
language_code: "es",
},
);
};

main();
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"test:frontend:coverage": "npx vitest run --dir src/ --coverage",
"prod:api:logs": "npx wrangler pages deployment tail",
"prod:deploy": "npx wrangler pages publish functions --project-name=memo-card",
"dev:botfather:description": "export $(cat .dev.vars) && node botfather/update.js",
"db:backup": "export $(cat .dev.vars | xargs) && pg_dump postgresql://postgres:$DB_PASS@$DB_HOST:5432/$DB_NAME > dump.sql",
"generate-db-types": "docker info > /dev/null 2>&1 && export $(cat .dev.vars | xargs) && npx supabase gen types typescript --db-url postgresql://postgres:$DB_PASS@$DB_HOST:5432/$DB_NAME >./functions/db/databaseTypes.ts"
},
Expand Down

0 comments on commit e329ee0

Please sign in to comment.