- [promotions] Export

GitOrigin-RevId: 9450124ab0308c005508e24418e3c1753ea2fdba
This commit is contained in:
the-superpirate 2022-09-06 20:15:34 +03:00
parent 7c1bb06b1b
commit 52d3985ec5
5 changed files with 63 additions and 2 deletions

View File

@ -33,8 +33,9 @@ class TelegramApplication(AioRootThing):
self.promotioner = Promotioner(
promotions=get_promotions(),
promotion_vars=dict(
related_channel=self.config['telegram']['related_channel'],
mutual_aid_group=self.config['telegram']['mutual_aid_group'],
twitter_contact_url=self.config['twitter']['contact_url'],
related_channel=self.config['telegram']['related_channel'],
)
)
self.user_manager = UserManager()

View File

@ -100,7 +100,8 @@ telegram:
- nexus.bot.handlers.search.SearchEditHandler
- nexus.bot.handlers.search.SearchPagingHandler
- nexus.bot.handlers.search.InlineSearchHandler
mutual_aid_group: nexus_aaron
# Channel that will be shown in /help, /howtohelp and in promotions
related_channel: 'nexus_search'
related_channel: nexus_search
twitter:
contact_url: https://twitter.com/the_superpirate

View File

@ -0,0 +1,15 @@
load("@rules_python//python:defs.bzl", "py_library")
py_library(
name = "promotions",
srcs = glob(
["**/*.py"],
exclude = ["tests/**"],
),
data = ["promotions.yaml"],
srcs_version = "PY3",
visibility = ["//visibility:public"],
deps = [
"//library/configurator",
],
)

View File

@ -0,0 +1,8 @@
from library.configurator import Configurator
def get_promotions():
return Configurator(['nexus/promotions/promotions.yaml'])['promotions']
promotions = get_promotions()

View File

@ -0,0 +1,36 @@
---
promotions:
- texts:
en: 💬 The victory of humanity is inevitable
weight: 1
- texts:
en: 💬 Shall build Standard Template Construct
weight: 1
- texts:
en: 💬 Gaining knowledge is the only purpose of life
weight: 1
- texts:
en: 💬 Knowledge cannot belong
weight: 1
- texts:
en: 💬 Obey the path of discovery
weight: 1
- texts:
en: 💬 Research is the only and ultimate goal
weight: 1
- texts:
en: ✋ Have a subscription to paid articles? [Help researchers!](https://t.me/{mutual_aid_group})
ru: ✋ Есть доступ к платным статьям? [Помоги ученым!](https://t.me/{mutual_aid_group})
weight: 25
- texts:
en: ✋ Help us, become a seeder of books. Learn how in /seed
ru: ✋ Сохрани наследие, раздавай книги нуждающимся. Узнай как в /seed
weight: 25
- texts:
en: ⤴️ Stay tuned with us at @{related_channel} and [Twitter]({twitter_contact_url})
es: ⤴️ Mantente en contacto con nosotros en @{related_channel} y [Twitter]({twitter_contact_url})
it: ⤴️ Resta aggiornato con noi su @{related_channel} e [Twitter]({twitter_contact_url})
pb: ⤴️ Fique ligado conosco em @{related_channel} e [Twitter]({twitter_contact_url})
ru: ⤴️ Оставайся на связи с нами на @{related_channel} и в [Twitter]({twitter_contact_url})
weight: 25