A modularized bot for Tinychat. WIP AF Note while the bot works as of 10/31/2019, this project is no longer being actively maintained. Feel free to fork and learn from it.
Quantum relies on Python 3.7+ and only 3.7+ any version less and it probably won't work. It's advised to copy default.toml
and rename it. Current options are bot.py -h,-c,-l
; --help, --config, --logging respectively.
Run the bot with the following:
python3 bot.py -c your_config.toml
-c
and -l
are both optional, without -c
the bot will load default.toml
Available log levels are:
i
- Infoc
- Chatws
- WebSocketw
- Warninge
- Error The default log level isi
- Info
Note: if your configuration is missing anything it needs then the bot will break maybe
Via make $opt
:
base
- websockets requests tomlkit (default for make)extras
(modules) - bs4 anticaptcha isodate wikipediabaseextras
- both base and extras dependencies will be installedwebcam
(win32 may not work) - aioice aiortcall
- all of the above Note:webcam
requires some extra headers to build, will sort out which and list then later
Information on implementing new modules can be found in: Modules
A table of commands for each module can be found in: Commands
This document is divided into sections the same as default.toml
username
- TC account usernamepassword
- TC account password
nickname
- Nickname for the botrooname
- Room to joinpassword
- Room password, if any
prefixes
- Prefixes for the commands, e.g.!command
or.command
, multiple prefixes are allowedchat_level
- TODOmessage_limit
- maximum number of messages to send in response. Say the bot's reply is an essay, it will break that essay up into message sizes TC allows, but only send this many messagesmodules
- Modules to be loaded, each module and it's source can be found in the modules directory. Comment with#
to disable the module, remove#
to enable it. All modules are optional.
Discord has it's own section because it contains a lot of options, most likely even more to come.
channel
- The channel ID to send messages to. Not compatible withuse_webhook
use_webhook
- Enable/Disable the use of discord webhooks. Not compatible withchannel
webhook_url
- URL the Discord channel's webhook (See: Intro To Webhooks)include_avatar
- Optionally add the user's avatar to the webhook messagebot.username
- Username the bot will use when posting to the webhookbot.icon_url
- Icon the bot will use when posting to the webhook (default is the Tinychat logo)bot.message
- Message that will be posted to the webhook, It will be formated with{option}
. List of available options to format will come, eventually
vip_enabled
- TODOkick_as_ban
- Don't ever ban, only kick
WARNING: Autourl can and will reveal the bot's IP address by posting it in the room. This is not an issue for those who run the bot on a remote server, but certainly something to be aware of when running from home. To be honest this is unavoidable, if you think you've sorted out a way to prevent it from happening then feel free to make a pull request. Use with discretion.
pattern
- regular expression pattern to use when matching URLs from messages. Be sure to escape charactersexclusion_char
- Leave blank to look up every URL, otherwise if the exclusion_char is found at the beginning of the URL the module will not look up the title for said URLignores
- A list of domains/things to ignore. URLs posted by the bot and with theplay
command are ignored already. Supports regular expressions.
key
- the API key for AntiCaptcha (see: AntiCaptcha)
key
- the API key for Food2fork (see: Food2fork API)
fancydice
- use unicode dice (⚀ ⚁ ⚂ ⚃ ⚄ ⚅) only applies to 6 sided die8ballcustom
- list of custom 8ball replies to add to "official" repliesenablerate
- enable/disable therate
command
key
- the API key for The Movie Db (see: The Movie Database API)include_url
- include the iMDb URL in the reply
hourly_420
- enable/disable hourly 4:20 notifications
sentences
- number of sentences to pull from wikipedia summarylanguage
- language to use, requires the ISO code. (see: Wikipedia Supported Languages)url
- enable/disable appending the URL for the wikipedia page
key
- Youtube Data API key, optional if you choose to use your own APIplaylist_max
- Maximum amount of videos to add from a playlist (current is 50 until the API is paginated)
@autotonic
for big brain
@tech
design and code review
xbc4000
for the name