You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
2 years ago | |
---|---|---|
cfg | 2 years ago | |
resources | 2 years ago | |
src | 2 years ago | |
storage | 5 years ago | |
.gitignore | 5 years ago | |
Dockerfile | 5 years ago | |
README.md | 5 years ago | |
docker-compose.yml | 2 years ago | |
requirements.txt | 3 years ago | |
run.py | 6 years ago |
README.md
My great plan is to create a Telegram chat bot that would be like shizoid, but in Python and maybe with some extra features.
A-a-a-a-and... it works (@ImaginaryFriendBot)! Thanks to @REDNBLACK.
Features
ImaginaryFriend can:
- reply to random messages in chat groups,
- reply to replies to its messages / messages mentioning it,
- send (one!) sticker ("I'm frustrated by all these stickers"),
- detect repeating media files and send [:||||||||||||:] to chat,
- do some commands.
Examples
– @ImaginaryFriendBot один ты меня понимаешь
– Ты глупый кот. Меня зовут антон иванов, мне только что поймала ту же пустоту.
– привет, Антон
– Привет!
– оч приятно, Антон. Я Боря
– Я не знаю юридических тонкостей но по факту квартира же твоя! Боря кот. Оч приятно антон.
– Чем ты занимаешься, ты юрист?
– Ты не видишь чтоль?
– Ну извини, решил уточнить. Как дела то?
– Как дела с потоками в яве обстоят? Ну ты понел. Дела отлично, а твои как?
– Нет. У меня друг в дестве кусался.
– он тебя загрыз?
– Он же говна кусок.
– тебя загрыз кусок говна?
– Тебя наверх задрать надо.
– ты сегодня особо в тему пишешь, что с тобой, ты поумнел?
– Что бы крашилось :3?
– да ты суицидник XD
– Ты не очень умный?
– годный бот
– Бот захватит мир.
Commands
/ping
: you know the drill,/get_stats
: get information on how many pairs are known by ImaginaryFriend,/chance n
: set the probability that ImaginaryFriend would reply to a random message (must be in range 1-50, default: 5),/сhance
: get current probability that ImaginaryFriend would reply to a message,/mod_f pattern
: find all the words starting with pattern,/mod_d word
: remove word from ImaginaryFriend's dictionary,/meow
,/woof
,/borscht
,/boobs
,/butts
and others: make ImaginaryFriend send a corresponding picture,/vzhuh phrase
: make ImaginaryFriend create a вжух meme.
Installation and Setup
Setup using Docker
- Install Docker
- Open
cfg
dir and renamemain.docker.cfg.example
tomain.docker.cfg
. - Talk to @botfather and create your own bot.
- Open
main.docker.cfg
file in text editor, paste your newly created bot token intobot
.token
property and your bot name (with Bot postfix) intobot
.name
property. - Execute
docker-compose up
. Congrats! You now have ImaginaryFriend of your own!
Setup without Docker
- Install Python >= 3.5.2
- Install Redis >= 3.2
- Install dependencies with PIP by executing command
pip install -r requirements.txt
- Open
cfg
dir and renamemain.plain.cfg.example
tomain.plain.cfg
- Talk to @botfather and create your own bot.
- Open
main.plain.cfg
file in text editor, paste your newly created bot token intobot
.token
property and your bot name (with Bot postfix) intobot
.name
property. - (Optionally) Configure
updates
property for websocket support andredis
property to point to your Redis instance. - Execute the
python run.py