A Telegram bot for personal utilities

Overview

Aqua

Aqua is a Telegram bot for personal utilities.

Installation

  1. Prerequisites: Install Poetry for managing dependencies and fork/clone the repository. All commands and files below will assume you are at the project's root directory.
  2. Create your Telegram bot by speaking to Botfather.
  3. Rename config/db.example.json and config/bot.example.json respectively to config/db.json and config/bot.json. Also, replace the data in those files with your actual data:
    • config/db.json is not currently used for anything, though that may change in the future.
    • In config/bot.json: The token is provided to you by the Botfather.
    • In config/bot.json: The user_chat_id is optional and you may delete it completely if you don't want Aqua to perform authorization checks, in which case she will answer to anyone who messages her. If you do want Aqua to only answer to you but you don't know your user_chat_id, perform the next steps and you will be instructed on how to find it out.
  4. Create a virtual environment and install dependencies by running $ python3 -m venv .venv and $ poetry install.
  5. Ensure you are using the local Python with $ poetry shell and then run $ aqua to start the bot.
  6. Coming back to step 3, if you don't yet know your user_chat_id, run Aqua as described in step 5 and send her a /start message, then check your terminal. You should see a message that begins like this: WARNING - Received a message from 'XYZ', but user_chat_id is None. XYZ is your user_chat_id.

As far as using Aqua, that's all there is to installation. If you are interested in modifying the source code, check extra development instructions in CONTRIBUTING.md file.

Available commands

All commands below can be abbreviated (e.g. you can use /lo instead of /lorem) as long as your abbreviation is not ambiguous.

  • /lorem: generates one paragraph of Lorem Ipsum text.
  • /remindme <time> <time_unit> <message>: reminds you about <message> after the given amount of time. Example: /remindme 10 minute Get pizza in the oven will remind you about the pizza in about 10 minutes.
  • /sort <list_of_elements>: sorts your list. If all the elements are numbers, they will be sorted numerically, else alphabetically. Example: /sort 5 2 1 or /sort myword1 second_word.
  • /start: sends a "welcome" message. This can be useful to check if you have set up everything correctly.

More commands will be added soon!

License

Copyright 2021 Guilherme-Vasconcelos

Aqua is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Aqua is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with Aqua. If not, see https://www.gnu.org/licenses/.

