25 Commits

Author SHA1 Message Date
Kowlin
a729a474b1 Added documentation for PM2 (#2105)
* Added PM2 documentation

* Grammar fix

* Build error fix.

* Just work T_T

* Update docs/autostart_pm2.rst

Co-Authored-By: Vexed <51716387+Vexed01@users.noreply.github.com>

* Update docs/autostart_pm2.rst

Co-Authored-By: Vexed <51716387+Vexed01@users.noreply.github.com>

* Create 2105.docs.rst
2019-11-04 16:52:01 -05:00
El Laggron
ea77de5d56 [Docs] Getting started guide (#2659)
* Getting started guide

* Remove DigitalOcean referral link

* Fix typos and mispells, thanks to @Flame442

* Remove cogs.red hyperlink until it is finished

* Add towncrier entry

* Add prolog.txt

This is not necessary for this PR but all of the other cog guides rely on this file.
The cog guides are individual branches based on this one, which is why I'm adding this file right now.

* QA changes

* More QA changes

considering -> assuming
red is a girl, not non-binary
2019-10-03 12:47:46 -04:00
Michael H
a8091332b8 [Docs] Add version guarantees (#2882)
Make some version guarantees.

We also need to do a pass over the existing things this would cover and decide if any of them should be made private.
2019-07-19 11:50:33 +10:00
Will
61d255726c
[Docs] Add initial changelog document (#2611)
* Add initial changelog document

* add initial links

* oops
2019-04-24 17:08:55 -04:00
TrustyJAID
49af94334e Add Central API Key Documentation (#2574) 2019-04-23 23:51:37 +02:00
Michael H
136e781c7f Kill DataConverter (#2554)
* Kill DataConverter

* remove the tests
2019-04-09 17:01:04 -04:00
Toby Harradine
0870403299
Permissions redesign (#2149)
API changes:
- Cogs must now inherit from `commands.Cog` (see #2151 for discussion and more details)
- All functions which are not decorators in the `redbot.core.checks` module are now deprecated in favour of their counterparts in `redbot.core.utils.mod`. This is to make this module more consistent and end the confusing naming convention.
- `redbot.core.checks.check_overrides` function is now gone, overrideable checks can now be created with the `@commands.permissions_check` decorator
- Command, Group, Cog and Context have some new attributes and methods, but they are for internal use so shouldn't concern cog creators (unless they're making a permissions cog!).
- `__permissions_check_before` and `__permissions_check_after` have been replaced:  A cog method named `__permissions_hook` will be evaluated as permissions hooks in the same way `__permissions_check_before` previously was. Permissions hooks can also be added/removed/verified through the new `*_permissions_hook()` methods on the bot object, and they will be verified even when permissions is unloaded.
- New utility method `redbot.core.utils.chat_formatting.humanize_list`
- New dependency [`schema`](https://github.com/keleshev/schema)

User-facing changes:
- When a `@bot_has_permissions` check fails, the bot will respond saying what permissions were actually missing.
- All YAML-related `[p]permissions` subcommands now reside under the `[p]permissions acl` sub-group (tbh I still think the whole cog has too many top-level commands)
- The YAML schema for these commands has been changed
- A rule cannot be set as allow and deny at the same time (previously this would just default to allow)

Documentation:
- New documentation for `redbot.core.commands.requires` and `redbot.core.checks` modules
- Renewed documentation for the permissions cog
- `sphinx.ext.doctest` is now enabled

Note: standard discord.py checks will still behave exactly the same way, in fact they are checked before `Requires` is looked at, so they are not overrideable. 

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2018-10-01 13:19:25 +10:00
zephyrkul
04e97f3516 [CustomCom] Custom Command Parameters (#2051)
* [V3 CustomCom] Custom Command Parameters

Allows specifying more parameters for CC's via {0}, {1}, etc. that will be filled by the user invoking the CC. Python-style type hinting and attribute access is also allowed for Discord and builtin types.

> [p]cc add simple greet Hi, {0.mention:Member}!
> ...
> [p]greet zephyrkul
> Hi, @zephyrkul!

The bot will reply with the standard help messages if the cc is incorrectly executed.

> [p]greet me
> Member "me" not found

* black formatting

* check command failure

Only call the custom command if the faked command succeeded.

* misc fixes

1) don't str.strip all the time, it's not family-friendly and doesn't match transform_parameter
2) transform_arg now actually returns strings in every case
3) improve prepare_args parsing security
4) help parameters will show what type they expect
5) make linter less angery

* customcom documentation

I hate rst

* don't require repeated type hinting

If a parameter was type hinted previously, don't require it again.
Ex: `{0.display_name:Member}#{0.discriminator}` is now possible.

* add cog_customcom.rts to index

I despise rst

* don't enforce order

Allow type hinting and attribute access to be in either order.
Ex. `{0:Member.mention}` is now valid.

* clean up on_message

We're building context anyway, may as well use it.

* [doc] correct cog name

Cog class is named CustomCommands, not CustomCom

* minor on_message optimization

only build context if it's needed

* update cc_add docstring

Old one wasn't user-friendly. Replaced with a link to the new docs.
Link will not function until PR is merged and docs refreshed.

* [doc] change repeat to say

repeat is an audio command, use say in the example instead

* compare ctx.prefix to None

allows for null prefixes, which is a bad idea but who am I to judge

* address review

* raise error on conflicting colon notation

bugfix I was working on but failed to actually commit
2018-09-07 00:14:02 +10:00
Toby Harradine
ce031cf7bd
[Docs] Add virtualenv guide and compress install guides (#2029)
* [Docs] Add virtualenv guide and compress install guides

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* [Docs] Better cross-referencing

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Fix pyenv-installer link

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Use sudo -e instead of sudo nano

* Add note about launcher for linux/mac

* Include launcher notes in Windows guide

* Add missing colon
2018-08-26 23:44:56 +10:00
Michael H
54975eb812 [V3] Permissions (#1548)
* This starts setting up checks.py to handle managed permission overrides

* A decent starting point, more work to come

* missing else fix

* more work on this

* reduce redundant code

* More work on this...

* more progress

* add a debug flag to some things in .resolvers to help with exploring why checks behave in a certain way

* modify this to be a list for ease of showing full resolution order

* more

* don't bypass is_owner, ever

* remove old logic about ownercommands

* better handling of chec validity

* anonymous functions return None for __module__, remove some code as a result

* mutable default bind fix

* Add a caching layer (to be invalidated as needed)

Ensure checks in the chain inserted before the core logic only return None or False
(whitelists then blacklists are checked first in core logic, from most to least specific scope, overriding this with an allow does not make sense)

* more progress, slow work as I have time

* Modifies the predicates so that their inner functions are accesible from cogs without
being a check

* Update checks.py

Safety for existing permissions.py cogs

* This is where I take a change of course on setting this up,
because this would have been the most long winded interactive command ever as
it was starting to progress.

This is going to support individual entry updates, settings from yaml, gettings, and clearing existing settings
as well as printing a settings template out and referring people to what is going to be very well written docs

* block permissions cog from being unblocked by the permissions cog as a safety feature (really, co-owner exists at this point)

* WIP

* Okay, this has the intent of the changes, just to actually test these as working as intended + add corresponding guild functions

* oh nice, missed a couple files, sec...

* WIP, also, something's broken in resolvers or check_overrides >>

* This is working now (still needs docs and more...)

* unmerge changes from other PR

* is_owner still needs to exist in here due to management of non checked commands

* Update this to new style standards

* forgot to commit some local changes earlier

* fix update logic

* fix update logic

* b14 fix, lol

* fix issue with management command name

* this isnt a real fix

* Ok..

* perms

* This is working, but needs docs and more configuration opts now

* more

* Ux functions, need testing

* style

* fix using the obj str rather than the id

* fix CogOrCommand converter

* Return the correct things in the converter

* last fix, needs docs, and possibly some extra Ux utils

* start doc writing

* extra user facing commands

* yaml docs

* yaml fix

* secondary checks-fix

* 3rd party check stuff

* remove warning that this isn't ready yet

* swap ctx.tick for real responses, require emoji perms for interactive menuing, better attr handling for nicknames

* send file to author

* alias to `p`

* more ctx tick removal

(This is a long ass changelog...)
2018-05-28 00:17:17 +02:00
palmtree5
c58c55b752
[V3 Docs] Move the install docs to install Python 3.6 (#1685)
* [V3 Docs] drop ffmpeg from CentOS install guide

* [V3 Install Docs] move all to Python 3.6

* Update the toctree

* Needed a blank line

* drop a .6 that wasn't needed
2018-05-24 11:09:08 -08:00
Tobotimus
15ea5440a3 [V3 i18n] Internationalise help for commands and cogs (#1143)
* Framework for internationalised command help

* Translator for class docstring of cog

* Remove references to old context module

* Use CogManagerUI as PoC

* Replace all references to RedContext

* Rename CogI18n object to avoid confusion

* Update docs

* Update i18n docs.

* Store translators in list instead of dict

* Change commands module to package, updated refs in cogs

* Updated docs and more references in cogs

* Resolve syntax error

* Update from merge
2018-05-12 01:47:49 +02:00
Wyn
487d256f46 [V3 Docs] Added Arch Installation guide (#1504)
* Added Arch Installation guide

For prereqs:
python-pip pulls python which pulls required packages libffi and openssl
Removed ffmpeg for Java replacement

* index

Adding the guide to the index sounds like a smart idea...

* Removed libsodium

Not needed after all

* added --user flag to installs for pip
2018-04-16 23:45:53 +02:00
Pier-Angelo Gaetani
fe0b6aaba4 [V3 Docs] Systemd guide + extras (#1505)
* Documentation extras

Added links to each distro's user add functions
Added systemd service guide
Added --user operator to pip install commands

* Update autostart_systemd.rst

Added no-prompt flag
2018-04-16 23:44:08 +02:00
Michael H
d65f8856f4 [V3] Data Converter (#1293)
* More docstrings

* still not ready...

* push this untested pile of code.

* working, menu needs cleaning up though, modlog converter not here yet

* menu cleanup

* add note about the fact that values are overwritten

* add i18n

* User friendlier quitting

* Better naming of a function

* setup automodule for dataconverter

* More documentation

* use Config.MEMBER (etc) instead of 'MEMBER' (etc)
2018-04-02 21:14:37 -04:00
palmtree5
4e2b83c052 [V3 Docs] Add and update existing features (#1451)
* [V3 Docs] bump version

* Remove removed functions from __all__

* Update docstring format

* Update copyright year

* Add embed utils docs

* Document bot class

* Document RPC

* Update toctree
2018-03-24 17:27:04 -04:00
Tobotimus
5cef3e13e1 [V3 Docs] Docs for utils package (#1085)
* Docstrings for chat formatting

* Docstrings for mod utils

* Type checking

* Override CSS to highlight object name in definition

* More typing

* Utils docs pages

* Fix typo here
2017-11-19 13:14:05 -09:00
Will
9394b4880e [V3 Docs] Add data manager information (#1056)
* Add Data Manager docs

* Add rst file

* Add note on data manager's purpose
2017-10-24 20:38:27 -08:00
palmtree5
3febc94871 [V3] migration docs (#992)
* [Docs] start on migration guide

* [Docs] add more to migration docs

* [Docs] fix imports in examples

* [Docs] add migration guide to toctree

* [Docs] add a cog creation guide

* [Docs] expand on cog packages in migration guide

* Fix typo

* [Docs] add link for modlog docs
2017-10-22 21:05:47 -04:00
palmtree5
fb125ef619 [V3] Mod initial rewrite (#1034)
* Readd work due to redoing branch

* [modlog] Move to core and start work on separating it from cogs

* More work on modlog separation

* [Core] Finish logic for modlog, do docstrings, async getters

* [Core] Add stuff to dunder all

* [Docs] Add mod log docs

* [Core] Move away from dunder str for Case class

* [Docs] don't need to doc special members in modlog docs

* More on mod log to implement commands

* More work on Mod

* [Mod] compatibility with async getters

* [Tests] start tests for mod

* [Tests] attempted fix

* [Tests] mod tests passing now!

* [ModLog] update for i18n

* modlog.pot -> messages.pot

* [Mod] i18n

* fix getting admin/mod roles

* Fix doc building

* [Mod/Modlog] redo imports

* [Tests] fix imports in mod tests

* [Mod] fix logger problem

* [Mod] cleanup errors

* A couple of bug fixes

Async getters, some old `config.set` syntax

* Filter ignores private channels

* Fix softban

Was still relying on default channels

* Actually ignore private channels

* Add check for ignored channels

* Fix logic for ignore check

* Send confirm messages before making case

* Pass in guild when setting modlog

* Thanks autocomplete

* Maintain all data for case

* Properly ignore softbans in events

* [Mod] bugfixes

* [Mod] more changes

* [ModLog] timestamp change

* [Mod] split filter and cleanup to their own cogs + regen messages.pot

* [Cleanup] change logic

* [Cleanup] increase limit for channel.history

* [Mod] await getter in modset banmentionspam

* [Mod] attempt duplicate modlog message fix

* [Mod] get_user -> get_user_info

* [Modlog] change reason command so the case author can edit their cases (#806)

* [Modlog] make reason command guild only

* [Modlog] clarify the reason command's help

* [Mod] package path changes + numpy style docstrings for modlog

* [Mod] change ban and unban events to need view audit log perms to find/create a case

* [Modlog] refactoring

* [Filter] add autoban feature

* [Mod] update case types + event changes

* [Mod/Modlog] fix tests, fix permissions things

* [Docs] fix up modlog docs

* Regenerate messages.pot
2017-10-22 21:02:16 -04:00
palmtree5
4993c5a675 [V3 Docs] Add install guides to the documentation (#1005)
* [Docs] add install guides to the documentation

* formatting changes
2017-10-15 22:40:57 -04:00
Tobotimus
86b18c702c [V3] Custom context class (#988)
* Create custom context class

* Documentation

* Remove old help method, replace with new

* Update from rebase
2017-10-15 21:02:50 -04:00
Will
f78c33445c [Docs] Cog Manager (#901)
* Cog manager docs

* Oops, kinda need this
2017-08-12 14:03:28 -08:00
palmtree5
fd684bdb58 [Docs] Add bank docs (#900)
* Add bank docs

* [Docs] fix bank docstrings for formatting

* [Docs] add bank to toctree

* rename and make bank rst use members

* Formatting changes

* Add account to dunder all
2017-08-11 21:59:27 -04:00
Will
7e05903c61 [Docs] The beginning of the reign of autodoc (#898)
* Update gitignore

* Add docs basic config

* Add config options for rtd and autodoc

* Add requirements.txt and update conf to support coros

* Add downloader cog docs

* Add downloader reference docs

* Add config, apparently invalid rst syntax breaks a lot of shit
2017-08-11 00:14:42 -04:00