Mortybot is a fun bot with a bunch of utilities and features stolen from other bots that eventually became paid or just lacked the experience me and my friends wanted in our groups.
It is also inspired by other bots I've seen in the wild during my work experiences and past implementations.
This bot is available in Telegram as @MortyBot and it works in multiple groups. Keep in mind that a select group of me and my friends own this instance and manage the data accordingly.
Commands to get information about the International Space Station location.
-
/iss: Show the prediction for the next 3 days of watchable iss passes into the informed location. Example: /iss -20.316839,-40.309921
Commands to filter messages and react with other messages to it.
-
/filters: List all filters -
/filterowners[aliases: filterinfo]: List filters with owner info -
/add_filter[aliases: filter]: Adds a new filter -
/add_loud_filter[aliases: loud_filter]: Adds a new loud filter. -
/stop_filter: Stops listening to an existing filter -
/activate_filter: Starts listening to an existing filter -
/delete_filter: Deletes a filter permanently -
/filterownercount: Count of filters per owner -
/toggle_case_sensitive_filters: Toggles case sensitiviness for filters in this chat.
-
message:text: This listener checks and replies messages that match defined filters
Commands to suggest bars or restaurants.
-
/suggest: Gives a suggestion of bars or restaurants within the range of a mentioned location point
Commands to manage chat settings. Invoke admins, report messages, get the chat_id, set the chat title, get file urls and more.
-
/set_title[aliases: batiza]: Sets the chat title. Only works if the bot is a chat admin. -
/report[aliases: admin]: Pings the group admin about the replied message. -
/chat_id[aliases: id]: Gets the chat id. -
/get_file[aliases: get_sticker]: Gets the file and url from a sticker, video note or gif. -
/create_command_alias[aliases: cmd, alias]: Create a command alias.
Commands to get information about the cameras of the roads of Espírito Santo. (deprecated since Rodosol is not supplying these anymore)
-
/rodosol_now: Fetch Vila Velha's Rodosol Road camera pictures now. -
/tp_now: Fetch Vila Velha's Third Bridge camera pictures now.
Commands to calculate math expressions, exchange rates, metrics and more.
-
/calc[aliases: calculate]: Evaluates a math expression and gives you the result.
Commands to create meme templates, memes and other image-related tasks. See https://mortybotui.fly.dev to see the available meme templates and how to create more. Meme templates are defined per user or group.
-
/create_meme_template[aliases: memetemplate]: Creates a meme template based on a given image and text parameters. -
/create_meme[aliases: meme]: Creates a meme based on a template. The number of arguments depends on the template itself. -
/get_meme_template: Get meme template by name. Useful for debugging purposes. -
/toggle_meme_template_debug[aliases: debugtemplate]: Toggle meme template debug mode (adds a red border to the slots).
Commands related to searching and serving data from radar.squat.net through their api.
-
/squatevents: Gets the next 20 events from radar.squat.net based on the city provided.
Ranks the group members by the amount of times they left the group.
-
/leaving_rank[aliases: quemsaiudogrupo]: Ranks the group members by the amount of times they left the group.
-
:left_chat_member: This listener checks when someone leaves the group and adds to a counter
Commands to get weather information.
-
/forecast[aliases: previsao]: Brings forecast for us -
/temperature[aliases: temp]: Brings temperature for us
Commands that convert text into funny characters.
-
/funtext[aliases: fun, funtxt, kawaii]: Converts a text string into funny characters. -
/crazytext[aliases: crazify, crazytxt]: Converts a text string into crazy characters. -
/telugutext[aliases: telugu, telugutxt]: Converts a text string into telugu characters. -
/decodetelugutext[aliases: decodetelugu]: Decodes telugu characters.
Commands to list, join and leave hashtag channels.
-
/join_hashtag: Join hashtag channel and get notified. Example: /join_hashtag #games -
/leave_hashtag: Leave a hashtag channel. Example: /leave_hashtag #games -
/list_hashtags[aliases: hashtags]: List all hashtags in the group. Usage: /list_hashtags or /hashtags
-
message:text: Listens to a hashtag and mentions the people registered on it.
Commands to convert currencies.
-
/convert: Convert a value in one currency to another. -
/dolar: 1 USD to BRL -
/euro: 1 EUR to BRL
Commands to get info on tax reports, income reports, etc.
-
/get_income_report[aliases: thetax, tax]: Usage: /get_income_report income=36000&ruling=true
Make sure you have Git and Deno 1.31+ available in your local environment.
# clone repository
git clone https://github.com/armand1m/mortybot.git
# cd into it
cd ./mortybot
# make sure you have deno installed
which deno
# make sure you're on 1.31+
deno --versionYou must have a Telegram Bot Token created by the Bot Father. Once you have that, run the following command with your bot token:
cat > ./.env <<EOL
BOT_TOKEN=0000000000:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
EXCHANGE_API_TOKEN=AAAAAAAAAAAAAAAAAAAAAAAA
OPENWEATHERMAP_API_TOKEN=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
DATA_PATH=./data
MESSAGE_TIMEOUT_ENABLED=true
MESSAGE_TIMEOUT_IN_MINUTES=2
EOLNow you should be able to run the bot:
deno task devFollow the same configuration step for development, but first override your .env with this:
cat > ./.env <<EOL
BOT_TOKEN=0000000000:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
EXCHANGE_API_TOKEN=AAAAAAAAAAAAAAAAAAAAAAAA
OPENWEATHERMAP_API_TOKEN=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
DATA_PATH=./data
MESSAGE_TIMEOUT_ENABLED=true
MESSAGE_TIMEOUT_IN_MINUTES=2
EOLand run it with deno:
deno task startYou probably want to use a process manager like systemd.
This bot is published publicly as a Docker Image, so you should be able to run it anywhere you can run a Docker Container.
To run it locally, just run the following:
# create a volume to persist data
docker volume create mortybot_data
# (optional) build image from source
docker build . -t armand1m/mortybot
# run the container
docker run \
-e BOT_TOKEN="your-bot-token-here" \
--mount source=mortybot_data,target=/app/data \
armand1m/mortybotThis bot is published in https://fly.io
The CI will take care of publishing the last main branch state into the official bot release.
Publishing it in your instance should be easy:
# get credentials
fly auth login
# set bot token from @BotFather as a secret
#
# secrets in fly are automatically added to
# the instance as env vars with the same name
fly secrets set BOT_TOKEN=123123123:32132132131312
# create a volume to hold persistent group data
# 1gb is more than enough.
fly vol create mortybot_data -s 1
# ship it
fly deployRefer to https://fly.io docs for more details on other commons operations.