Package: pokedream
pokedreama debugging and utility extension for discord.py botsRead the documentation online.pokedream is an extension for bot developers that enables rapid prototyping, experimentation, and debugging of features for bots.One of pokedream's core philosophies is to be dynamic and easy-to-use. Here's the two step install:Download pokedream on the command line using pip:pipinstall-UpokedreamLoad the extension in your bot code before it runs:bot.load_extension('pokedream')# orawaitbot.load_extension('pokedream')That's it!You can also import the module to use the command development utilities.IndexCommand referenceInstalling development versionsAcknowledgementsCommand reference>pokedream [py|python] <argument>>pokedream [pyi|python_inspect] <argument>The Python commands execute or evaluate Python code passed into them.
            It supports simple expressions:>psk py 3+4Beep Bot7It also supports async expressions:>psk py await _ctx.pins()Beep Bot[<Message id=123456789012345678 ...>, ...]You can pass in codeblocks for longer blocks of code to execute, and you can useyieldto return intermediate results within your processing.Theinspectvariant of the command will return a codeblock with detailed inspection information on all objects returned.The variables available by default in all execution contexts are:_ctxTheContextthat invoked the command._botThe runningBotinstance._author_channel_guild_me_message_msgShortcuts for attributes on_ctx._find_getShortcuts fordiscord.utilsfunctions.The underscore prefix on the provided variables is intended to help prevent shadowing when writing large blocks of code within the command.If you decide that you don't want the prefix, you can disable it by setting thepokedream_NO_UNDERSCOREenvironment variable totrue.Each Python command is individually scoped. That means variables you create won't be retained in later invocations.You can usepokedream retain onto change this behavior and retain variables, andpokedream retain offif you change your mind later.>pokedream [dis|disassemble] <argument>This command compiles Python code in an asynchronous context, and then disassembles the resulting function into Python bytecode in the style ofdis.dis.This allows you to quickly and easily determine the bytecode that results from a given expression or piece of code. The code itself is not actually executed.>pokedream ast <argument>This command compiles Python code into its Abstract Syntax Tree, and then displays it as a formatted tree of AST blocks.>pokedream [sh|shell] <argument>The shell command executes commands within your system shell.If you're on Linux and are using a custom shell, pokedream will obey theSHELLenvironment variable, otherwise, it will use/bin/bash.On Windows, pokedream will use PowerShell if it's detected, otherwise, it will use Command Prompt.The results from the commands you pass in are returned through a paginator interface live as the command runs. If you need to stop a command, you can press the stop button reaction, or usepsk cancel.The execution will terminate automatically if no output is produced for 120 seconds.>pokedream git <argument>>pokedream pip <argument>These commands act as shortcuts to the shell command, so you can save typing a word if you use these frequently.>pokedream [load|reload] [extensions...]>pokedream unload [extensions...]These commands load, reload, or unload extensions on your bot.You can reload pokedream itself withpsk reload pokedream.psk reload ~will reload all extensions on your bot.You can load, reload, or unload multiple extensions at once:psk reload cogs.one cogs.two>pokedream shutdownThis command gracefully shuts down your bot.>pokedream rttThis command calculatesRound-Trip Timefor your bot to the API. It does this by calculating response time samples, so you can tell if your bot is being slow or not.>pokedream sync [guild_ids...]This command syncs the app_command tree for a list of guilds, or globally if none are given, and then reports the results.>pokedream cat <file>This command reads a file from your file system, automatically detecting encoding and (if applicable) highlighting.You can use this to read things like bot logs or source files in your project.>pokedream curl <url>This command reads text from a URL and attempts to detect encoding and language, similar topsk cat.You can use this to display contents of files online, for instance, themessage.txtfiles created when a message is too long, or raw files from paste sites.>pokedream exec [member and/or channel...] <command string>>pokedream debug <command string>>pokedream repeat <times> <command string>These commands serve as command control for other commands.pokedream execallows you to execute a command as another user, in another channel, or both. Using aliases with a postfix exclamation mark (such aspsk exec! ...) executes the command bypassing checks and cooldowns.pokedream debugexecutes a command with an exception wrapper and a timer. This allows you to quickly get feedback on reproducable command errors and slowdowns.pokedream repeatrepeats a command a number of times.>pokedream permtrace <channel> [targets...]This command allows you to investigate the source of expressed permissions in a given channel. Targets can be either a member, or a list of roles (to simulate a member with those roles).It will read all of the guild permissions and channel overwrites for the given member or roles in the channel, and provide a breakdown containing whether the permission is granted, and the most fundamental reason why.Installing development versionsIf you'd like to test the latest versions of pokedream, you can do so by downloading from the git hosts instead of from PyPI.From GitHub:pipinstall-U"pokedream @ git+https://github.com/Arnavpy/Pokedream-debugger/@master"From GitLab:pipinstall-U"pokedream @ git+https://gitlab.com/Arnavpy/Pokedream-debugger/@masterr"Please note that the new 2020 dependency resolver now no longer discounts git package sources from reinstall prevention,
which means that if you are installing the pokedream development version multiple times within the same version target you may run into pip just discarding the update.If you run into such a problem, you can force pokedream to be reinstalled like this:From GitHub:pipinstall-U--force-reinstall"pokedream @ git+https://github.com/Arnavpy/Pokedream-debugger/@master"From GitLab:pipinstall-U--force-reinstall"pokedream @ git+https://gitlabs.com/Arnavpy/Pokedream-debugger@master"Youmusthave installed pokedream with one of the commands above before doing this else you will probably end up with a broken installation.AcknowledgementsThe documentation and this README uses icons from theMaterial Design Iconlibrary, which is licensed under theApache License Version 2.0.