https://github.com/xditya/accalia
Be like a lion and a wolf, then you have a big heart and the power of leadership
https://github.com/xditya/accalia
Last synced: 5 months ago
JSON representation
Be like a lion and a wolf, then you have a big heart and the power of leadership
- Host: GitHub
- URL: https://github.com/xditya/accalia
- Owner: xditya
- License: gpl-3.0
- Created: 2020-10-20T00:21:29.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2020-10-20T00:21:41.000Z (almost 6 years ago)
- Last Synced: 2025-02-24T00:41:38.691Z (over 1 year ago)
- Size: 366 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Accalia
Be like a lion and a wolf, then you have a big heart and the power of leadership
[](https://perso.crans.org/besson/LICENSE.html) [](https://github.com/ellerbrock/open-source-badges/) [](https://makeapullrequest.com) [](https://t.me/ApolloOfficial)
GENERATED FROM [THIS REPOSITORY](https://github.com/AnimeKaizoku/SaitamaRobot)
[]
[](https://heroku.com/deploy?template=https://github.com/Apollothewolf/Accalia.git)
## Credits
The bot is based on the original work done by [PaulSonOfLars](https://github.com/PaulSonOfLars)
This repo was just revamped to suit an Anime-centric community. All original credits go to Paul and his dedication, Without his efforts, this fork would not have been possible!
### Configuration
There are two possible ways of configuring your bot: a config.py file, or ENV variables.
The prefered version is to use a `config.py` file, as it makes it easier to see all your settings grouped together.
This file should be placed in your `tg_bot ` folder, alongside the `__main__.py` file .
This is where your bot token will be loaded from, as well as your database URI (if you're using a database), and most of
your other settings.
It is recommended to import sample_config and extend the Config class, as this will ensure your config contains all
defaults set in the sample_config, hence making it easier to upgrade.
An example `config.py` file could be:
```
from tg_bot.sample_config import Config
class Development(Config):
OWNER_ID = 254318997 # my telegram ID
OWNER_USERNAME = "SonOfLars" # my telegram username
API_KEY = "your bot api key" # my api key, as provided by the botfather
SQLALCHEMY_DATABASE_URI = 'postgresql://username:password@localhost:5432/database' # sample db credentials
MESSAGE_DUMP = '-1234567890' # some group chat that your bot is a member of
USE_MESSAGE_DUMP = True
SUDO_USERS = [18673980, 83489514] # List of id's for users which have sudo access to the bot.
LOAD = []
NO_LOAD = ['translation']
```
If you can't have a config.py file (EG on heroku), it is also possible to use environment variables.
The following env variables are supported:
- `ENV`: Setting this to ANYTHING will enable env variables
- `TOKEN`: Your bot token, as a string.
- `OWNER_ID`: An integer of consisting of your owner ID
- `OWNER_USERNAME`: Your username
- `DATABASE_URL`: Your database URL
- `MESSAGE_DUMP`: optional: a chat where your replied saved messages are stored, to stop people deleting their old
- `LOAD`: Space separated list of modules you would like to load
- `NO_LOAD`: Space separated list of modules you would like NOT to load
- `WEBHOOK`: Setting this to ANYTHING will enable webhooks when in env mode
messages
- `URL`: The URL your webhook should connect to (only needed for webhook mode)
- `SUDO_USERS`: A space separated list of user_ids which should be considered sudo users
- `SUPPORT_USERS`: A space separated list of user_ids which should be considered support users (can gban/ungban,
nothing else)
- `WHITELIST_USERS`: A space separated list of user_ids which should be considered whitelisted - they can't be banned.
- `CERT_PATH`: Path to your webhook certificate
- `PORT`: Port to use for your webhooks
- `DEL_CMDS`: Whether to delete commands from users which don't have rights to use that command
- `STRICT_GBAN`: Enforce gbans across new groups as well as old groups. When a gbanned user talks, he will be banned.
- `WORKERS`: Number of threads to use. 8 is the recommended (and default) amount, but your experience may vary.
__Note__ that going crazy with more threads wont necessarily speed up your bot, given the large amount of sql data
accesses, and the way python asynchronous calls work.
- `BAN_STICKER`: Which sticker to use when banning people.
- `ALLOW_EXCL`: Whether to allow using exclamation marks ! for commands as well as /.