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 AntiChannelBan Telegram Group Bot Open Source

AntiChannelBan This is a Anti Channel Ban Robots delete and ban message sent by channels Deployment Method Heroku 𝚂𝚄𝙿𝙿𝙾𝚁𝚃 CREDIT BrayDen Blaze

✗ BᵣₐyDₑₙ ✗ 14 May 02, 2022
Host your Python Discord Bot 24/7 for free. POC

🐉 Pandore 🐉 The easiest and fastest way to host your Python3 Discord Bot 24/7 for free! 📚 Documentation 📚 If you encounter any problem while using

Billy 73 Jan 02, 2023
A continued fork of Disco

Orca Orca is an extensive and extendable Python 3.x library for the Discord API. orca boasts the following major features: Expressive, functional inte

RPS 4 Apr 03, 2022
🤖 Fast and simple bot to transform links from Amazon into a nice post with your referral link in Telegram 🛒

AmazonBot 🤖 Fast and simple bot to transform links from Amazon into a nice post with your referral link in Telegram 🛒 Prerequisites You need Python

Alternative Profit 3 Dec 25, 2022
Repository for the IPvSeeYou talk at Black Hat 2021

IPvSeeYou Geolocation Lookup Tool Overview IPvSeeYou.py is a tool to assist with geolocating EUI-64 IPv6 hosts. It takes as input an EUI-64-derived MA

57 Nov 08, 2022
A Discord bot coded in Python

Perseverance-Bot By Toricane Replit Code | GitHub Code | Discord Server | Website Perseverance is a multi-purpose bot coded in Python. It has moderati

4 Mar 30, 2022
Compares and analyzes GCP IAM roles.

gcp-iam-analyzer I wrote this to help in my day to day working in GCP. A lot of the time I am doing role comparisons to see which role has more permis

Jason Dyke 37 Dec 28, 2022
Telegram bot for logistic - Telegram bot for logistic

Демонстрационный телеграм-бот для нужд транспортной компании Цель проекта Реализ

M1chigun 1 Feb 05, 2022
Twitter-bot - A Simple Twitter bot with python

twitterbot To use this bot, You will require API Key and Access Key. Signup at h

Bentil Shadrack 8 Nov 18, 2022
Discord-disnake - This package allows to use disnake without changing the discord namespace

This package is a shim This module allows to use disnake using discord namespace. This is not an independent library. Installing Python 3.8 or higher

5 Dec 13, 2022
Easy to use phishing tool with 63 website templates. Author is not responsible for any misuse.

PyPhisher [+] Created By KasRoudra [+] Description : Ultimate phishing tool in python. Includes popular websites like facebook, twitter, instagram, gi

KasRoudra 1.1k Jan 01, 2023
提供火币网交易接口API最简封装,提供现货买入、卖出、huobi币安查询账户余额等接口,数字货币,虚拟货币,BTC量化交易框架,自动交易,轻量便携,不用安装,即开即用

火币网交易接口的最简封装(只管用,不用再关注细节) 提供火币网交易接口的python封装,提供买入、卖出、查询账户余额等接口 接口说明 order_value() 进行买入操作,参数为买入的币和买入的金额 买入返回的详情数据: {'单号': '272229546125038', '成交数量': 0.

dev 95 Sep 24, 2021
A Discord Rich Presence App to set your own custom rich presence.

discord-rich-presence A Discord Rich Presence App to set your own custom rich presence. #BUILDS Ready to use package are available inside "finalpackag

1 Nov 22, 2021
The official Python library for the Plutto API

Plutto Ruby SDK This library will help you easily integrate Plutto API to your software, making your developer life a little bit more enjoyable. Insta

Plutto 3 Nov 23, 2021
Python script to scrape users/id/badges/creation-date from a Discord Server Memberlist

Discord Server Badges Scraper - Credits to bytixo he made this Custom Discord Vanity Creator How To Use Install discum 1.2 Open a terminal and execute

apolo 13 Dec 09, 2022
Project glow is an open source bot worked on by many people to create a good and safe moderation bot for all

Project Glow Greetings, I see you have stumbled upon project glow. Project glow is an open source bot worked on by many people to create a good and sa

Glowstikk 24 Sep 29, 2022
Spotify Web API client for Python 3

Welcome to the GitHub repository of Tekore! We provide a client for the Spotify Web API for Python, complete with all available endpoints and authenti

Felix Hildén 186 Dec 22, 2022
Backend for Indipe client

Betsushi Betsu (別), the japanese word meaning "another" and Shiharai (支払い) meaning "payment". Hence the name Betsushi was derived. Introduction This i

Sudodevs 3 Feb 09, 2022
Portal Backend for Yuta management

Portal Backend for Yuta management Prerequisites Python 3.10 or above. pip, pdm installed. Quickstart Install the required packages: pdm install Runn

Loc Mai 1 Dec 20, 2021
Step by Step Guide To Install Discord Py Master Branch on Replit

Guide to Install Discord Py Master Branch on Replit Step 1 Create an empty repl on replit Step 2 Add this Basic Code to the file main.py so as to chec

Pranav Saxena 7 Nov 18, 2022