Comments
  • Remindme command

    Remindme command

    • [x] Jobs queue: verifies once a minute for tasks to be executed. Optionally, save the queue to a file to ensure bot can still execute tasks even if server fails for a while.
    • [x] Command: /remindme
    enhancement 
    opened by Guilherme-Vasconcelos 1
  • Bump ansi-regex from 4.1.0 to 4.1.1

    Bump ansi-regex from 4.1.0 to 4.1.1

    Bumps ansi-regex from 4.1.0 to 4.1.1.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump minimist from 1.2.5 to 1.2.6

    Bump minimist from 1.2.5 to 1.2.6

    Bumps minimist from 1.2.5 to 1.2.6.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Add isort and black

    Add isort and black

    Describe your idea https://github.com/psf/black https://github.com/PyCQA/isort

    Also remember to add recommended vscode extensions

    Also remember to ensure black's config is compatible with flake8 (or remove flake8 completely), then adapt github action workflow accordingly

    https://code.visualstudio.com/docs/python/editing#_sort-imports

    enhancement 
    opened by Guilherme-Vasconcelos 0
  • Adapt GitHub Actions to use Poetry

    Adapt GitHub Actions to use Poetry

    Describe your idea Adapt GitHub Actions to use Poetry and then remove requirements.txt (also remove from CONTRIBUTING.md). Also merge bandit workflow to run in the same workflow as lint/test.

    enhancement 
    opened by Guilherme-Vasconcelos 0
  • /whatis command

    /whatis command

    Describe your idea Gives you the definition of a certain text.

    Extra information Maybe get the information from Wikipedia: https://foundation.wikimedia.org/wiki/Terms_of_Use/en https://www.mediawiki.org/wiki/API:Search https://www.mediawiki.org/wiki/API:Main_page https://www.mediawiki.org/wiki/Extension%3aTextExtracts#API

    enhancement high priority 
    opened by Guilherme-Vasconcelos 0
  • Add decorator to easily specify number of arguments

    Add decorator to easily specify number of arguments

    Describe your idea Instead of manually checking number of arguments in each function, add a decorator.

    @num_args(0)
    @authorize
    def start(...):
        ...
    

    Extra information There are some edge cases:

    • Some functions require any number of arguments
    • However, some functions can accept a variable number of arguments but require a minimum (such as remindme, which requires at least 3)
    • Suggestion:
      • Omitting @num_args means any number of arguments
      • @num_args(X) means exactly X arguments
      • @min_num_args(X) means at least X arguments
      • @max_num_args(X) means at most X arguments
    enhancement high priority 
    opened by Guilherme-Vasconcelos 0
  • Improve the pre-commit hook

    Improve the pre-commit hook

    Describe your idea The current pre-commit hook (located at hooks/pre-commit) is not completely reliable because it doesn't check for tricks such as:

    • Commented authorize;
    • authorize inside string

    For instance, these two snippets would be considered OK to the current pre-commit hook:

    # @authorize
    def start(...):
        ...
    
    '@authorize'
    def start(...):
        ...
    

    The task is to create a pre-commit hook that actually checks:

    • If all command handlers (i.e. files in aqua/extensions/commands) and the talk handler (aqua/extensions/talk/talk.py) are actually using a valid authorize (the authorize must be present, correctly placed and not inside a string or comment);
    • If all command handlers are described in the /help command: aqua/extensions/commands/help.py;

    Extra information

    • If the new pre-commit hook is not written in bash, remember to update the GitHub workflow accordingly (.github/workflows/pre-commit.yml).
    • Only the function that has the same name as the file needs an authorize (because that's the function which is executed by the bot). For example, the function def start(...) needs an authorize if it is located inside the start.py file.
    • Internal functions (those which begin with _ such as /_invalid, which is to be merged in command-abreviations branch) should not be documented in /help or README, though they must still have an authorize.
    • https://docs.python.org/3/library/ast.html + https://docs.pytest.org/en/6.2.x/ (possibility of writing tests and using AST to verify decorators. With this it is no longer required to have a pre-commit hook. These tests will act as some kind of static analysis.)
    enhancement high priority 
    opened by Guilherme-Vasconcelos 0
  • Possibility of using unambiguous abbreviations for commands

    Possibility of using unambiguous abbreviations for commands

    Describe your idea E.g. use the command /l instead of /lorem. If there are more commands that begin with l, the user should type at least the minimum required for it to be identified as a shortened version of lorem.

    Extra information Maybe a way to implement would be to create at startup time all the unambiguous abbreviations of all the methods, for instance: l, lo, lor, .... And the ambiguous abbreviations would all be a copy of some /_ambiguous_method command.

    enhancement 
    opened by Guilherme-Vasconcelos 0
  • Bump minimatch from 3.0.4 to 3.1.2

    Bump minimatch from 3.0.4 to 3.1.2

    Bumps minimatch from 3.0.4 to 3.1.2.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Create a client to talk to Aqua

    Create a client to talk to Aqua

    Describe your idea Currently Aqua requires you to log into Telegram, manually create your bot, manually set its token, etc.

    It would be cool to have a client that does all this automatically (to allow you to talk to Aqua more easily): you log into it, then it will create the bot and put it up running for as long as the client is running, and then open Aqua's chat. This way Aqua would actually become user friendly as the user would not need to modify its config and run it manually.

    Since the objective is to allow the user to talk to Aqua more easily, the client will only have Aqua's chat.

    Extra information The client could be a fork of https://github.com/telegramdesktop/tdesktop.

    Probably create it in a different repo.

    Before implementing this, read Telegram's client and API TOS to ensure this idea complies with everything.

    enhancement low priority 
    opened by Guilherme-Vasconcelos 0
  • When an ambiguous abbreviation is used, show available options

    When an ambiguous abbreviation is used, show available options

    Describe your idea Currently, when the user uses some ambiguous abbreviation (such as /s, which could be /start or /sort), Aqua will warn them about it being invalid but will not say the available options.

    enhancement low priority 
    opened by Guilherme-Vasconcelos 0
  • Add persistence to Job Queue

    Add persistence to Job Queue

    Describe your idea Job Queue is currently lost if Aqua turns off. While this isn't a problem for reminders that are only a few minutes after, it may be a problem for reminders scheduled to hours/days later.

    Extra information Suggestion: create a dump file once at the end of the JobQueue loop using pickle: https://docs.python.org/3/library/pickle.html

    Maybe use inspect.getsource: https://stackoverflow.com/questions/12072252/cant-get-source-code-for-a-method-declared-through-exec-using-inspect-in-pyth

    Alternatively, instead of each Job having a function to be executed, they could have a type instead (e.g. send_message type), which are easier to store / load.

    enhancement low priority 
    opened by Guilherme-Vasconcelos 0
  • Message notifications

    Message notifications

    Describe your idea Aqua needs a message notifications system to send messages to the user without necessarily them being an answer to something. This could be useful e.g. for some important news, custom alerts at specific times of the day, etc.

    Extra information

    1. Job Queue can probably be used to implement it (maybe create some permanent flag for each job. If the job is permanent, then it will always be re-enqueued. Then create some initializer to populate the job queue with the message notifications).
    2. Add a config/message_notifications.json file in which user will be able to pick the notifications they want to receive.
    enhancement medium priority 
    opened by Guilherme-Vasconcelos 0
Releases(v0.1.0)
Owner
Guilherme Vasconcelos
Guilherme Vasconcelos
A QQ(Tencent) robot created by go-cqhttp & nonebot2

绘梨花(胶布)Bot|ErikaBot ✨ 基于NoneBot2的绘梨花多功能 Bot ,自用 ✨ 快速开始 参考go-cqhttp项目文档,配置好机器人的相关设置,以及反向ws客户端 参考nonebot2项目文档,添加必要的.env相关设置 安装本项目相关的依赖库(依赖清单) git clone本

10 Aug 09, 2022
WhatsApp API Python ChatBot

WhatsApp Api Python - Esta documentação tem como objetivo exemplificar o uso do Moorse Whatsapp API na linguagem Python.

Douglas Alves 2 Jan 06, 2022
Role Based Access Control for Slack-Bolt Applications

Role Based Access Control for Slack-Bolt Apps Role Based Access Control (RBAC) is a term applied to limiting the authorization for a specific operatio

Jeremy Schulman 7 Jan 06, 2022
A discord bot wrapper for python have slash command

A discord bot wrapper for python have slash command

4 Dec 04, 2021
Python bot for send videos of a Youtube channel to a telegram group , channel or chat

py_youtube_to_telegram Usage: If you want to install ytt and use it, run this command: sudo sh -c "$(curl -fsSL https://raw.githubusercontent.com/nima

Nima Fanniasl 8 Nov 22, 2022
An attempt to escape the horrible JIRA editor.

An attempt to escape the horrible JIRA editor. jira_filter.py is a pandoc filter that cleans up some of JIRA's html so that it can be converted to Mar

Stefan Matting 2 Feb 10, 2022
An Python SDK for QQ based on mirai-api-http v2.

Argon 一个基于 graia-broadcast 和 mirai-api-http v2 的 Python SDK。 本项目适用于 mirai-api-http 2.0 以上版本。 目前仍处于开发阶段,内部接口可能会有较大的变化。 The Stasis / 停滞 为维持 GraiaProject

BlueGlassBlock 1 Oct 29, 2021
A multi exploit instagram exploitation framework

Instagram Exploitation Framework About IEF Is an open source Instagram Exploitation Framework with various Exploits that could be used to mod your pro

Instagram Exploitation Framework - BirdSecurity 1 May 23, 2022
📷 An Instagram bot written in Python using Selenium on Google Chrome

📷 An Instagram bot written in Python using Selenium on Google Chrome. It will go through posts in hashtag(s) and like and comment on them.

anniedotexe 47 Dec 19, 2022
Bot facebook

botfb Bot facebook Login via cookies cara install $pkg update && pkg upgrade $pkg install git python $git clone https://github.com/Ainx-BOT/botfb $cd

Fahmi Dev 12 Dec 18, 2022
Console BeautifulDiscord theme manager

BeautifulDiscord theme manager Console script for downloading & managing Discord .css themes via BeautifulDiscord. Setup Simply run # Linux/MacOS pip3

1 Dec 15, 2022
This bot will automatically like and follow users that post under a specified hashtag

Instagram-bot This bot will automatically like and follow users that post under a specified hashtag Dependencies Java JDK Selenium Updated version of

Makana Edwards 1 Nov 04, 2021
A repo to automate the booking process for vaccinations

OntarioVaccineFormAutomaker A repo to automate the booking process for vaccinations Requirements Allow ALL sights to be able to know your location (on

Rafid Dewan 7 May 31, 2021
Dodo - A graphical, hackable email client based on notmuch

Dodo Dodo is a graphical email client written in Python/PyQt5, based on the comm

Aleks Kissinger 44 Nov 12, 2022
Web3 Pancakeswap Sniper & honeypot detector Take Profit/StopLose bot written in python3, For ANDROID WIN MAC & LINUX

Web3 Pancakeswap Sniper & honeypot detector Take Profit/StopLose bot written in python3, For ANDROID WIN MAC & LINUX

HYDRA 3 Dec 27, 2021
Random-backlog-tweet - Pick a page from a sitemap at random and prep a tweet button for it

Random-backlog-tweet - Pick a page from a sitemap at random and prep a tweet button for it

Paul O'Leary McCann 0 Dec 01, 2022
Design and build a wrapper for the Open Weather API current weather data service

Design and build a wrapper for the Open Weather API current weather data service that returns a city's temperature, with caching, also allowing for the temperature of the latest queried cities that a

Duan Rafael Ribeiro 1 Jun 27, 2022
A Bot to get RealTime Tweets to a Specific Chats from Desired Persons on Twitter to Telegram Chat.

TgTwitterStreamer A Bot to get RealTime Tweets to a Specific Chats from Desired Persons on Twitter to Telegram Chat. For Getting ENV's Refer this Link

Anonymous 69 Dec 20, 2022
Bearer API client for Python

Bearer Python Bearer Python client Installation pip install bearer Usage Get your Bearer Secret Key and integration id from the Dashboard and use the

Bearer 9 Oct 31, 2022
Python library to interact with a Z-Wave JS server.

zwave-js-server-python Python library for communicating with zwave-js-server. Goal for this library is to replicate the structure and the events of Z-

Home Assistant Libraries 54 Dec 18, 2022