Package: lg-rez
lg-rezDiscord bot for organizing boisterous Werewolf RP games ESPCI-style.Please not that this project's source code (comments, docstrings) is written
exclusively in French. The bot itself uses only French language; no
internationalization is available at this time.NOTE AUX GRIS / MJSTout ce qui suit est du blabla READMEsque peu intéressant.Pour les trucs intéressants, c'est-à-dire les instructions pour lancer une
nouvelle saison, voirNouvelle saison.md.What's New in LG-RezOnly major features are reported here; seeCHANGELOG.mdor inthe docfor
details.3.0Changed all commands to Discord builtin slash commands, using Discordpy 2.0Several major commands changes2.4New commands!mp,!setup,!cfiniNew subcommand!boudoir findMinor improvements and command changes.2.3New subcommand!boudoir pingCommand!rolespartially splitted to!camps.2.2New command!modif.2.1New Actions System with actions / vote history and better action request;NewBoudoirsmanagement system and new command!boudoir;New command!lore.2.0Major refactoring of data management and internal structure;Newconfignamespace module for easier customization.InstallationUse the package managerpipto install lg-rez:pipinstalllg-rezWe strongly recommand to install this package in a dedicated virtualenv
(python3 -m venv <yourfolder>).DependenciesPython 3.10+Packages: seerequirements.txtConfigurationTo run correctly, the bot needs to be connected to several external services,
each needing more or less sensitive tokens, stocked as environments variables.
We support and encourage the use ofpython-dotenvto read them from
a.envfile, but you may prefer exporting them as environment variables.All necessary variables, prefixed byLGREZ_, are listed inmodel.env.Configuration Assistant ToolWe provide a command-line assistant tool to help you set up every services and
generate the.envfile (which you can latersourceand delete if you wish).Run it simply with:python-mlgrezThis tool also creates astart_bot.pyfile containing the minimal code
needed to run the bot (seeUsagesection below).Manual configurationYou may prefer to manually write your environment variables, or just check
instructions regarding a specific one: they can be found inCONFIGURE.md.Warning: the Configuration Assistant Tool checks every variable by
running specific tests, which is not the case for manual configuration,
so be sure of what you do!UsageThis package's external API consists essentially in adiscord.ext.commands.Botsubclass,LGBot, which implements every features needed to play.The minimal code needed to run the bot in a configured folder (generated by the
configuration assistant tool) is:fromlgrezimportLGBotbot=LGBot()bot.run()Bot usageOnce the bot connected to your Discord server, send!helpto see every
available commands (note: some commands are only visible by specific roles;
grant yourself the "MJ" AND "Joueur en vie" roles to see everything.)Use!help commandto get more information about a command.For precisions relative to non-command features (such as "IA" reactions to
messages), look at the correspondingdocumentationsection.CustomizationSinceLGBotis a subclass ofdiscord.ext.commands.Bot,
you can use every arguments and methods it supports or subclass it to override
existing behavior.We also provide a direct way to customize some parameters of the game and
of the Discord server throughconfigmodule:
roles/channels/emoji names, date of season beginning, inscription
customization... Seethe docfor full API usage information.See additional attributes and overriden methods onthe doc(mostly in French)Some useful examples:Change command prefixfromlgrezimportLGBotbot=LGBot(command_prefix="?")bot.run()Customize some config optionsfromlgrezimportLGBot,configconfig.debut_saison="27 octobre"config.Role.mj="Game-Master"bot=LGBot()bot.run()Delete a command or aliasfromlgrezimportLGBotbot=LGBot()bot.remove_command("command_name")bot.run()Add a command or change the behavior of a commandfromdiscord.extimportcommandsfromlgrezimportLGBot@commands.command()asyncdefmycommand(ctx,...):...bot=LGBot()bot.remove_command("mycommand")# If replacing an existing commandbot.add_command(mycommand)bot.run()Enhance or replace the reaction to a Discord eventfromlgrezimportLGBotasyncdefsay_hello(bot,member):awaitmember.send("Hey!")classMyBot(LGBot):"""Your customized bot class"""asyncdefon_member_join(self,member):awaitsay_hello(self,member)super().on_member_join(member)# Invoke the original reactionbot=MyBot()bot.run()Seediscord.py documentationfor more
ideas.ContributingCommunity contributions are not welcome for now. Get in touch with the authors
(see below) for any question or suggestion about this project.LicenseThis work is shared underthe MIT license.© 2020 - 2022 Loïc Simon, Tom Lacoma et al. – Club BD-Jeux × GRIs –
ESPCI Paris - PSLReach us on Discord:LaCarpe#1674,TaupeOrAfk#3218or by mail:loic.simon@espci.org,tom.lacoma@espci.org