diff --git a/motd b/motd index 7fc5f7f..473ef85 100644 --- a/motd +++ b/motd @@ -5,7 +5,7 @@ █ ▄ █ ▄▄▄█ ▄▄▄█ ▄ ██ █▄▄▄█ ▄▄▄█ █ █ █ █ █▄▄▄█ █▄▄▄█ █▄█ █ █ █▄▄▄ █▄█ █▄▄█▄▄▄▄▄▄▄█▄▄▄▄▄▄▄█▄▄▄▄▄▄▄█▄▄▄▄▄▄▄█▄▄▄▄▄▄▄█ -Neeble version: 2023.09.18 +Neeble version: 2023.09.25 Help with the development of neeble-bot in https://brejela.club/gitea/neeble-club/neeble Thank you! diff --git a/utils/commands.py b/utils/commands.py index de76a34..a586056 100644 --- a/utils/commands.py +++ b/utils/commands.py @@ -21,22 +21,35 @@ from utils.weather import displayweather, getweatherdata client = commands.Bot(command_prefix='--', intents=Intents.all()) +# This defines how big Neeble's quote "memory" is. If --rq is called, the quotes in the stack are removed from the query stack_limit = int((count_quotes() * .25)) +# When starting the bot for the first time, repetitions are going to be common. If ,after a couple hundred saved quotes, the +# bot gets restarted a lot, the stack would reset and quotes would repeat themselves a lot more. Saving the stack on disk +# prevents repeating quotes in between restarts with open(QUOTE_STACK, mode='r') as f: quote_id_stack = json.load(f) +# Leaderboards must never be reset with the bot. with open(RQ_LEADERBOARD, mode='r') as f: rq_leaderboard = json.load(f) +# This dictionary is used to save the last message of all users in the server, used in `on_message(message)` +# which in turn is used in `grab_quote(bot: object)` quote_content = {} +# Some commands (e.g. --roulette) cannot process two calls at the same time, comlock (or "command lock") serves as a way to make all affected commands wait. +# This MAY become a dictionary in the future, where keys are commands and values are "True" or "False" comlock = {'roulette': False } +# Used in `roulette(bot: object)` drum = [] chamber = -1 +# last_rq is a dictionary that keeps track of each user's --rq call; Sorting that dictionary by time everytime --rq is called _would_ be possible, +# but it would scale poorly, that's why last_rqer exists. rq_abusers is a dictionary that keeps track of how many failed --rq attempts each user has. +# After three "Chill.", --rq stops responding last_rq = {} last_rqer = '' rq_abusers = {}