- fixed bug - forgot to validate random message settings on startup
- added code to allow those running a python version older than 3.10 (3.5 - 3.9) to NOT have to upgrade to 3.10 to get bot to work
- added
-n
and-h
options in thebuild_n_run.sh
script- new options are not mandatory
- if no options are chosen, then the default name for the image and container will be
shillbot
- this will allow you to run multiple bots via docker, if you so choose
- you can now get some help
./build_n_run.sh -h Usage: build_n_run.sh [OPTIONS] Options: -n STRING Name the image and running container -h Show help message
- and choose to name the image you will build and the container you will run
./build_n_run.sh -n bot1 ... => exporting to image 0.0s => => exporting layers 0.0s => => writing image sha256:abc123 0.0s => => naming to docker.io/library/bot1:latest ...
- fixed bug in dockerfile -- updated python version to 3.10
- it was using python version 3.9, but changes to how the event loop is created/managed in bot v0.20 is not compatible with 3.9
- just updated dockerfile to use
FROM python:3.10-alpine
- forgot to test dockerfile in bot v0.20 -- ran tests using local setup only
- add ability to manage the "random thank yous" via the config file vs in the code
- is now a long list in the
settings.example.yml
file - this is a breaking change, you will need to update your local config and code to get this to work
- more power to the user -- but becareful !!
... random_message_format: | lambda rm1, rm2 : rm1 + " & " + rm2 + "!" random_message: - Cheers - Thank you - Thank you so much ...
- is now a long list in the
- add ability to configure splay, with a default of 7 seconds
- instead of trying to auto-calculate this based on the number of channels
- more power to the user
... splay: 7 ...
- add ability to handle ChatWriteForbiddenError exception
- instead of failing completely for the channel, will instead sleep for 1 hour
- bug fix to ensure random thank yous are indeed random
- just adding some color to the output
- added ability to define the maximum number of messages sent to a channel
- option is
total_messages
- this allows a user to NOT SPAM a channel once they feel they have sent enough messages
- might help build/maintain their rep
- example:
channel_with_max_total: message_type: some_message wait_interval: 600 total_messages: 100 ...
- option is
- added a banner to the startup, maybe it will discourage wankers ?? doubt it
- added ability to define multiple message types per channel
- only one message will be sent per wait interval
- messages will be sent in the user defined order, so for the below YAML example, the order is:
some_message
, wait interval;some_other_message
, wait interval;some_awesome_message
, wait interval;- repeat
- example:
channel_with_many_message_types: message_type: - some_message - some_other_message - some_awesome_message wait_interval: 600 channel_with_one_message_type: message_type: some_message wait_interval: 600 ...
- broked out some code to be more pure
- added more schema validation to ensure
wait_interval
andincrease_wait_interval
are greater than 0, when defined - added more unit tests
- added
phone_number
as a required config option, thus cutting down on having to type it in during startup- example:
--- api_id: 123456 api_hash: abc123456YXZ app_short_name: SomeAppName phone_number: "+18888675309" ...
- added many more
settings.yml
validation tests, so startup will fail early if not config'ed properly- related to account settings, message settings, and raid settings
- added new possible exception error related to "message too long"
- added more verbose output when an unknown exception occurs
- only recalc wait interval if message is in a loop
- try and improve Telethon flood wait error handling
- mostly a developer upgrade
- added start of unit testing
- added new
Makefile
commands - added 1st go at YAML validation, both at the file load level and the actual data level
- using
jsonschema
here
- using
- refactored use of GLOBAL vars and cut down on those alot
- rolled
open file
bare method into function - functionized some complicated
getting
on some next Dicts - added FAIL message if simple YAML file can't even be loaded
- added
image
as a config option (not required), allowing users to send an image with their messages- example:
... # this example will send the "short" message and relative image "images/my-awhsum.jpg" # once every 10 minutues (600 seconds) somerandomchannelname: message_type: short wait_interval: 600 image: images/my-awhsum.jpg ...
- added
increase_wait_interval
as a config option, allowing users to gradually increase how frequent messages are sent to a channel- example:
... # this example will send a message once every 10 minutues (600 seconds) # after every iteration, 1 minute (60 seconds) will be added to the previous attempt's wait interval # so here is an example sequence of operations: # - 10m wait, send message, 10m + 1m = 11m # - 11m wait, send message, 11m + 1m = 12m # - 12m wait, send message, 12m + 1m = 13m # - etc, etc, etc somerandomchannelname: message_type: short wait_interval: 600 increase_wait_interval: 60 ...
- improved Telethon error handling
- refactored
channel
implementation
- refactored
splay
implementation
- added
splay
to connection and message calls to avoidFloodWaitError
errors
- added Telethon entity caching to avoid
FloodWaitError
errors
- added random
thank you
s to end of message to avoid getting banned
- added try/catch around
FloodWaitError
errors
- Hello, World!