diff --git a/src/actions/__init__.py b/src/actions/__init__.py index b21f0d4bc6088e4705286ba1eca0669bac92b4ff..b91a1e0c71067865c9bee30f76413c8dcd6765de 100644 --- a/src/actions/__init__.py +++ b/src/actions/__init__.py @@ -3,11 +3,12 @@ import logging def finish(): - importlib.import_module("src.actions.basic") importlib.import_module("src.actions.fun") + importlib.import_module("src.actions.basic") importlib.import_module("src.actions.replies") + importlib.import_module("src.actions.speller") + importlib.import_module("src.actions.students") importlib.import_module("src.actions.converters") - importlib.import_module("src.actions.package_indexes") importlib.import_module("src.actions.search_engines") - importlib.import_module("src.actions.speller") + importlib.import_module("src.actions.package_indexes") logging.info("All actions loaded") diff --git a/src/actions/replies.py b/src/actions/replies.py index 165e5b1b179693750be91cbc1aeb6b7aef37d02d..b41907c733e4779870064af6f2572f6cb8d24024 100644 --- a/src/actions/replies.py +++ b/src/actions/replies.py @@ -26,7 +26,9 @@ async def welcome(event: events.ChatAction.Event): @config.telegram_client.on( events.NewMessage( - pattern=re.compile(r"^[Пп]ривет\.?", re.IGNORECASE), forwards=False + pattern=re.compile(r"^[Пп]ривет\.?", re.IGNORECASE), + forwards=False, + outgoing=False, ) ) @mark_unread diff --git a/src/actions/students.py b/src/actions/students.py new file mode 100644 index 0000000000000000000000000000000000000000..586baf2e5a05468656d7e5af9e09ce3e2e69e533 --- /dev/null +++ b/src/actions/students.py @@ -0,0 +1,19 @@ +import logging + +from src.config import config +from src.utils.responses import mark_unread +from telethon import events + +logger = logging.getLogger(__name__) + + +@config.telegram_client.on( + events.NewMessage(pattern="^.course$", chats=["Стажировка SimbirSoft"]) +) +@mark_unread +async def course_info(event: events.NewMessage.Event): + participant = event.message.from_id + await event.message.delete() + with open("./static_messages/students.txt") as f: + contents = f.read() + await event.client.send_message(participant, contents, link_preview=False) diff --git a/static_messages/students.txt b/static_messages/students.txt new file mode 100644 index 0000000000000000000000000000000000000000..6edf36688f1f05137882e37aa91af9c72b408e40 --- /dev/null +++ b/static_messages/students.txt @@ -0,0 +1,23 @@ +Привет! Вот Ñ‚ÐµÐºÑƒÑ‰Ð°Ñ Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ Ð¿Ð¾ курÑу: + +Текущее задание: +- `Изучить Ñпецификацию REST`; +- `Изучить что такое Environment Varibales и как их иÑпользовать в Python`; +- `Развернуть ÐºÐ°Ñ€ÐºÐ°Ñ Ð¿Ñ€Ð¸Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ Ð½Ð° Django`; +- `УÑтановить git` +- `Создать репозиторий в гитхабе`; +- `Залить туда ÐºÐ°Ñ€ÐºÐ°Ñ Ð¿Ñ€Ð¸Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ`; +- `Добавить Ð¼ÐµÐ½Ñ Ð² мейнтейнеры репозиториÑ`. + +Полезные ÑÑылки: +- [ОпиÑание REST методов](https://assertible.com/blog/7-http-methods-every-web-developer-should-know-and-how-to-test-them); +- [Ðемного про переменные Ñреды](https://www.nylas.com/blog/making-use-of-environment-variables-in-python/); +- [Первое приложение на Django](https://docs.djangoproject.com/en/3.0/intro/tutorial01/); +- [Я в гитхабе](https://github.com/s3rius/). + +Примерный Ñрок выполнениÑ: `3 днÑ`; +Дата Ñдачи: `10.07.2020`. + +Ð”Ð¾Ð¿Ð¾Ð»Ð½Ð¸Ñ‚ÐµÐ»ÑŒÐ½Ð°Ñ Ð¸Ð½Ñ‚ÐµÑ€ÐµÑÐ½Ð°Ñ Ð¸Ð½Ñ„Ð°: +ЕÑли интереÑно поглубже разобратьÑÑ Ñ Ð²Ð¾Ð·Ð¼Ð¾Ð¶Ð½Ð¾ÑÑ‚Ñми гита можно поÑмотреть +на очень крутой интерактивный [Ñайтец](https://learngitbranching.js.org/?locale=ru_RU).