Changelog¶
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
If you are reading this on GitHub, you may consider switching to the docs to benefit Sphinx internal links to Python objects: https://lg-rez.readthedocs.io/fr/2.2.0/changelog.html
2.2.0 - 2021-10-06¶
Added¶
New command
!modifto edit a bot message;New commands table in
lgrez.featuresdoc page;New convenience method
blocs.env.__getattr__().
Changed¶
Extended to Python 3.10
Bumped all requirements to their latest version
Fixed¶
Diverse documentation fixes.
2.1.4 - 2021-07-10¶
Changed¶
!lorecan now replace@role_slug(config.Roleattributes only) with role mention;!doascan now act for players that left the server (limited range);Database host and name is now printed at bot startup;
.gitignorenow ignores allstart_bot*.pyfiles.
Fixed¶
!open/!close: new safety check to avoid double opening/closing;Added
config.is_readyto avoid doubleLGBot.on_ready()calls;Added unique constraint to
bdd.Role-bdd.BaseActionjunction table to avoid duplicate rows;!boudoir: dead players could create some and sometimes write messages in;!loredid not correctly detect some docs ID;!loreformatting failed on some specific cases (e.g bullet lists + italic);!action:bdd.UtilEtat.rempliewas sometimes used istead ofbdd.UtilEtat.ignoree;Fixed fatal errors on
blocs.tools.private()commands warning messages,features.voter_agir.get_cible(),!infos, and role creation detection (if missing required roles);Bumped dependencies security upgrades.
2.1.3 - 2021-04-26¶
Changed¶
!boudoir:inviteandexpulsenow take only one name as a full argument, other various improvements;!sync: role sync message now hides role slug.
Fixed¶
blocs.tools.private(): fixedblocs.one_commandbypass;!actions: new action creation did not properly added action;!open/!close: all open/close triggers were not triggered;features.gestion_actions.close_action(): base cooldown was set on actions even if no decision was made;
2.1.2 - 2021-04-23¶
Changed¶
!annoncemortcan now prepair several embeds and post them at once;!addIA: new fast-add syntax and duplicate tirggers security check.
Fixed¶
Error when using
!menubefore the game has started;« stop » messages were detected by every waiting functions, even if an other chennel; this is solved by new
chankeyword argument toblocs.tools.wait_for_message(). Dependant functions were modified consequently; while optionnal, omitting this argument may lead to undetected « stop » messages.
2.1.1 - 2021-04-15¶
Fixed¶
Critical error (importing non-requied package) in
__main__.py;Bad order in inscription messages if chambre and additional step.
2.1.0 - 2021-04-13¶
Added¶
New Actions System:
Extended Data model with tables
bdd.Utilisation,bdd.BaseCiblage,bdd.Ciblageand enumsbdd.CibleType,bdd.UtilEtat,bdd.Vote;New columns
bdd.BaseAction.decision_formatandbdd.Action.active;New properties
bdd.BaseAction.temporaliteandbdd.Role.embedto describe a role, used in!role,!fillrolesandfeatures.IA.trigger_roles();New properties
bdd.Action.utilisation_ouverte,bdd.Action.derniere_utilisation,bdd.Action.decision, andbdd.Action.is_open/bdd.Action.is_waiting(hybrid);New method
bdd.Joueur.action_vote();New hybrid properties
bdd.Joueur.est_vivantandbdd.Joueur.est_mort;New class methods
bdd.ActionTrigger.open()andbdd.ActionTrigger.close();New function
features.voter_agir.get_cible(), used by!vote,!votemaire,!voteloupset!actionto handle user inputs;!cpartinow add « vote actions » to all players;
Task postponing now uses Discord-py webhooks:
dropped requirement for
discord-webhookmodule;tasks now use
config.webhook, created byLGBot.on_ready()if not existing;new method
bdd.Tache.send_webhook();deleted
blocs.webhookmodule and usage ofLGREZ_WEBHOOK_URLenvironnement variable;
New boudoirs management system:
New tables
bdd.Boudoirandbdd.Bouderie;New group command
!boudoir(with 8 subcommands) in new modulefeatures.chans;New configuration option
config.boudoirs_category_name, loaded byLGBot.on_ready(),Updated
!helpand doc tools to handle group commands;
New command
!loreusing new Google Docs connection functionblocs.gsheets.get_doc_content();Miscellaneous:
New function
blocs.tools.boucle_query()for generic database instance lookup interactions;New method
LGBot.check_and_prepare_objects()(originally directly inLGBot.on_ready()), called by Discord events concerning roles, channels, emojis and webhooks ;New customizable function
config.additional_inscription_step();blocs.tools.wait_for_react_clic()andblocs.tools.yes_no(): new kwargfirst_text;New column
bdd.Role.actif,!roles,!fillrolesand IA now restricts to roles withactif = True;New convenience function
bdd.base.autodoc_DynamicOneToMany()for documenting dynamicly loaded one-to-many relationships;New option
nullableforbdd.base.autodoc_ManyToOne();
Changed¶
Updated existing data classes attributes to link to new tables;
Made
bdd.Action.basenullable and addedbdd.Action.voteoptionnal attributes to handle votes in a cleaner way (with instance initialization integrity check);Updated
features.open_close.recup_joueurs(),!open,!closeand!remind;features.gestion_actions.delete_action()now updatesbdd.Action.activeinsteade of deleting the instance;features.voter_agir.export_vote()signature changed;!plotnow uses new actions system instead of loading votes from the Gsheet:removed config options
tdb_votecond_column,tdb_votantcond_column,tdb_votemaire_columnandtdb_votantmaire_column;it now automatically computes votes additions and modifications (Corbeau / Intrigant), using new config options
config.ajout_vote_baseaction,config.n_ajouts_votes,config.modif_vote_baseaction;
!fillrolesnow synchronisebdd.BaseCiblagetoo (seeconfig.max_ciblages_per_action) and post camps descriptions;Moved
!addhereand!purgefromfeatures.annexeto new modulefeatures.chans;Updated some string columns max lengths;
Made
__str__\ `implementation specific for :class:.bdd.Role\ ``, :class:.bdd.Camp, :class:.bdd.BaseActionand :class:.bdd.Joueur`.
Removed¶
Tables columns
bdd.Joueur._vote_condamne,bdd.Joueur._vote_maire,bdd.Joueur._vote_loups,bdd.Action._decision,bdd.BaseAction.changement_cible;.blocs.webhookmodule.
Fixed¶
features.voter_agir.export_vote()(!vote*et!action): used hard-written sheet names istead ofconfig.db_votecond_sheet,config.db_votemaire_sheet,config.db_voteloups_sheetandconfig.db_actions_sheet;Documentation errors & typos.
2.0.0 - 2021-03-24¶
Major refactorings¶
Data management¶
blocs.bddmoved tobddmodule and splitted inbdd.base(base classes and utilities),bdd.enums(enums, directly imported in.bdd), andbdd.model_joueurs,bdd.model_jeu,bdd.model_actions,bdd.model_iamodules (data classes, directly imported inbdd);Every data classes names changed to singular names (
bdd.Joueur,bdd.Role…);Implemented SQLAlchemy relationships and made foreign key arguments private (
Joueur.role->Joueur._role_slug,Joueur.role= direct access toRoleobject);Added custom metaclass
bdd.TableMetafor class tables: more robust implementation ofTable.query, and other convenience properties;Enhanced data classes with custom properties and classmethods:
bdd.Joueur.member(),bdd.Joueur.private_chan(),bdd.Joueur.from_member(),bdd.Role.nom_complet(),bdd.Role.default(),bdd.Camp.default(),bdd.Camp.discord_emoji(),bdd.Camp.discord_emoji_or_none();Enhanced data classes with instances methods:
add(),delete()(global handy methods),bdd.Tache.add(), and specificbdd.Tache.delete(),bdd.Tache.register(),bdd.Tache.cancel(),bdd.Tache.execute();Use Enums when needed:
bdd.Statut,bdd.ActionTrigger,bdd.CandidHaroType;bdd.__all__contains all data classes (forimport *).
Global namespace¶
New config namespace module for:
Global variables: implemented system of readiness check on attributes (through new
blocs.ready_checkmodule), used for:Bot objects:
config.bot(loaded byLGBot.run()) andconfig.loop(loaded byLGBot.on_ready()),Server:
config.guild(loaded byLGBot.on_ready()),Database connection:
config.engineandconfig.session(loaded bybdd.connect()),Discord objects:
config.Role,config.Channel,config.Emojiclasses store roles/channels/emojis the bot needs to work, registered as names (customizable) and then transformed in connected objects byLGBot.on_ready().
Customization:
Private channels creation:
config.private_chan_prefix,config.private_chan_category_name,Old
bot.configkeys:debut_saison,demande_chambre,chambre_mj,output_liveness.
Consequences:
LGBot is no more thread-safe: only one bot instance should run concurrently in an interpreter.
« Connected » arguments (
bot,ctx,loop…) removed from several functions signatures, now usingconfigattributes:blocs.tools.channel(),role(),member(),emoji(),log(),yes_no(),wait_for_message(),boucle_message(),wait_for_react_clic(),choice(),create_context();features.gestion_actions.add_action(),delete_action(),open_action(),close_action();features.IA.process_IA(),trigger_reactions(),trigger_sub_reactions(),trigger_gif();
Also added¶
bdd.Camptable (and madebdd.Joueur.campandbdd.Role.camprelationships);bdd.base.autodoc_Column(),autodoc_OneToMany(),autodoc_ManyToOne()andautodoc_ManyToMany()convenience functions to easily document bdd attributes;bdd.Tache.handlerconvenience property;blocs.tools.en_pause()helper function.
Also changed¶
bot.Specialcog moved to newfeatures.specialmodule.LGbotone-command-at-a-time system moved to newblocs.one_commandmodule.Renamed
blocs.bdd.Tablesinlgrez.bdd.tables, and made it auto-build by SQLAlchemy Declarative;Renamed
blocs.bdd.Baseinlgrez.bdd.base.TableBase;<Table>.queryusesconfig.session(raisesblocs.ready_check.NotReadyErrorif not initialised);made
gestion_actions.get_actionsnot async;Adapted
!rolesbehavior to newCamptable;Removed unused option
chanfromfeatures.gestion_actions.open_action()andclose_action();blocs.tools.next_occurence()now relies ondebut_pause()andfin_pause()functions instead of hard-coded pause times;Updated the Configuration Assistant Tool (
__main__.py) with some changes on Google Sheets script editor and other minor changes;Splitted API Reference in several doc pages, and other global documentation and codestyle improvements (source code now almost entirely PEP8-compliant).
Also removed¶
!modifIA: removed option to edit both triggers and response;Made
blocs.bdd.BaseActionsRolesprivate: use directlybdd.BaseAction.rolesandbdd.Role.base_actionsmany-to-many relationship attributes);bdd.BaseAction: removedbase_arguments, not specific to the action (useaction.base.<arg>instead);blocs.tools: removedemoji_camp,private_chanandnom_rolefunctions (usebdd.Camp.discord_emojiordiscord_emoji_or_noneproperties /bdd.Joueur.private_chanproperty /bdd.Role.nomattribute orbdd.Role.nom_completproperty instead);Removed
blocs.bdd_toolsmodule (use<Table>.columnsand<Table>.primary_colproperties,<Table>.find_nearest()method, andfeatures.sync.transtype()function instead);Removed
features.taches.add_task,delete_task,executefunctions (usebdd.Tache.add(),delete()andexecute()methods instead);Removed
LGBot.configattribute (uselgrez.configmodule instead).
1.2.0 - 2020-12-18¶
Added¶
Commands:
!vivants: new aliases!joueursand!vivant/!morts: new aliases!mort.!post(infeatures.communication.Communication) to send a message to a specific channel.!panik(inbot.Special) to instantly kill the bot.!actions(infeatures.informations.Informations) to see and edit players actions [beta].!quiestand!rolede(infeatures.informations.Informations) to see players with a given role and vice versa.!reactfals(alias!rf, infeatures.IA.GestionIA) using new functionfeatures.IA.fetch_tenor.!xkcd(infeatures.annexe.Annexe).
Bot behavior:
New IA rule: « A ou B » ==> « B » (
features.IA.trigger_a_ou_b).!plot cond: thumbnail of camp.!open cond: send post on #haros and wipes.New liveness checking system: new method
LGBot.i_am_alivewrites every 60s current UTC time to a"alive.log"(setLGBot.config["output_liveness"]toTrueto enable)
API usage:
Inscription: customize default chambre with
LGBot.config["chambre_mj"].blocs.tools.yes_no: newadditionnaloption to add aditionnal emojis.
Changed¶
Commands:
!sendcan now accept a player name (send to private chan).!plot condnow shows faction (emoji) of killed player.!annoncemortnow announces if killed player is living-dead.!syncnow asks for confirmation before applying modifications.
Bot behavior:
Calling a command when already in a command now tries to stop running command and run afterwards instead of aborting.
Actions by emojis: only trigger in private chans.
Now sends a reminder every morning to always-usable actions.
API usage:
Renamed
features.IA.tenorinfeatures.IA.trigger_gif(consistency).features.sync: better management of modification with new classTDBModifand of exceptions with new specific functionvalidate_sync.tools.bdd_tools.find_nearest: standardized first word comparison withmatch_first_wordoption.!shell: now using (new)blocs.realshellmodule (based on (new dependency)asyncodemodule) instead of (removed)blocs.pseudoshell.
Other minor improvements.
Fixed¶
Fixed critical bug when changing
role(through!sync).features.taches: fixed critical bug when too much tasks at the same times (Discord’s webhooks rate limits).Inscription: fixed critical bug when > 50 players.
Some docstrings corrections.
Other minor bugs.
1.1.0 - 2020-11-03¶
Added¶
New command
!annoncemort(in new modulefeatures.communication).Added
LGBot.configto permit easier bot customization.Customize inscription with
LGBot.config["demande_chambre"]and["debut_saison"].
!helpnow shows bot version and commands outside of cogs.!open cond/mairenow wipes CandidHaros.!refillnow opens back permanent actions with new charges.Documentation now covers every public classes, functions and commands.
Changed¶
Made some functions private (leading
_).Changed data attributes with leading underscores (like
Joueurs._chan_id) with trailing underscores (Joueurs.chan_id_).Data column
Joueurs.chambreis now nullable.!falscan now be used in non-private channels.blocs.bdd_tools.find_nearestis no longer a coroutine.Some refactoring:
features.informations.emoji_campmoved toblocs.tools.emoji_camp.!plotmoved fromfeatures.actions_publiquestofeatures.communication.!sendand!embedmoved fromfeatures.annexetofeatures.communication.!fillrolesmoved fromfeatures.remplissage_bdd(deleted) tofeatures.communication.
Removed¶
Deleted command
!droptable.Deleted module
features.remplissage_bdd.
Fixed¶
Issue with bot intents: proprer access to member list.
Improved handling of BDD disconnections.
Critical bug with
!stopand voting commands.!plotnow creates./figuresfolder if not existing.blocs.tools.wait_for_react_clicnow handles correctly custom emojis.Configuration Assistant Tool: escape
\ns inLGREZ_GCP_CREDENTIALS.Other minor bug fixes and improvements.
1.0.3 - 2020-10-22¶
Added¶
Created this changelog
Added module and submodules docstrings and meta informations.
Created Sphinx documentation (beta) on lg-rez.readthedocs.io.
Changed¶
README improvements (badges!) and corrections.
Rewriting of bot.LGBot class and methods docstrings.
More PyPI classifiers.
Fixed¶
Relative links in PyPI project description now redirect to files on GitHub (not to a 404 page).
1.0.2 - 2020-10-20¶
Fixed¶
Critical bug fix.
1.0.1 - 2020-10-20¶
Initial release.