Compare commits

..

154 Commits

Author SHA1 Message Date
palmtree5
e34975001c [V3] Bump version to 3.0.0b15 (#1720) 2018-05-27 21:48:05 -08:00
Michael H
f3b282062b get channels (#1729) 2018-05-27 21:42:47 -08:00
Michael H
84732a24fa [V3] Drop verbose output on check failure (#1725) 2018-05-27 21:27:44 -08:00
Michael H
dad775b494 [V3 Context] use bot's color if it has one (Ux Consistency with help formatter) (#1706)
* use bot's color if it has one

* add bot color support to context

* alias color to colour too to match d.py consistency

* Update context.py

* Update context.py

* black fix
2018-05-27 21:23:03 -08:00
palmtree5
05ad3fcd5c [V3 Modlog] add events for modlog cases (#1717)
* Give modlog case objects the bot as an attribute

* Dispatch modlog_case_create and modlog_case_edit events

* case.bot, not just bot

* fix a couple more issues resulting from refactor

* Case.edit doesn't need the bot parameter lol

* Make create_case return the case object (because tests)

* Modify create_case docstring

* Fix a docstring
2018-05-27 21:18:50 -08:00
Redjumpman
6ae02d2d02 [V3/Readme] Update V3 Readme (#1703)
* Update and rename README.rst to README.MD

* Update and rename README.MD to README.rst

Changed the file type back to rst from MD

* Update README.rst

Changed image size.

* Update README.rst

Changed the cogs.red link to point at issue 1398 until the portal displays V3 cogs.

* Update README.rst

Changed image host to imgur
2018-05-27 21:14:24 -08:00
Michael H
757a3114dc [V3] rpc close removed (#1726) 2018-05-27 21:06:13 -08:00
palmtree5
94b9878c6c [V3 Downloader] add repo info command + add short descriptions in repo list (#1701) 2018-05-28 07:01:54 +02:00
palmtree5
7775b16199 [V3] Optimize the backup command (#1666)
* [V3 Core] Enhance [p]backup to exclude some files

* Backup the repo list too

* Lol Sinbad's pre-commit hook

* Add option of sending the backup to the owner via DM

* Drop an unnecessary config object in RepoManager

* Move the backup functionality in redbot-setup to the new stuff

* More work on implementation, including backing up the instance data
2018-05-28 06:56:28 +02:00
palmtree5
f01d48f9ae [V3 Docs] allow [p]shutdown to actually shut the bot down (#1668) 2018-05-28 06:51:31 +02:00
palmtree5
179883094e [V3 Context] make send_help respect embed setting (#1723) 2018-05-28 06:37:58 +02:00
palmtree5
971ccf9df4 [V3 Core] add support for setting a color for embeds (#1707)
* [V3 Core] add support for setting a color for embeds

* Add a guild toggle for whether to use the bot color

* Add a function for getting embed color in Context

* Coroutines need to be awaited lol
2018-05-28 06:28:22 +02:00
Michael H
07eb6bf88e Reverted Ping back to its original state (#1712) 2018-05-28 06:17:02 +02:00
palmtree5
5afd8174ca [V3 Launcher] update cli flag getter (#1696)
* [V3 Launcher] make some updates to the cli flag selector

* Add the --mentionable flag
2018-05-28 06:06:59 +02:00
aikaterna
f1fea38712 [V3 Mod] Unmute server does not need channel (#1695) 2018-05-28 05:36:44 +02:00
El Laggron
f275c6e5e7 [V3 Launcher] Fixed issue with update choice (#1649)
*  [V3 Launcher] Fixed issue with update choice

extras_selectors() was run even if what the user did input for the development choice (stable/dev) was wrong

* [V3 Launcher] Option to go back when updating

* [V3 Launcher] Fixed coding style
2018-05-28 05:30:35 +02:00
palmtree5
5ec25959df [V3 Help] add tagline support (#1705)
* [V3 Help] add tagline support

* Make the tagline resettable

* Actually, let's allow the user full control over the footer
2018-05-28 05:25:18 +02:00
palmtree5
4f270f3aab [V3] Start work on fuzzy command search (#1600)
* [V3] Start work on fuzzy command search

* Implement in command error handler

* Something isn't working here, try fixing

* Style compliance

* Add fuzzywuzzy to pipfile

* Dump the short doc part if there is no short doc

* Add fuzzy command search on command not found in help

* Move things around, implement for use of default d.py help formatter

* Formatting compliance

* Undo pipfile changes
2018-05-28 04:57:10 +02:00
bobloy
4028dd3009 [V3 Downloader] Pagify cog list and typing fix (#1662)
* Cog list is now pagified

* Proper typing of Tuple

* Black formatting

* More Black formatting
2018-05-28 03:55:33 +02:00
Tobotimus
706b04610d [V3] Implement --dry-run flag (#1648) 2018-05-28 03:46:06 +02:00
Michael H
014e3baea0 pagification (#1722) 2018-05-28 03:35:57 +02:00
Michael H
92ca7c935a Docstring fix (#1724) 2018-05-28 03:30:58 +02:00
palmtree5
5c9b1c9a3d Move [p]userinfo to Mod + refactor [p]names (#1719) 2018-05-28 03:23:24 +02:00
Tobotimus
5ebee60c97 Rejoice for a 3.5-less Travis (#1713) 2018-05-28 03:18:23 +02:00
Tobotimus
3337a9cbab [V3 Launcher] Fix error when removing Mongo instance (#1710)
* [V3 Launcher] Fix error when removing Mongo instance

Fixes #1573

* Fix issue causing style check to fail

* Remove unneeded whitespace
2018-05-27 16:08:25 -08: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
rngesus-wept
537531803a [V3 Admin] Correct spelling of 'hierarchy' (#1714) 2018-05-27 12:25:26 -08:00
Tobotimus
f4b640126b [V3 Warnings] Fix warn command when no valid reason is passed (#1672)
Resolves #1670
2018-05-27 12:15:56 -08:00
El Laggron
1de3251127 [V3 Docs] Reference 3.6 docs (#1715) 2018-05-27 12:05:35 -08:00
palmtree5
7e98076e4a [V3 Docs] expand info.json docs (#1699) 2018-05-25 12:38:32 +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
Michael H
928be5717f [V3 Checks] Respect administrator and guildowner permissions (#1711)
* respect admin and guildowner (implicitly) in checks for permissions

* this needed it too
2018-05-25 01:17:21 +10:00
Redjumpman
ccbaa926ce [V3 Economy] fix erroneous message when transferring with insufficient funds (#1698)
Fixed an erroneous message when transferring credits while having insufficient funds.
2018-05-23 11:45:23 -08:00
Tobotimus
d1208d7d19 [V3] Update CONTRIBUTING.md with details on new dev workflow (#1659)
* Update CONTRIBUTING.md with details on new dev workflow

* Fix typos

* Update link in README.rst

* tiny grammar fix

* Specify the line length

* Update CONTRIBUTING.md

* Fix links in contents

* Add section for keeping dependencies up-to-date

* Include notes about Makefile
2018-05-23 15:26:54 +10:00
Tobotimus
099fe59a97 [V3 Core] Add [p]helpset (#1694)
* Add settings and commands for page and character limits

* Add missing returns

* Consistent responses
2018-05-22 21:04:53 -08:00
Will
889acaec82 [V3 Downloader] Fix #1671 (#1692) 2018-05-22 20:54:00 -04:00
palmtree5
c42e9d4c5c Add a makefile for helping with style checking and reformatting (#1665)
* Add a makefile

* Add make.bat

* Slightly modify Palm's makefile

* Use make in tox

* Minimise diff and refactor PATHEXT

* Fix a typo in make.bat
2018-05-22 20:44:11 -04:00
Will
4378e5295d [V3 Downloader] Fix #1594 (#1693) 2018-05-22 20:37:34 -04:00
Will
73a427f6aa [V3 RPC] Initial RPC library switch (#1634)
* Initial RPC library switch

* Use weak refs to the methods so cog unload works

* Add docs

* Black fixes

* Add jsonrpcserver to Pipfile.lock
2018-05-22 16:29:26 -08:00
aikaterna
abfee70eb3 [V3 Audio] Only allow audio commands in servers (#1682)
* [V3 Audio] Only allow audio commands in servers

Fixes #1681

* [V3 Audio] Formatting fix
2018-05-22 19:39:01 -04:00
Michael H
77cdbf8dd6 [V3 Alias] Add checks to alias add/del (#1676) 2018-05-22 19:27:11 -04:00
aikaterna
28bc68c916 [V3 Audio] [p]llsetup fixes (#1656)
* [V3 Audio] [p]llsetup fixes

[p]llset wsport changed to not use the rest port setting and both the rest and ws ports were changed to use ints instead of strings.

* [V3 Audio] Version change
2018-05-22 19:19:47 -04:00
Will
ecb64cc2ec [V3] Add deprecation warning for Python 3.5 (#1684)
* Add deprecation warning for python 3.5

* Use colorama

* Modify background color

* Just print to stdout
2018-05-20 20:56:50 -08:00
bobloy
23706a1ba9 [V3 Tests] Fix downloader test failing on Windows (#1673)
* ignore idea

* windows option

* Remove personal setting

* proper undo

* Requested changes

```
("repos", "squid") == pathlib.Path('TEST\\\\TEST2\\\\repos\\\\squid').parts[-2:]
True
("repos", "squid") == pathlib.Path('test/test2/test3/test4/repos/squid').parts[-2:]
True
```

* Needs to remove newline too

Resolves #1663
2018-05-19 12:11:41 +10:00
Michael H
d3f406a34a [V3 Travis] Update travis to not skip pipfile lock... (#1678)
* Update travis to not sip pipfile lock

update pipfile dependencies

additional black formatting pass to conform to black 18.5b

* .

* pin async timeout until further discussion of 3.5 support

* .
2018-05-18 17:48:22 -08:00
bobloy
55afc7eb33 [V3 Downloader] Handle errors when importing modules (#1655)
* Handle errors when importing modules

* Do nothing with error

* Updated to black formatter standards

* More Black formatting
2018-05-17 13:42:41 -04:00
Tobotimus
7a70d12efd [V3] Add tox (#1641)
* Configure tox environments for install, dev install and docs build

* Configure Travis to run tox

* Use 3.5.1 since it's our minimum supported version

* Bump lower travis build version to 3.5.2

Turns out a dependency is incompatible with 3.5.1.

* Modify Travis config to install from pipenv

* Try without skipping the lock

* Try without pip cache

* D the dev install with pipenv

* See if adding the pip cache back in breaks

* Remove the development installation

It doesn't really make any sense considering we already should be installed in develop mode, as does Travis.

* Oops, tox should go under dev packages

* Do black --check with tox

* Uncache pip again...

* Try a build matrix, and try ignoring virtualenvs

* Activate pipenv shell on travis

* Try installing prereleases

* Try the build matrix like this

* Try exclusion

* Upgrade pip

* Try this environment marker

* Back to stages...

* Try run over shell

* Try skipping the lock again

* This'll be faster but probably ignore 3.5

Because Travis

* Just manually list sources for black to check

* Magic?

* What if I told you...

That this worked perfectly on Tobotimus/Red-DiscordBot@test_travis_matrix

* It couldn't possibly be this easy

* Let's add some comments to be nice

* Let's change back to trusty just in case the stages fuck up

* Add another comment because why not

* Let's try caching pip one more time

* We don't need to whitelist these
2018-05-15 13:10:14 +10:00
palmtree5
1ecaf6f8d5 Black formatting for generate_strings.py and docs/conf.py (#1658)
* Black formatting for generate_strings.py

* Also add docs/conf.py
2018-05-15 09:27:06 +10:00
Will
e01cdbb091 Black tests and setup.py (#1657) 2018-05-15 09:09:54 +10:00
Michael H
b88b5a2601 [V3] Update code standards (black code format pass) (#1650)
* ran black: code formatter against `redbot/` with `-l 99`

* badge
2018-05-14 15:33:24 -04:00
Michael H
e7476edd68 [V3] fix help on missing cog and command docstrings (#1645)
* [V3] fix help on missing cog docstrings

* I think this is what you're looking for

* Also do a NoneType check for commands
2018-05-14 20:13:12 +10:00
Will
cbbeb412f9 [V3 Docs] Fix makefile and add dpy back in to the requirements (#1646) 2018-05-14 15:30:42 +10:00
Will
f544890f00 [V3 Docs] Modify RTD config to (hopefully) make it build (#1644)
* Fix docs requirements

* Modify RTD config
2018-05-14 15:03:43 +10:00
Will
72560fa6d0 [V3] Add pipenv files (#1642)
* Add pipenv files

* Pipfile updates

* Update sphinx version
2018-05-14 14:20:20 +10:00
Tobotimus
4637ff78c0 [V3 Docs] Remove all build warnings (#1640)
* Upgrade sphinx version to 1.7+

* Fix title overlines/underlines in autostart_systemd.rst

* Skip trying to document a method from discord.py

* Add escaped space after backtick

* Escape underscores (sphinx tries to interpret a hyperlink)

* Use fully qualified reference for class

* Fix reference in tunnel.py

* Remove python syntax highlighting in data_converter.py

For some reason sphinx couldn't lex these as python. Removing the highlighting seems like the logical solution for now, since if it wasn't being lexed, it wouldn't highlight anyway.

* Comment out static path since we're not using it right now

* Update sphinx version in docs requirements too

Would rather remove this duplication but RTD is a special snowflake
2018-05-13 20:06:52 -08:00
palmtree5
501aff41ea [V3] Bump version to 3.0.0b14 (#1629) 2018-05-13 16:24:40 -08:00
Michael H
449b1bfe9e Make checks.py manageable from a permissions cog (#1547)
* This starts setting up checks.py to handle managed permission overrides

* missing else fix

* don't bypass is_owner, ever

* 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

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

* un mix the 2 PRs (*sigh*)

* Update checks.py

remove debug prints that got lost inshuffle
2018-05-14 10:13:16 +10:00
aikaterna
4a8358ecb4 [V3 Audio] Update queue and search to use menus (#1633)
* [V3 Audio] Update queue and search to use menus

* [V3 Audio] Fix for playlist upload saving

* [V3 Audio] Add position in queue to enqueued songs

Also a bit of cleanup.

* [V3 Audio] Improvements for mobile formatting
2018-05-14 10:01:46 +10:00
Tobotimus
8f74e4dd31 [V3 Cleanup] Cleanup commands clean up after themselves (#1602)
Resolves #1572
2018-05-13 15:51:50 -08:00
Michael H
2b35d9f012 [V3 cleanup] Respect pinned messages by default (#1596)
* This sets the default behavior for `get_messages_for_deletetion()` to not include pinned messages, while providing a way to override that

resolves #1589

* actually make commands parse for pinned deletion

* fix capitalization
2018-05-13 15:49:45 -08:00
palmtree5
35001107e0 [V3 Streams] cache stream alert messages across restarts (#1630)
* [V3 Streams] cache stream alert messages across restarts

* Add some stuff to debug this

* More debug stuff

* More debug stuff

* Actually save when updating a stream alert

* Remove debug stuff

Fixes #1620
2018-05-14 09:42:28 +10:00
Leo Garcia
a7d7b90ae8 [V3] Removed py 3.6 warning for Windows (#1622)
I believe we've fixed this awhile ago.
2018-05-14 09:32:41 +10:00
Tobotimus
119ba7ef8b [V3 ModLog] Fix [p]reason when the modlog case has no moderator (#1604) 2018-05-14 09:24:17 +10:00
palmtree5
28bbe9c646 [V3 i18n] add a NoneType check on trying to normalize a string (#1632)
Fixes #1631
2018-05-14 09:10:38 +10:00
Michael H
8739c04024 [V3] Ping changes (#1618)
* moves ping to core commands
defaults ping behavior to reacting with a ping pong paddle with ball
adds an optional boolean flag to ping to get the avg latency from the bot
(strikes a middle ground with intended behavior from dev standpoint, and how users want it)

* casing for @Kowlin

* use correct check for permissions

* remove latency
2018-05-13 15:03:17 -08:00
Tobotimus
57240d25b9 [V3] Update trivia version and allow installing in develop mode (#1635)
* [V3 Trivia] Update trivia version to >1.1

* Use actually working trivia version
2018-05-13 13:43:16 -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
Michael H
1e60d1c265 [V3] adds a permissions check for embed_links in ctx.embed_requested (#1619) 2018-05-10 14:35:18 -08:00
Tobotimus
b7cd097c43 [V3 Trivia] Lock trivia version to <1.1 (#1621) 2018-05-10 13:20:40 -08:00
bobloy
6c934b02e6 [V3] Fix help's help (#1606) 2018-05-10 13:14:44 -08:00
Kowlin
fcb9b40b43 [V3] Fixed [p]servers bug (#1617)
* Fixed servers bug

* Added protections against going negative
2018-05-10 13:10:42 -08:00
Michael H
7a6884e4b1 [V3] Mark 3.7 as unsupported in setup.py (#1623) 2018-05-10 13:04:20 -08:00
Michael H
e86698cfeb [V3] Update some user facing info (remove old, outdated info) (#1613)
* remove outdated link in favor of in docstring docsumentation

* Update default Downloader repo url to org repo url (don't rely on github redirect)
2018-05-08 22:27:38 +02:00
Bakersbakebread
53650aefa6 [Docs] Added self (#1608) 2018-05-08 19:47:11 +02:00
Tobotimus
1d80a0cad1 [V3 Mod] Fix issue with unmuting, again (#1603)
* [V3 Mod] Fix issue with unmuting, again

Resolves #1595

* Fix typo
2018-05-07 13:31:14 +02:00
retke
f6d27a0f43 [V3 Parser] Added --load-cogs flag (#1601)
* [V3 Parser] Added --load-cogs flag

* Removed old PR data

* Removed old PR data

* Removed old PR data

* Slightly reword help for flag

* Stick to convention for checking if sequence is empty

* Fix some logic errors

* Don't print packages which failed to load
2018-05-07 15:01:44 +10:00
Wyn
f71aa9dd21 [V3 Docs] Autostart (#1599)
Moved note to the top, added how to access red log.
2018-05-05 15:43:26 -08:00
palmtree5
1cb5394e96 [V3] bump version to 3.0.0b13 (#1583) 2018-05-04 08:48:33 +02:00
palmtree5
2b2dbd25f7 [V3 Help] fix issue with non-existent subcommands (#1565) 2018-05-03 22:19:24 -08:00
Michael H
dd4cd0eeb1 provide an extra method for helping wor with embed_requested (#1558) 2018-05-04 08:16:24 +02:00
palmtree5
ee7b0cf730 [V3 Utils] fix files not being chmodded (#1578) 2018-05-04 08:10:56 +02:00
retke
95ef5d6348 [V3 Launcher] Reinstall Red option (#1536)
* [V3 Launcher] Reinstall Red option

* [V3 Setup] Divided remove_instance function

* Removing changes from another PR

* Indent fails fix

* use remove_instance_interaction for --delete

* Fix some issues with remove_instance

removed `index: int` because what's being passed there is a string
data -> instance_data

* bug fixes, working version
2018-05-04 08:01:37 +02:00
bobloy
23192b9ef6 simple_embed doesn't take author (#1555)
Simple embed doesn't use ctx.author as author
2018-05-04 07:27:44 +02:00
Michael H
7cd98c8a63 Report fixes + improvements (#1541)
* WIP

* fix perms issue

* better

* more work

* working

* working, tessted

* docs

* mutable default fix
2018-05-04 06:38:58 +02:00
palmtree5
fca7686701 [V3 Core] fix 3.5-specific issue with [p]backup (#1586) (#1588) 2018-05-04 06:18:44 +02:00
Michael H
be767478f4 allow deletion based on user ID (actually this time) (#1561) 2018-05-04 06:15:27 +02:00
palmtree5
b3ad5d90ed [V3 Core] fix a couple issues with [p]servers (#1580) 2018-05-04 06:05:09 +02:00
palmtree5
fb093b7411 [V3 Utils] Menu system (#1566)
* [V3 Utils] start on a menu system

* Fix conflicting names

* [V3 Menus] change order of default controls

* [V3 Menus] add a message check to the react check

* Add a note about original source and who ported

* Compare message ids, not the objects themselves
2018-05-04 05:54:30 +02:00
palmtree5
e4ea3110e3 [V3 Warnings] fix several bugs found (#1577) 2018-05-04 05:46:59 +02:00
aikaterna
79676c4f72 Playlist additions and cleanup (#1579)
Add playlist append, create, remove, and upload.
2018-05-04 05:43:00 +02:00
Wyn
d61827b92c [V3 Docs] Fixed broken link (#1567)
Guide migration went into a maze, this should fix it.
2018-05-04 05:33:01 +02:00
palmtree5
1f1f46c70f [V3] move to multiple issue/pr templates (#1585) 2018-05-04 03:58:30 +02:00
Wyn
9188e4a7ec [V3 Info] Don't rely on redirect (#1581)
* [V3 Info] Don't rely on redirect

Http -> Https

* Update core_commands.py

Use existing variable instead of new string

* Update events.py

Remove redirect, url only reference
2018-05-02 10:35:48 +02:00
Redjumpman
e5a780eb0c Update mod.py (#1582)
Update doc-strings to properly format in the help text.
2018-05-01 09:13:25 +02:00
palmtree5
d8c85a2b15 [V3 Audio] fix zombie process on unload (#1575) 2018-04-29 08:19:49 +02:00
palmtree5
83080bc5a2 [V3 Mod] fix issue with unmuting (#1568) 2018-04-28 13:39:06 +10:00
Wyn
233bfc59ac [V3 Docs Arch] Upgrade dependencies (#1553)
-u parameter added to pacman for upgrading dependencies so we don't get partial upgrades.
2018-04-19 13:29:44 -08:00
Bakersbakebread
c606caf3a3 Grammar Change With -> Will (#1539)
Any message successfully forward WILL be marked...
2018-04-18 12:28:12 +02:00
palmtree5
efdf69552f [V3] Beta 12 release (#1525)
* [V3] update translations from Crowdin

* [V3] bump version to 3.0.0b12
2018-04-16 19:05:21 -08:00
Michael H
38531bf95c [V3 Tunnel utils] Better handling of tunnel instances (#1538)
* Better handling of tunnel instances

* docs
2018-04-16 19:02:38 -08:00
Wyn
6d714db928 [V3 Audio] Add Lavalink Jar build to settings (#1430)
* [V3 Audio] Add Lavalink Jar build to settings

Added Lavalink Jar build to Lavalink settings since build number now stored in config.

* Forgot import

Added import

* Left align

K im done for real this time
2018-04-16 18:57:17 -08:00
Michael H
f8e7497695 [V3] Remove old usage of type tuples with config (#1518) 2018-04-16 21:41:13 -04:00
TheFixed
d6ef812704 [V3 Admin] fix typo (#1537)
it's -> it is or it has
its -> possessive form of it
2018-04-16 17:36:38 -08:00
Will
4f81bc9621 [V3 CogManager] Fix duplicate paths/reorderpath not working (#1501)
* Fix duplicate paths/reorderpath not working

* Make remove path use the visible paths not the internals.
2018-04-16 21:21:31 -04:00
aikaterna
59276ce2a5 [V3 Audio] External lavalink server settings, playlist saving & recall, bugfixes (#1528)
* Add settings for external lavalink servers

* Add external lavalink server to settings display

* Add simple error handling

* Remove future permissions conflict

Assuming base Red permissions will be accessed with the 'p' command in the future

* Update prev to set requester to user instead of id

* Various fixes

Jukebox: Plebs not in a channel will not have the song cost deducted before the warning to join a channel first.
DJ role: Finer grained permissions for plebs that are alone: they can use prev (if shuffle is off), skip, pause, resume

* Update permissions

* Add track number to footer when queueing

* Add basic playlist saving

More subcommands to come later

* Check if user is not in voice

* Restrict playlist deletion to author and mods

* Add playlist info command
2018-04-17 00:42:32 +02:00
Michael H
96791bd72b [V3] supress pynacl warning (#1508)
* supress pynacl warning

* move the supression to __init__.py

* ..

* Revert "move the supression to __init__.py"

This reverts commit ee7ba9c968.

Doesn't properly work here

* Changes are fine in __init__.py

Needs a module level import in __main__.py or the console scripts generated by pip setup don't ever run the code in __init__

* supress pynacl warning

* puts the changes back again to avoid duplicate module import warning
2018-04-16 14:32:05 -08:00
Michael H
8756b22f5a [V3] Report Tool (#1281)
* Okay, let's fix the issues here hopefully.

* This is working now

* Unfinished, and needs a lot of testing.

* more work

* working

* minor thing to remove

* improve i18n and usage feedback
2018-04-16 13:56:14 -08: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
retke
017c8a6900 [V3 Mod] Denying add_reactions permission to muted users (#1495)
* denied permission of adding reactions to muted users

* Track both send_messages and add_reactions perms
2018-04-16 12:17:03 -08:00
Michael H
afe4af0dc2 [V3 Launcher] fix issue with instance removal via launcher (#1535)
* handle issue

* or it would have if I had put it on the right line

* no more making patches from my phone
2018-04-16 11:57:57 -08:00
bobloy
fb8e4430ac [V3] Fix Cleanup loop (#1533)
* prevent infinite loop

* pep8 updates

Assorted pep8 updates to retrigger Travis

* Revert "pep8 updates"

This reverts commit d0c7f8b808.
2018-04-16 11:51:01 -08:00
Bakersbakebread
7499f5dbfa [V3 Mod utils] Beihnd -> behind typo (#1531)
Fixed typo
2018-04-16 11:41:11 -08:00
bobloy
c7b58aa65b [V3 Economy] guild -> server in [p]bank reset (#1530) 2018-04-16 11:37:29 -08:00
bobloy
705d9b8238 [V3] guild->server (#1529)
Mostly string renames
customcom now recognized {guild} and {server}
2018-04-16 11:32:51 -08:00
bobloy
1bc650b0f9 [V3] Mod.py guild -> server (#1522)
* mod guild->server naming

* typo
2018-04-16 10:13:26 +02:00
palmtree5
580aeea4e2 [V3 Instance setup] fix an issue getting credentials to convert Mongo to JSON (#1514)
* [V3 Instance setup] fix an issue getting credentials to convert Mongo to JSON

* Attempt a fix at data conversion issues
2018-04-16 10:03:21 +02:00
palmtree5
8495824843 [V3 Core] unhide [p]embedset (#1523) 2018-04-16 09:59:34 +02:00
aikaterna
18bb3611fa [V3 Economy] Add credits name to payday (#1496) 2018-04-15 15:23:09 -08:00
bobloy
9f7bf8d1a2 [V3 Launcher] don't get cli flags if no instances are found (#1497)
Don't get cli flags unless there is an instance to get
2018-04-15 15:20:59 -08:00
Michael H
82146eda3d [V3/docs] New Audio, remove old reqs... (#1503)
* typo fix

* update docs with up to date reqs (remove old) and reccommend venv usage

* remove youtube_dl from reqs

* adding the mac doc update after verifying correctness

* venv installation required for py3.5 ...

* remove venv stuff, that can be handled on a unified page in a later PR
2018-04-15 14:44:16 -08:00
Sebass13
d75881e1a3 [V3 Economy] Add per-role payouts (#1488) 2018-04-15 14:40:32 -08:00
Will
5be967e8c5 [V3 Audio] Harden Lavalink boot sequence (#1498)
* Do a bit of hardening

* Loop not asyncio

* Don't use new asyncio coolness

* I hate you all

* Muck up everything

* Fix version comparisons
2018-04-15 14:01:56 -08:00
Kowlin
d9fa875d84 [V3] Splitted deployment stage into their own stages. (#1524)
* Splitted deplyoment stages into their own stage.

* Updated Codeowners to reflect meta files.
2018-04-13 13:16:36 -08:00
rngesus-wept
04f93c98d2 [V3] Add .pytest_cache to .gitignore (#1520) 2018-04-11 14:45:53 -08:00
palmtree5
402f6c19e7 [V3 Core] fix some issues with [p]set and [p]set nickname (#1494)
* [V3 Core] fix AttributeError in [p]set

* Fix [p]set nickname

* Make the nickname param on [p]set nickname optional
2018-04-04 12:42:10 +02:00
Michael H
84b0df0437 [V3 Data Converter] Python3.5 compatibility issue patch (#1491)
* python3.5 patch

* urf -> utf
2018-04-02 22:17:40 -04:00
palmtree5
9f4a7f7623 [V3] Bump version to 3.0.0b11 (#1483) 2018-04-02 17:19:50 -08:00
retke
10012c1e16 [V3] added --version flag (#1479) 2018-04-02 17:17:19 -08: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
Will
d79d8fbbea [V3] Fix logic issue with [p]load (#1460) 2018-04-02 17:09:17 -08:00
palmtree5
772590c41c [V3] Add settings displays to [p]set and [p]bankset (#1475) 2018-04-02 21:01:43 -04:00
aikaterna
d9c71bddb8 [V3 Audio] Add voteskip and DJ role (#1473)
* [V3 Audio] Add voteskip and DJ role

* Fix connection time storage for audiostats

* Update pause command for more explicit handling

Partially fixes #1478. Users will need to use pause twice before resuming until issue no. 20 on the Red-Lavalink repo is addressed.

* Update pause command

* Update pause command

* Add jukebox mode

Adds a price option for enqueuing songs. If DJ mode is active when jukebox mode is active, no one is charged credits as mods are exempt and plebs can't queue songs without the DJ role.
2018-04-02 20:53:37 -04:00
Will
29ce2401ca [V3 Config] Fix unloading and implement singleton driver (#1458)
* Add the identifier as an initialization parameter

* Remove config object singleton and opt for a shared JSON datastore

* Fix bot unloading to deal with memory leaks

* Fix tests

* Fix clear all bug
2018-04-02 16:47:27 -08:00
Will
720ef38886 [V3 Help] Fix the two missing characters in help (#1456) 2018-04-02 16:29:44 -08:00
Will
728ab6c8c1 [V3 Downloader] Allow for requiring minimum python version (#1455) 2018-04-02 16:26:07 -08:00
Will
935028addc [V3 Downloader] Add install messages from info.json (#1453) 2018-04-02 16:23:55 -08:00
palmtree5
e70e22d557 [V3 Image] Actually check if a client ID is set before making request (#1485)
* [V3 Image] actually check if a client id is set before making request

* Clarify imgurcreds docstring + drop guild_only from [p]imgur

* Fix the actual problem (bad urls)

* needs to be params not data
2018-04-02 20:14:16 -04:00
palmtree5
f3db4b5cb0 [V3 Modlog] Fix TypeError related to 'until' (#1487) 2018-04-02 20:09:09 -04:00
palmtree5
d60fc06379 [V3] Update translations from Crowdin (#1490) 2018-04-02 19:39:07 -04:00
Wyn
a813260717 [V3 Audio] Bump timeout connecting to Lavalink (#1474)
* [V3 Audio] Bump timeout connecting to Lavalink

Lavalink server can take 20-35 seconds to start, bumped to 50 seconds for good measure.

* Update audio.py

Added proper timeout

* Update __init__.py

Removed old timeout
2018-04-02 19:36:26 -04:00
bobloy
10d01df7dd [V3 General] Text fix in flip command (#1489) 2018-04-02 12:43:11 -08:00
palmtree5
8eb075fa86 [V3 Core] Embed toggling support (#1467)
* [V3 CogManagerUI] implement text-only support in [p]cogs

* Change page length to 1800 + workaround for pages starting with delim

* [V3 Core] text mode support for [p]contact and [p]dm

* Implement text-only support in modlog and fix everything that broke because of it

* Fix modlog stuff in filter too

* Fix tests

* Implement optional embed support in [p]help

* move to .format
2018-03-28 20:15:51 -04:00
palmtree5
c2e7bfa641 [V3 Instance setup] Implement backup support for instances using Mongo (#1470)
* [V3 Instance setup] import backup support for instances using Mongo

* remove_instance is now a coroutine + remove NIE

* move Mongo import down

* move another import
2018-03-28 20:12:26 -04:00
palmtree5
2f23244937 [V3 Core] Add [p]backup (#1471)
* [V3 Core] add [p]backup

* move imports
2018-03-28 19:53:27 -04:00
palmtree5
9ecea9e1d5 [V3 instance setup] Warn and request confirmation if instance name already in use (#1469) 2018-03-28 19:13:34 -04:00
palmtree5
61b34e835e [V3] Drop an unnecessary if in embed_requested (#1468) 2018-03-28 19:10:02 -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
palmtree5
45ee4755a6 [V3 Core] Fix url sent when doing [p]invite (#1461) 2018-03-24 17:24:06 -04:00
palmtree5
59281afe90 [V3 Instance setup] cog identifiers are strings, not ints (#1448) 2018-03-22 19:11:27 -04:00
retke
cf5a63a5d5 [V3] Set token command fix (#1449)
* [V3] Add set token command

* DM check

* warning message + delete if token isn't send in DM

* Update string formatting

* fix condition invertion
2018-03-22 19:08:57 -04:00
Will
96869074c3 [V3 Docs] Third time's the charm (#1447)
* Get the right sphinx version

* Add mongo extra
2018-03-20 21:14:25 -04:00
Will
c107d5fa7f [V3 Docs] Really fix it this time (#1444) 2018-03-20 21:08:01 -04:00
Will
bed56e8891 [V3 Docs] Add new RTD yaml file (#1443) 2018-03-20 20:58:48 -04:00
575 changed files with 20503 additions and 10034 deletions

10
.github/CODEOWNERS vendored
View File

@@ -21,6 +21,9 @@ redbot/core/rpc.py @tekulvw
redbot/core/sentry_setup.py @Kowlin @tekulvw redbot/core/sentry_setup.py @Kowlin @tekulvw
redbot/core/utils/chat_formatting.py @tekulvw redbot/core/utils/chat_formatting.py @tekulvw
redbot/core/utils/mod.py @palmtree5 redbot/core/utils/mod.py @palmtree5
redbot/core/utils/data_converter.py @mikeshardmind
redbot/core/utils/antispam.py @mikeshardmind
redbot/core/utils/tunnel.py @mikeshardmind
# Cogs # Cogs
redbot/cogs/admin/* @tekulvw redbot/cogs/admin/* @tekulvw
@@ -38,6 +41,9 @@ redbot/cogs/mod/* @palmtree5
redbot/cogs/modlog/* @palmtree5 redbot/cogs/modlog/* @palmtree5
redbot/cogs/streams/* @Twentysix26 @palmtree5 redbot/cogs/streams/* @Twentysix26 @palmtree5
redbot/cogs/trivia/* @Tobotimus redbot/cogs/trivia/* @Tobotimus
redbot/cogs/dataconverter/* @mikeshardmind
redbot/cogs/reports/* @mikeshardmind
redbot/cogs/permissions/* @mikeshardmind
# Docs # Docs
docs/* @tekulvw @palmtree5 docs/* @tekulvw @palmtree5
@@ -47,3 +53,7 @@ setup.py @tekulvw
redbot/__init__.py @tekulvw redbot/__init__.py @tekulvw
redbot/__main__.py @tekulvw redbot/__main__.py @tekulvw
redbot/setup.py @tekulvw redbot/setup.py @tekulvw
# Others
.travis.yml @Kowlin
crowdin.yml @Kowlin

View File

@@ -1,14 +1,34 @@
# Introduction # Contents
### Welcome! * [1. Introduction](#1-introduction)
First off, thank you for contributing to the further development of Red. We're always looking for new ways to improve our project and we appreciate any help you can give us. * [1.1 Why do these guidelines exist?](#11-why-do-these-guidelines-exist)
* [1.2 What kinds of contributions are we looking for?](#12-what-kinds-of-contributions-are-we-looking-for)
* [2. Ground Rules](#2-ground-rules)
* [3. Your First Contribution](#3-your-first-contribution)
* [4. Getting Started](#4-getting-started)
* [4.1 Setting up your development environment](#41-setting-up-your-development-environment)
* [4.2 Testing](#42-testing)
* [4.3 Style](#43-style)
* [4.4 Make](#44-make)
* [4.5 Keeping your dependencies up to date](#45-keeping-your-dependencies-up-to-date)
* [4.6 To contribute changes](#46-to-contribute-changes)
* [4.7 How To Report A Bug](#47-how-to-report-a-bug)
* [4.8 How To Suggest A Feature Or Enhancement](#48-how-to-suggest-a-feature-or-enhancement)
* [5. Code Review Process](#5-code-review-process)
* [5.1 Issues](#51-issues)
* [5.2 Pull Requests](#52-pull-requests)
* [5.3 Differences between "new features" and "improvements"](#53-differences-between-new-features-and-improvements)
* [6. Community](#6-community)
### Why do these guidelines exist? # 1. Introduction
**Welcome!** First off, thank you for contributing to the further development of Red. We're always looking for new ways to improve our project and we appreciate any help you can give us.
### 1.1 Why do these guidelines exist?
Red is an open source project. This means that each and every one of the developers and contributors who have helped make Red what it is today have done so by volunteering their time and effort. It takes a lot of time to coordinate and organize issues and new features and to review and test pull requests. By following these guidelines you will help the developers streamline the contribution process and save them time. In doing so we hope to get back to each and every issue and pull request in a timely manner. Red is an open source project. This means that each and every one of the developers and contributors who have helped make Red what it is today have done so by volunteering their time and effort. It takes a lot of time to coordinate and organize issues and new features and to review and test pull requests. By following these guidelines you will help the developers streamline the contribution process and save them time. In doing so we hope to get back to each and every issue and pull request in a timely manner.
### What kinds of contributions are we looking for? ### 1.2 What kinds of contributions are we looking for?
We love receiving contributions from our community. Any assistance you can provide with regards to bug fixes, feature enhancements, and documentation is more than welcome. We love receiving contributions from our community. Any assistance you can provide with regards to bug fixes, feature enhancements, and documentation is more than welcome.
# Ground Rules # 2. Ground Rules
We've made a point to use [ZenHub](https://www.zenhub.com/) (a plugin for GitHub) as our main source of collaboration and coordination. Your experience contributing to Red will be greatly improved if you go get that plugin. We've made a point to use [ZenHub](https://www.zenhub.com/) (a plugin for GitHub) as our main source of collaboration and coordination. Your experience contributing to Red will be greatly improved if you go get that plugin.
1. Ensure cross compatibility for Windows, Mac OS and Linux. 1. Ensure cross compatibility for Windows, Mac OS and Linux.
2. Ensure all Python features used in contributions exist and work in Python 3.5 and above. 2. Ensure all Python features used in contributions exist and work in Python 3.5 and above.
@@ -17,7 +37,7 @@ We've made a point to use [ZenHub](https://www.zenhub.com/) (a plugin for GitHub
5. Don't add new cogs unless specifically given approval in an issue discussing said cog idea. 5. Don't add new cogs unless specifically given approval in an issue discussing said cog idea.
6. Be welcoming to newcomers and encourage diverse new contributors from all backgrounds. See [Python Community Code of Conduct](https://www.python.org/psf/codeofconduct/). 6. Be welcoming to newcomers and encourage diverse new contributors from all backgrounds. See [Python Community Code of Conduct](https://www.python.org/psf/codeofconduct/).
# Your First Contribution # 3. Your First Contribution
Unsure of how to get started contributing to Red? Please take a look at the Issues section of this repo and sort by the following labels: Unsure of how to get started contributing to Red? Please take a look at the Issues section of this repo and sort by the following labels:
* beginner - issues that can normally be fixed in just a few lines of code and maybe a test or two. * beginner - issues that can normally be fixed in just a few lines of code and maybe a test or two.
@@ -27,35 +47,89 @@ Unsure of how to get started contributing to Red? Please take a look at the Issu
At this point you're ready to start making changes. Feel free to ask for help; everyone was a beginner at some point! At this point you're ready to start making changes. Feel free to ask for help; everyone was a beginner at some point!
# Getting Started # 4. Getting Started
### Testing
We've recently started adding unit-testing into Red. All current tests can be found in the `tests/` directory at the root level of the repository. You will need `py.test` installed in order to run them (which is already in `requirement.txt`). Tests can be run by simply calling `pytest` once you've `cd`'d into the Red repository folder.
### To contribute changes Red's repository is configured to follow a particular development workflow, using various reputable tools. We kindly ask that you stick to this workflow when contributing to Red, by following the guides below. This will help you to easily produce quality code, identify errors early, and streamline the code review process.
1. Create your own fork of the Red repository.
2. Make the changes in your own fork. ### 4.1 Setting up your development environment
The following requirements must be installed prior to setting up:
- Python 3.6
- git
- pip
- pipenv
If you're not on Windows, you can optionally install [pyenv](https://github.com/pyenv/pyenv), which will help you run tests for different python versions.
1. Fork and clone the repository to a directory on your local machine.
2. Open a command line in that directory and execute the following commands:
```bash
pip install pipenv
pipenv install --dev
```
Red, its dependencies, and all required development tools, are now installed to a virtual environment. Red is installed in editable mode, meaning that edits you make to the source code in the repository will be reflected when you run Red.
3. Activate the new virtual environment with the command:
```bash
pipenv shell
```
From here onwards, we will assume you are executing commands from within this shell. Each time you open a new command line, you should execute this command first.
Note: If you haven't used `pipenv` before but are comfortable with virtualenvs, just run `pip install pipenv` in the virtualenv you're already using and invoke the command above from the cloned Red repo. It will do the correct thing.
### 4.2 Testing
We've recently started using [tox](https://github.com/tox-dev/tox) to run all of our tests. It's extremely simple to use, and if you followed the previous section correctly, it is already installed to your virtual environment.
Currently, tox does the following, creating its own virtual environments for each stage:
- Runs all of our unit tests with [pytest](https://github.com/pytest-dev/pytest) on both python 3.5 and 3.6 (test environments `py35` and `py36` respectively)
- Ensures documentation builds without warnings, and all hyperlinks have a valid destination (test environment `docs`)
- Ensures that the code meets our style guide with [black](https://github.com/ambv/black) (test environment `style`)
To run all of these tests, just run the command `tox` in the project directory.
To run a subset of these tests, use the command `tox -e <env>`, where `<env>` is the test environment you want tox to run. The test environments are noted in the dot points above.
Your PR will not be merged until all of these tests pass.
### 4.3 Style
Our style checker of choice, [black](https://github.com/ambv/black), actually happens to be an auto-formatter. The checking functionality simply detects whether or not it would try to reformat something in your code, should you run the formatter on it. For this reason, we recommend using this tool as a formatter, regardless of any disagreements you might have with the style it enforces.
Use the command `black --help` to see how to use this tool. The full style guide is explained in detail on [black's GitHub repository](https://github.com/ambv/black). **There is one exception to this**, however, which is that we set the line length to 99, instead of black's default 88. When using `black` on the command line, simply use it like so: `black -l 99 <src>`.
Note: Python 3.6+ is required to install and run black. If you installed your development environment with Python 3.5, black will not be installed.
### 4.4 Make
You may have noticed we have a `Makefile` and a `make.bat` in the top-level directory. For now, you can do two things with them:
1. `make reformat`: Reformat all python files in the project with Black
2. `make stylecheck`: Check if any `.py` files in the project need reformatting
### 4.5 Keeping your dependencies up to date
Whenever you pull from upstream (V3/develop on the main repository) and you notice the file `Pipfile.lock` has been changed, it usually means one of the package dependencies have been updated, added or removed. To make sure you're testing and formatting with the most up-to-date versions of our dependencies, run `pipenv install --dev` again.
### 4.6 To contribute changes
1. Create a new branch on your fork
2. Make the changes
3. If you like the changes and think the main Red project could use it: 3. If you like the changes and think the main Red project could use it:
* Ensure your code follows (generally) the PEP8 Python style guide * Run tests with `tox` to ensure your code is up to scratch
* Create a Pull Request on GitHub with your changes * Create a Pull Request on GitHub with your changes
### How To Report A Bug ### 4.7 How To Report A Bug
Please see our **ISSUES.MD** for more information. Please see our **ISSUES.MD** for more information.
### How To Suggest A Feature Or Enhancement ### 4.8 How To Suggest A Feature Or Enhancement
The goal of Red is to be as useful to as many people as possible, this means that all features must be useful to anyone and any server that uses Red. The goal of Red is to be as useful to as many people as possible, this means that all features must be useful to anyone and any server that uses Red.
If you find yourself wanting a feature that Red does not already have, you're probably not alone. There's bound to be a great number of users out there needing the same thing and a lot of the features that Red has today have been added because of the needs of our users. Open an issue on our issues list and describe the feature you would like to see, how you would use it, how it should work, and why it would be useful to the Red community as a whole. If you find yourself wanting a feature that Red does not already have, you're probably not alone. There's bound to be a great number of users out there needing the same thing and a lot of the features that Red has today have been added because of the needs of our users. Open an issue on our issues list and describe the feature you would like to see, how you would use it, how it should work, and why it would be useful to the Red community as a whole.
# Code Review Process # 5. Code Review Process
We have a core team working tirelessly to implement new features and fix bugs for the Red community. This core team looks at and evaluates new issues and PRs on a daily basis. We have a core team working tirelessly to implement new features and fix bugs for the Red community. This core team looks at and evaluates new issues and PRs on a daily basis.
The decisions we make are based on a simple majority of that team or by decree of the project owner. The decisions we make are based on a simple majority of that team or by decree of the project owner.
### Issues ### 5.1 Issues
Any new issues will be looked at and evaluated for validity of a bug or for the usefulness of a suggested feature. If we have questions about your issue we will get back as soon as we can (usually in a day or two) and will try to make a decision within a week. Any new issues will be looked at and evaluated for validity of a bug or for the usefulness of a suggested feature. If we have questions about your issue we will get back as soon as we can (usually in a day or two) and will try to make a decision within a week.
### Pull Requests ### 5.2 Pull Requests
Pull requests are evaluated by their quality and how effectively they solve their corresponding issue. The process for reviewing pull requests is as follows: Pull requests are evaluated by their quality and how effectively they solve their corresponding issue. The process for reviewing pull requests is as follows:
1. A pull request is submitted 1. A pull request is submitted
@@ -66,10 +140,10 @@ Pull requests are evaluated by their quality and how effectively they solve thei
4. If any feedback is given we expect a response within 1 week or we may decide to close the PR. 4. If any feedback is given we expect a response within 1 week or we may decide to close the PR.
5. If your pull request is not vetoed and no core member requests changes then it will be approved and merged into the project. 5. If your pull request is not vetoed and no core member requests changes then it will be approved and merged into the project.
### Differences between "new features" and "improvements" ### 5.3 Differences between "new features" and "improvements"
The difference between a new feature and improvement can be quite fuzzy and the project owner reserves all rights to decide under which category your PR falls. The difference between a new feature and improvement can be quite fuzzy and the project owner reserves all rights to decide under which category your PR falls.
At a very basic level a PR is a new feature if it changes the intended way any part of the Red project currently works or if it modifies the user experience (UX) in any significant way. Otherwise, it is likely to be considered an improvement. At a very basic level a PR is a new feature if it changes the intended way any part of the Red project currently works or if it modifies the user experience (UX) in any significant way. Otherwise, it is likely to be considered an improvement.
# Community # 6. Community
You can chat with the core team and other community members about issues or pull requests in the #coding channel of the Red support server located [here](https://discord.gg/red). You can chat with the core team and other community members about issues or pull requests in the #coding channel of the Red support server located [here](https://discord.gg/red).

25
.github/ISSUE_TEMPLATE/command_bug.md vendored Normal file
View File

@@ -0,0 +1,25 @@
# Command bugs
<!--
Did you find a bug with a command? Fill out the following:
-->
#### Command name
<!-- Replace this line with the name of the command -->
#### What cog is this command from?
<!-- Replace this line with the name of the cog -->
#### What were you expecting to happen?
<!-- Replace this line with a description of what you were expecting to happen -->
#### What actually happened?
<!-- Replace this line with a description of what actually happened. Include any error messages -->
#### How can we reproduce this issue?
<!-- Replace with numbered steps to reproduce the issue -->

35
.github/ISSUE_TEMPLATE/feature_req.md vendored Normal file
View File

@@ -0,0 +1,35 @@
# Feature request
<!-- This template is for feature requests. Please fill out the following: -->
#### Select the type of feature you are requesting:
<!-- To check a box, replace the space between the [] with a x -->
- [ ] Cog
- [ ] Command
- [ ] API functionality
#### Describe your requested feature
<!--
Feel free to describe in as much detail as you wish.
If you are requesting a cog to be included in core:
- Describe the functionality in as much detail as possible
- Include the command structure, if possible
- Please note that unless it's something that should be core functionality,
we reserve the right to reject your suggestion and point you to our cog
board to request it for a third-party cog
If you are requesting a command:
- Include what cog it should be in and a name for the command
- Describe the intended functionality for the command
- Note any restrictions on who can use the command or where it can be used
If you are requesting API functionality:
- Describe what it should do
- Note whether it is to extend existing functionality or introduce new functionality
-->

21
.github/ISSUE_TEMPLATE/other_bug.md vendored Normal file
View File

@@ -0,0 +1,21 @@
# Other bugs
<!--
Did you find a bug with something other than a command? Fill out the following:
-->
#### What were you trying to do?
<!-- Replace this line with a description of what you were trying to do -->
#### What were you expecting to happen?
<!-- Replace this line with a description of what you were expecting to happen -->
#### What actually happened?
<!-- Replace this line with a description of what actually happened. Include any error messages -->
#### How can we reproduce this issue?
<!-- Replace with numbered steps to reproduce the issue -->

14
.github/PULL_REQUEST_TEMPLATE/bugfix.md vendored Normal file
View File

@@ -0,0 +1,14 @@
# Bugfix request
<!--
To be used for pull requests that fix a bug
-->
#### Describe the bug being fixed
<!--
If an issue exists for the bug, mention
that this PR fixes that issue
-->
#### Anything we need to know about this fix?

View File

@@ -0,0 +1,20 @@
# Enhancement request
<!--
To be used for PRs which enhance existing features
-->
#### Describe the enhancement
<!--
Describe what your changes do.
If adding commands, describe any restrictions on their usage.
- For example, who can use the command? Where can it be used?
-->
#### Does this enhancement break existing functionality?
<!-- To check a box, replace the space between the [] with a x -->
- [ ] Yes
- [ ] No

View File

@@ -0,0 +1,21 @@
# New feature addition
<!--
To be used for PRs which add a new feature
Examples of this include new APIs, new core cogs, etc.
-->
#### What type of feature is this?
<!-- To check a box, replace the space between the [] with a x -->
- [ ] New core cog
- [ ] New API
- [ ] Other
#### Describe the feature
<!--
If you are adding a cog, describe its commands in detail (functionality, usage restrictions, etc).
If the new feature introduces new requirements, please try to explain why they are necessary.
-->

View File

@@ -0,0 +1,16 @@
# New release
<!--
To be used by collaborators for doing releases.
Most contributors will not need to use this.
-->
#### Version
#### Has a draft release been created for this?
- [ ] Yes
- [ ] No

View File

@@ -0,0 +1,5 @@
# Translations update
<!--
Used for PRs updating translations from Crowdin
-->

2
.gitignore vendored
View File

@@ -156,3 +156,5 @@ ENV/
# mypy # mypy
.mypy_cache/ .mypy_cache/
# pytest
.pytest_cache/

13
.readthedocs.yml Normal file
View File

@@ -0,0 +1,13 @@
formats:
- pdf
build:
image: latest
requirements_file: docs/requirements.txt
python:
version: 3.6
pip_install: true
extra_requirements:
- mongo

View File

@@ -5,28 +5,31 @@ notifications:
email: false email: false
python: python:
- 3.5.3 - 3.6.5
- 3.6.1 env:
global:
PIPENV_IGNORE_VIRTUALENVS=1
matrix:
- TOXENV=py
- TOXENV=docs
- TOXENV=style
install: install:
- echo "git+https://github.com/Rapptz/discord.py.git@rewrite#egg=discord.py[voice]" >> requirements.txt - pip install --upgrade pip pipenv
- pip install -r requirements.txt - pipenv install --dev
- pip install .[test]
script: script:
- python -m compileall ./redbot/cogs - pipenv run tox
- python -m pytest
jobs: jobs:
include: include:
- stage: Deployment
# These jobs only occur on tag creation for V3/develop if the prior ones succeed
- stage: PyPi Deployment
if: tag IS present if: tag IS present
python: 3.5.3 python: 3.6.5
env: env:
- DEPLOYING=true - DEPLOYING=true
before_deployment:
- curl https://artifacts.crowdin.com/repo/GPG-KEY-crowdin | sudo apt-key add -
- echo "deb https://artifacts.crowdin.com/repo/deb/ /" | sudo tee -a /etc/apt/sources.list
- sudo apt-get update -qq
- sudo apt-get install -y crowdin
deploy: deploy:
- provider: pypi - provider: pypi
user: Red-DiscordBot user: Red-DiscordBot
@@ -36,13 +39,24 @@ jobs:
on: on:
repo: Cog-Creators/Red-DiscordBot repo: Cog-Creators/Red-DiscordBot
branch: V3/develop branch: V3/develop
python: 3.5.3 python: 3.6.5
tags: true
- provider: script
script: python3 ./generate_strings.py
skip_cleanup: true
on:
repo: Cog-Creators/Red-DiscordBot
branch: V3/develop
python: 3.5.3
tags: true tags: true
- stage: Crowdin Deployment
if: tag IS present
python: 3.6.5
env:
- DEPLOYING=true
before_deploy:
- curl https://artifacts.crowdin.com/repo/GPG-KEY-crowdin | sudo apt-key add -
- echo "deb https://artifacts.crowdin.com/repo/deb/ /" | sudo tee -a /etc/apt/sources.list
- sudo apt-get update -qq
- sudo apt-get install -y crowdin
deploy:
- provider: script
script: python3 ./generate_strings.py
skip_cleanup: true
on:
repo: Cog-Creators/Red-DiscordBot
branch: V3/develop
python: 3.6.5
tags: true

4
Makefile Normal file
View File

@@ -0,0 +1,4 @@
reformat:
black -l 99 `git ls-files "*.py"`
stylecheck:
black --check -l 99 `git ls-files "*.py"`

20
Pipfile Normal file
View File

@@ -0,0 +1,20 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
"discord.py" = { git = 'git://github.com/Rapptz/discord.py', ref = 'rewrite', editable = true}
"e1839a8" = {path = ".", editable = true}
[dev-packages]
tox = "*"
pytest = "*"
pytest-asyncio = "*"
sphinx = ">1.7"
sphinxcontrib-asyncio = "*"
sphinx-rtd-theme = "*"
black = {version = "*", python_version = ">= '3.6'"}
[pipenv]
allow_prereleases = true

467
Pipfile.lock generated Normal file
View File

@@ -0,0 +1,467 @@
{
"_meta": {
"hash": {
"sha256": "d340e4a19777736703970e45766d05d67b973db38b87382b6ef8696cb53abb60"
},
"pipfile-spec": 6,
"requires": {},
"sources": [
{
"name": "pypi",
"url": "https://pypi.org/simple",
"verify_ssl": true
}
]
},
"default": {
"aiohttp": {
"hashes": [
"sha256:129d83dd067760cec3cfd4456b5c6d7ac29f2c639d856884568fd539bed5a51f",
"sha256:33c62afd115c456b0cf1e890fe6753055effe0f31a28321efd4f787378d6f4ab",
"sha256:666756e1d4cf161ed1486b82f65fdd386ac07dd20fb10f025abf4be54be12746",
"sha256:9705ded5a0faa25c8f14c6afb7044002d66c9120ed7eadb4aa9ca4aad32bd00c",
"sha256:af5bfdd164256118a0a306b3f7046e63207d1f8cba73a67dcc0bd858dcfcd3bc",
"sha256:b80f44b99fa3c9b4530fcfa324a99b84843043c35b084e0b653566049974435d",
"sha256:c67e105ec74b85c8cb666b6877569dee6f55b9548f982983b9bee80b3d47e6f3",
"sha256:d15c6658de5b7783c2538407278fa062b079a46d5f814a133ae0f09bbb2cfbc4",
"sha256:d611ebd1ef48498210b65486306e065fde031040a1f3c455ca1b6baa7bf32ad3",
"sha256:dcc7e4dcec6b0012537b9f8a0726f8b111188894ab0f924b680d40b13d3298a0",
"sha256:de8ef106e130b94ca143fdfc6f27cda1d8ba439462542377738af4d99d9f5dd2",
"sha256:eb6f1405b607fff7e44168e3ceb5d3c8a8c5a2d3effe0a27f843b16ec047a6d7",
"sha256:f0e2ac69cb709367400008cebccd5d48161dd146096a009a632a132babe5714c"
],
"version": "==2.2.5"
},
"appdirs": {
"hashes": [
"sha256:9e5896d1372858f8dd3344faf4e5014d21849c756c8d5701f78f8a103b372d92",
"sha256:d8b24664561d0d34ddfaec54636d502d7cea6e29c3eaf68f3df6180863e2166e"
],
"version": "==1.4.3"
},
"async-timeout": {
"hashes": [
"sha256:00cff4d2dce744607335cba84e9929c3165632da2d27970dbc55802a0c7873d0",
"sha256:9093db5b8ddbe4b8f6885d1a6e0ad84ae3155464cbf6877c387605244c285f3c"
],
"version": "==2.0.1"
},
"chardet": {
"hashes": [
"sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae",
"sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691"
],
"version": "==3.0.4"
},
"colorama": {
"hashes": [
"sha256:463f8483208e921368c9f306094eb6f725c6ca42b0f97e313cb5d5512459feda",
"sha256:48eb22f4f8461b1df5734a074b57042430fb06e1d61bd1e11b078c0fe6d7a1f1"
],
"version": "==0.3.9"
},
"discord.py": {
"editable": true,
"git": "git://github.com/Rapptz/discord.py",
"ref": "rewrite"
},
"distro": {
"hashes": [
"sha256:224041cef9600e72d19ae41ba006e71c05c4dc802516da715d7fda55ba3d8742",
"sha256:6ec8e539cf412830e5ccf521aecf879f2c7fcf60ce446e33cd16eef1ed8a0158"
],
"version": "==1.3.0"
},
"e1839a8": {
"editable": true,
"path": "."
},
"funcsigs": {
"hashes": [
"sha256:330cc27ccbf7f1e992e69fef78261dc7c6569012cf397db8d3de0234e6c937ca",
"sha256:a7bb0f2cf3a3fd1ab2732cb49eba4252c2af4240442415b4abce3b87022a8f50"
],
"version": "==1.0.2"
},
"fuzzywuzzy": {
"hashes": [
"sha256:d40c22d2744dff84885b30bbfc07fab7875f641d070374331777a4d1808b8d4e",
"sha256:ecf490216fb4d76b558a03042ff8f45a8782f17326caca1384d834cbaa2c7e6f"
],
"version": "==0.16.0"
},
"idna": {
"hashes": [
"sha256:2c6a5de3089009e3da7c5dde64a141dbc8551d5b7f6cf4ed7c2568d0cc520a8f",
"sha256:8c7309c718f94b3a625cb648ace320157ad16ff131ae0af362c9f21b80ef6ec4"
],
"version": "==2.6"
},
"jsonrpcserver": {
"hashes": [
"sha256:ab8013cdee3f65d59c5d3f84c75be76a3492caa0b33ecaa3f0f69906cf3d9e92"
],
"version": "==3.5.4"
},
"jsonschema": {
"hashes": [
"sha256:000e68abd33c972a5248544925a0cae7d1125f9bf6c58280d37546b946769a08",
"sha256:6ff5f3180870836cae40f06fa10419f557208175f13ad7bc26caa77beb1f6e02"
],
"version": "==2.6.0"
},
"multidict": {
"hashes": [
"sha256:1a1d76374a1e7fe93acef96b354a03c1d7f83e7512e225a527d283da0d7ba5e0",
"sha256:1d6e191965505652f194bc4c40270a842922685918a4f45e6936a6b15cc5816d",
"sha256:295961a6a88f1199e19968e15d9b42f3a191c89ec13034dbc212bf9c394c3c82",
"sha256:2be5af084de6c3b8e20d6421cb0346378a9c867dcf7c86030d6b0b550f9888e4",
"sha256:2eb99617c7a0e9f2b90b64bc1fb742611718618572747d6f3d6532b7b78755ab",
"sha256:4ba654c6b5ad1ae4a4d792abeb695b29ce981bb0f157a41d0fd227b385f2bef0",
"sha256:5ba766433c30d703f6b2c17eb0b6826c6f898e5f58d89373e235f07764952314",
"sha256:a59d58ee85b11f337b54933e8d758b2356fcdcc493248e004c9c5e5d11eedbe4",
"sha256:a6e35d28900cf87bcc11e6ca9e474db0099b78f0be0a41d95bef02d49101b5b2",
"sha256:b4df7ca9c01018a51e43937eaa41f2f5dce17a6382fda0086403bcb1f5c2cf8e",
"sha256:bbd5a6bffd3ba8bfe75b16b5e28af15265538e8be011b0b9fddc7d86a453fd4a",
"sha256:d870f399fcd58a1889e93008762a3b9a27cf7ea512818fc6e689f59495648355",
"sha256:e9404e2e19e901121c3c5c6cffd5a8ae0d1d67919c970e3b3262231175713068"
],
"version": "==4.3.1"
},
"python-levenshtein": {
"hashes": [
"sha256:033a11de5e3d19ea25c9302d11224e1a1898fe5abd23c61c7c360c25195e3eb1"
],
"version": "==0.12.0"
},
"pyyaml": {
"hashes": [
"sha256:0c507b7f74b3d2dd4d1322ec8a94794927305ab4cebbe89cc47fe5e81541e6e8",
"sha256:16b20e970597e051997d90dc2cddc713a2876c47e3d92d59ee198700c5427736",
"sha256:3262c96a1ca437e7e4763e2843746588a965426550f3797a79fca9c6199c431f",
"sha256:326420cbb492172dec84b0f65c80942de6cedb5233c413dd824483989c000608",
"sha256:4474f8ea030b5127225b8894d626bb66c01cda098d47a2b0d3429b6700af9fd8",
"sha256:592766c6303207a20efc445587778322d7f73b161bd994f227adaa341ba212ab",
"sha256:5ac82e411044fb129bae5cfbeb3ba626acb2af31a8d17d175004b70862a741a7",
"sha256:5f84523c076ad14ff5e6c037fe1c89a7f73a3e04cf0377cb4d017014976433f3",
"sha256:827dc04b8fa7d07c44de11fabbc888e627fa8293b695e0f99cb544fdfa1bf0d1",
"sha256:b4c423ab23291d3945ac61346feeb9a0dc4184999ede5e7c43e1ffb975130ae6",
"sha256:bc6bced57f826ca7cb5125a10b23fd0f2fff3b7c4701d64c439a300ce665fff8",
"sha256:c01b880ec30b5a6e6aa67b09a2fe3fb30473008c85cd6a67359a1b15ed6d83a4",
"sha256:ca233c64c6e40eaa6c66ef97058cdc80e8d0157a443655baa1b2966e812807ca",
"sha256:e863072cdf4c72eebf179342c94e6989c67185842d9997960b3e69290b2fa269"
],
"version": "==3.12"
},
"raven": {
"hashes": [
"sha256:0adae40e004dfe2181d1f2883aa3d4ca1cf16dbe449ae4b445b011c6eb220a90",
"sha256:84da75114739191bdf2388f296ffd6177e83567a7fbaf2701e034ad6026e4f3b"
],
"version": "==6.5.0"
},
"red-trivia": {
"hashes": [
"sha256:39413b9fb3f9b9362d6de1dcf69a4bf635b0f3518243f7178299b96d26cbb6a7"
],
"version": "==1.1.1"
},
"six": {
"hashes": [
"sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9",
"sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb"
],
"version": "==1.11.0"
},
"websockets": {
"hashes": [
"sha256:09dfec40e9b73e8808c39ecdbc1733e33915a2b26b90c54566afc0af546a9ec3",
"sha256:2aa6d52264cecb08d39741e8fda49f5ac4872aef02617230c84d02e861f3cc5a",
"sha256:2f5b7f3920f29609086fb0b63552bb1f86a04b8cbdcc0dbf3775cc90d489dfc8",
"sha256:3d38f76f71654268e5533b45df125ff208fee242a102d4b5ca958da5cf5fb345",
"sha256:3fcc7dfb365e81ff8206f950c86d1e73accdf3be2f9110c0cb73be32d2e7a9a5",
"sha256:4128212ab6f91afda03a0c697add261bdf6946b47928db83f07298ea2cd8d937",
"sha256:43e5b9f51dd0000a4c6f646e2ade0c886bd14a784ffac08b9e079bd17a63bcc5",
"sha256:4a932c17cb11c361c286c04842dc2385cc7157019bbba8b64808acbc89a95584",
"sha256:5ddc5fc121eb76771e990f071071d9530e27d20e8cfb804d9f5823de055837af",
"sha256:7347af28fcc70eb45be409760c2a428f8199e7f73c04a621916c3c219ed7ad27",
"sha256:85ae1e4b36aa2e90de56d211d2de36d7c093d00277a9afdd9b4f81e69c0214ab",
"sha256:8a29100079f5b91a72bcd25d35a7354db985d3babae42d00b9d629f9a0aaa8ac",
"sha256:a7e7585c8e3c0f9277ad7d6ee6ccddc69649cd216255d5e255d68f90482aeefa",
"sha256:aa42ecef3aed807e23218c264b1e82004cdd131a6698a10b57fc3d8af8f651fc",
"sha256:b19e7ede1ba80ee9de6f5b8ccd31beee25402e68bef7c13eeb0b8bc46bc4b7b7",
"sha256:c4c5b5ce2d66cb0cf193c14bc9726adca095febef0f7b2c04e5e3fa3487a97a4",
"sha256:de743ef26b002efceea7d7756e99e5d38bf5d4f27563b8d27df2a9a5cc57340a",
"sha256:e1e568136ad5cb6768504be36d470a136b072acbf3ea882303aee6361be01941",
"sha256:e8992f1db371f2a1c5af59e032d9dc7c1aa92f16241efcda695b7d955b4de0c2",
"sha256:e9c1cdbb591432c59d0b5ca64fd30b6d517024767f152fc169563b26e7bcc9da"
],
"version": "==3.4"
},
"yarl": {
"hashes": [
"sha256:605480ee43eead69ec8e8c52cdfefc79cef6379cc0e87d908cf290408c1e49af",
"sha256:7fad2530cb4ddf2b74c1e4f6f9f0e28eac482094c6542f98fd71ecf67fb4fded",
"sha256:837d866a70f1ea03005914a740bddea89a253afabd6589db981b91738768bd25",
"sha256:885e40812ff9fc80e6f28ef04ad6396e3ae583ab504b1a76301fdcec7fc9f30f",
"sha256:a5457e075eab1170141774a8c69906c223ea0088eaebd6ef91b04b33527fa905",
"sha256:baa0d3f7982fa0c03a55433109c405e79a597141f2e2d6ee7e16c03eabd74886",
"sha256:beeefbe0edd47fc8b657bf7bf44791f7a6e5b14f3de1846daf999687cb68c156",
"sha256:cf6a3d6fd3e79d3457d520c12d5d18b030d5ca5d0b205ca6481857804d8d944d",
"sha256:d07d3dc6849345b7437dc58ea49ad2a1960017386d86288550728ca38e482ddc",
"sha256:d81e45bedefccb97e4e8f7d32cfae0af1d9eadd1ae795fc420c8319c3dab2a28",
"sha256:e1da2853a92fbc7e2d0248bbfa931cd621121e70ce6dda7c1eeef3516d51b46c",
"sha256:f1201de3e93fb1efc3111c8928d9366875edefd65d77c0f6b847fe299e8e1122",
"sha256:fe0390a29b5c7e90975feefe863e3d3a851be546bd797b23f338d24a15efa920"
],
"version": "==0.18.0"
}
},
"develop": {
"alabaster": {
"hashes": [
"sha256:2eef172f44e8d301d25aff8068fddd65f767a3f04b5f15b0f4922f113aa1c732",
"sha256:37cdcb9e9954ed60912ebc1ca12a9d12178c26637abdf124e3cde2341c257fe0"
],
"version": "==0.7.10"
},
"appdirs": {
"hashes": [
"sha256:9e5896d1372858f8dd3344faf4e5014d21849c756c8d5701f78f8a103b372d92",
"sha256:d8b24664561d0d34ddfaec54636d502d7cea6e29c3eaf68f3df6180863e2166e"
],
"version": "==1.4.3"
},
"atomicwrites": {
"hashes": [
"sha256:240831ea22da9ab882b551b31d4225591e5e447a68c5e188db5b89ca1d487585",
"sha256:a24da68318b08ac9c9c45029f4a10371ab5b20e4226738e150e6e7c571630ae6"
],
"version": "==1.1.5"
},
"attrs": {
"hashes": [
"sha256:4b90b09eeeb9b88c35bc642cbac057e45a5fd85367b985bd2809c62b7b939265",
"sha256:e0d0eb91441a3b53dab4d9b743eafc1ac44476296a2053b6ca3af0b139faf87b"
],
"version": "==18.1.0"
},
"babel": {
"hashes": [
"sha256:8ce4cb6fdd4393edd323227cba3a077bceb2a6ce5201c902c65e730046f41f14",
"sha256:ad209a68d7162c4cff4b29cdebe3dec4cef75492df501b0049a9433c96ce6f80"
],
"version": "==2.5.3"
},
"black": {
"hashes": [
"sha256:4fec2566f9fbbd4a58de50a168cbe3ab952713530410d227e82e4c65d1fad946",
"sha256:5fec0f25486046b9edb97961c946412ced96021247dd1a60ecd9f0567b68b030"
],
"index": "pypi",
"markers": "python_version >= '3.6'",
"version": "==18.5b0"
},
"certifi": {
"hashes": [
"sha256:13e698f54293db9f89122b0581843a782ad0934a4fe0172d2a980ba77fc61bb7",
"sha256:9fa520c1bacfb634fa7af20a76bcbd3d5fb390481724c597da32c719a7dca4b0"
],
"version": "==2018.4.16"
},
"chardet": {
"hashes": [
"sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae",
"sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691"
],
"version": "==3.0.4"
},
"click": {
"hashes": [
"sha256:29f99fc6125fbc931b758dc053b3114e55c77a6e4c6c3a2674a2dc986016381d",
"sha256:f15516df478d5a56180fbf80e68f206010e6d160fc39fa508b65e035fd75130b"
],
"version": "==6.7"
},
"docutils": {
"hashes": [
"sha256:02aec4bd92ab067f6ff27a38a38a41173bf01bed8f89157768c1573f53e474a6",
"sha256:51e64ef2ebfb29cae1faa133b3710143496eca21c530f3f71424d77687764274",
"sha256:7a4bd47eaf6596e1295ecb11361139febe29b084a87bf005bf899f9a42edc3c6"
],
"version": "==0.14"
},
"idna": {
"hashes": [
"sha256:2c6a5de3089009e3da7c5dde64a141dbc8551d5b7f6cf4ed7c2568d0cc520a8f",
"sha256:8c7309c718f94b3a625cb648ace320157ad16ff131ae0af362c9f21b80ef6ec4"
],
"version": "==2.6"
},
"imagesize": {
"hashes": [
"sha256:3620cc0cadba3f7475f9940d22431fc4d407269f1be59ec9b8edcca26440cf18",
"sha256:5b326e4678b6925158ccc66a9fa3122b6106d7c876ee32d7de6ce59385b96315"
],
"version": "==1.0.0"
},
"jinja2": {
"hashes": [
"sha256:74c935a1b8bb9a3947c50a54766a969d4846290e1e788ea44c1392163723c3bd",
"sha256:f84be1bb0040caca4cea721fcbbbbd61f9be9464ca236387158b0feea01914a4"
],
"version": "==2.10"
},
"markupsafe": {
"hashes": [
"sha256:a6be69091dac236ea9c6bc7d012beab42010fa914c459791d627dad4910eb665"
],
"version": "==1.0"
},
"more-itertools": {
"hashes": [
"sha256:2b6b9893337bfd9166bee6a62c2b0c9fe7735dcf85948b387ec8cba30e85d8e8",
"sha256:6703844a52d3588f951883005efcf555e49566a48afd4db4e965d69b883980d3",
"sha256:a18d870ef2ffca2b8463c0070ad17b5978056f403fb64e3f15fe62a52db21cc0"
],
"version": "==4.2.0"
},
"packaging": {
"hashes": [
"sha256:e9215d2d2535d3ae866c3d6efc77d5b24a0192cce0ff20e42896cc0664f889c0",
"sha256:f019b770dd64e585a99714f1fd5e01c7a8f11b45635aa953fd41c689a657375b"
],
"version": "==17.1"
},
"pluggy": {
"hashes": [
"sha256:7f8ae7f5bdf75671a718d2daf0a64b7885f74510bcd98b1a0bb420eb9a9d0cff",
"sha256:d345c8fe681115900d6da8d048ba67c25df42973bda370783cd58826442dcd7c",
"sha256:e160a7fcf25762bb60efc7e171d4497ff1d8d2d75a3d0df7a21b76821ecbf5c5"
],
"version": "==0.6.0"
},
"py": {
"hashes": [
"sha256:29c9fab495d7528e80ba1e343b958684f4ace687327e6f789a94bf3d1915f881",
"sha256:983f77f3331356039fdd792e9220b7b8ee1aa6bd2b25f567a963ff1de5a64f6a"
],
"version": "==1.5.3"
},
"pygments": {
"hashes": [
"sha256:78f3f434bcc5d6ee09020f92ba487f95ba50f1e3ef83ae96b9d5ffa1bab25c5d",
"sha256:dbae1046def0efb574852fab9e90209b23f556367b5a320c0bcb871c77c3e8cc"
],
"version": "==2.2.0"
},
"pyparsing": {
"hashes": [
"sha256:0832bcf47acd283788593e7a0f542407bd9550a55a8a8435214a1960e04bcb04",
"sha256:281683241b25fe9b80ec9d66017485f6deff1af5cde372469134b56ca8447a07",
"sha256:8f1e18d3fd36c6795bb7e02a39fd05c611ffc2596c1e0d995d34d67630426c18",
"sha256:9e8143a3e15c13713506886badd96ca4b579a87fbdf49e550dbfc057d6cb218e",
"sha256:b8b3117ed9bdf45e14dcc89345ce638ec7e0e29b2b579fa1ecf32ce45ebac8a5",
"sha256:e4d45427c6e20a59bf4f88c639dcc03ce30d193112047f94012102f235853a58",
"sha256:fee43f17a9c4087e7ed1605bd6df994c6173c1e977d7ade7b651292fab2bd010"
],
"version": "==2.2.0"
},
"pytest": {
"hashes": [
"sha256:39555d023af3200d004d09e51b4dd9fdd828baa863cded3fd6ba2f29f757ae2d",
"sha256:c76e93f3145a44812955e8d46cdd302d8a45fbfc7bf22be24fe231f9d8d8853a"
],
"index": "pypi",
"version": "==3.6.0"
},
"pytest-asyncio": {
"hashes": [
"sha256:286b50773e996c80d894b95afaf45df6952408a67a59979ca9839f94693ec7fd",
"sha256:f32804bb58a66e13a3eda11f8942a71b1b6a30466b0d2ffe9214787aab0e172e"
],
"index": "pypi",
"version": "==0.8.0"
},
"pytz": {
"hashes": [
"sha256:65ae0c8101309c45772196b21b74c46b2e5d11b6275c45d251b150d5da334555",
"sha256:c06425302f2cf668f1bba7a0a03f3c1d34d4ebeef2c72003da308b3947c7f749"
],
"version": "==2018.4"
},
"requests": {
"hashes": [
"sha256:6a1b267aa90cac58ac3a765d067950e7dbbf75b1da07e895d1f594193a40a38b",
"sha256:9c443e7324ba5b85070c4a818ade28bfabedf16ea10206da1132edaa6dda237e"
],
"version": "==2.18.4"
},
"six": {
"hashes": [
"sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9",
"sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb"
],
"version": "==1.11.0"
},
"snowballstemmer": {
"hashes": [
"sha256:919f26a68b2c17a7634da993d91339e288964f93c274f1343e3bbbe2096e1128",
"sha256:9f3bcd3c401c3e862ec0ebe6d2c069ebc012ce142cce209c098ccb5b09136e89"
],
"version": "==1.2.1"
},
"sphinx": {
"hashes": [
"sha256:2e7ad92e96eff1b2006cf9f0cdb2743dacbae63755458594e9e8238b0c3dc60b",
"sha256:e9b1a75a3eae05dded19c80eb17325be675e0698975baae976df603b6ed1eb10"
],
"index": "pypi",
"version": "==1.7.4"
},
"sphinx-rtd-theme": {
"hashes": [
"sha256:32424dac2779f0840b4788fbccb032ba2496c1ca47a439ad2510c8b1e55dfd33",
"sha256:6d0481532b5f441b075127a2d755f430f1f8410a50112b1af6b069518548381d"
],
"index": "pypi",
"version": "==0.3.1"
},
"sphinxcontrib-asyncio": {
"hashes": [
"sha256:96627b1ec4eba08d09ad577ff9416c131910333ef37a2c82a2716e59646739f0"
],
"index": "pypi",
"version": "==0.2.0"
},
"sphinxcontrib-websupport": {
"hashes": [
"sha256:7a85961326aa3a400cd4ad3c816d70ed6f7c740acd7ce5d78cd0a67825072eb9",
"sha256:f4932e95869599b89bf4f80fc3989132d83c9faa5bf633e7b5e0c25dffb75da2"
],
"version": "==1.0.1"
},
"tox": {
"hashes": [
"sha256:96efa09710a3daeeb845561ebbe1497641d9cef2ee0aea30db6969058b2bda2f",
"sha256:9ee7de958a43806402a38c0d2aa07fa8553f4d2c20a15b140e9f771c2afeade0"
],
"index": "pypi",
"version": "==3.0.0"
},
"urllib3": {
"hashes": [
"sha256:06330f386d6e4b195fbfc736b297f58c5a892e4440e54d294d7004e3a9bbea1b",
"sha256:cc44da8e1145637334317feebd728bd869a35285b93cbb4cca2577da7e62db4f"
],
"version": "==1.22"
},
"virtualenv": {
"hashes": [
"sha256:2ce32cd126117ce2c539f0134eb89de91a8413a29baac49cbab3eb50e2026669",
"sha256:ca07b4c0b54e14a91af9f34d0919790b016923d157afda5efdde55c96718f752"
],
"version": "==16.0.0"
}
}
}

View File

@@ -1,42 +1,112 @@
.. image:: https://readthedocs.org/projects/red-discordbot/badge/?version=v3-develop .. raw:: html
:target: http://red-discordbot.readthedocs.io/en/v3-develop/?badge=v3-develop
:alt: Documentation Status
.. image:: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square <h1 align="center">
:target: http://makeapullrequest.com <br>
:alt: PRs Welcome <a href="https://github.com/Cog-Creators/Red-DiscordBot/tree/V3/develop"><img src="https://imgur.com/pY1WUFX.png" alt="Red Discord Bot"></a>
<br>
Red Discord Bot
<br>
</h1>
.. image:: https://d322cqt584bo4o.cloudfront.net/red-discordbot/localized.svg .. raw:: html
:target: https://crowdin.com/project/red-discordbot
:alt: Crowdin
.. image:: https://img.shields.io/badge/Support-Red!-orange.svg
:target: https://www.patreon.com/Red_Devs
:alt: Patreon
******************** <h4 align="center">Music, Moderation, Trivia, Stream Alerts and fully customizable.</h4>
Red - Discord Bot v3
********************
**This is in beta and very much a work in progress. Regular use is not recommended. .. raw:: html
There will not be any effort made to prevent the breaking of current installations.**
How to install <p align="center">
^^^^^^^^^^^^^^ <a href="https://discord.gg/red">
<img src="https://discordapp.com/api/guilds/133049272517001216/widget.png?style=shield">
</a>
<a href="https://www.patreon.com/Red_Devs">
<img src="https://img.shields.io/badge/Support-Red!-yellow.svg">
</a>
<a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/Made%20With-Python%203.6-blue.svg?style=for-the-badge">
</a>
<a href="https://crowdin.com/project/red-discordbot">
<img src="https://d322cqt584bo4o.cloudfront.net/red-discordbot/localized.svg">
</a>
<a href="https://github.com/Rapptz/discord.py/tree/rewrite">
<img src="https://img.shields.io/badge/discord-py-blue.svg">
</a>
</p>
Using python3 pip:: .. raw:: html
pip install --process-dependency-links -U Red-DiscordBot <p align="center">
redbot-setup <a href="#overview">Overview</a> •
redbot <name> <a href="#installation">Installation</a> •
<a href="http://red-discordbot.readthedocs.io/en/v3-develop/index.html">Documentation</a>
<a href="#plugins"></a> •
<a href="#join-the-community">Community</a> •
<a href="#license">License</a>
</p>
To install requirements for voice:: ==========
Overview
==========
pip install --process-dependency-links -U Red-DiscordBot[voice] Red is a fully modular bot meaning all features and commands can be enabled/disabled to your liking, making it completely customizable.
This is also a *self-hosted bot* meaning you will need to host and maintain your own instance. You can turn Red into an admin bot, music bot, trivia bot, new best friend or all of these together!
To install all requirements for docs and tests:: `Installation <#installation>`_ is easy, and you do **NOT** need to know anything about coding! Aside from installation and updating, every part of the bot can be controlled from within Discord.
pip install --process-dependency-links -U Red-DiscordBot[test,docs] **The default set of modules includes and is not limited to:**
For the latest git build, replace ``Red-DiscordBot`` in the above commands with - Moderation features (kick/ban/softban/hackban, mod-log, filter, chat cleanup)
``git+https://github.com/Cog-Creators/Red-DiscordBot@V3/develop``. - Trivia (lists are included and can be easily added)
- Music features (YouTube, SoundCloud, local files, playlists, queues)
- Stream alerts (Twitch, Youtube, Mixer, Hitbox, Picarto)
- Slot machine
- Custom commands
- Imgur/gif search
**Additionally, other plugins (cogs) can be easily found and added from our growing community of cog repositories.**
- Cleverbot integration (talk to Red and she talks back)
- Ban sync
- Welcome messages
- Casino
- Reaction roles
- Slow Mode
- Anilist
- And much, much more!
Feel free to take a `peek <https://github.com/Cog-Creators/Red-DiscordBot/issues/1398>`_!
==============
Installation
==============
**The following platforms are officially supported:**
- `Windows <https://red-discordbot.readthedocs.io/en/v3-develop/install_windows.html>`_
- `MacOS <https://red-discordbot.readthedocs.io/en/v3-develop/install_mac.html>`_
- `Ubuntu <https://red-discordbot.readthedocs.io/en/v3-develop/install_ubuntu.html>`_
- `Debian Stretch <https://red-discordbot.readthedocs.io/en/v3-develop/install_debian.html>`_
- `CentOS 7 <https://red-discordbot.readthedocs.io/en/v3-develop/install_centos.html>`_
- `Arch Linux <https://red-discordbot.readthedocs.io/en/v3-develop/install_arch.html>`_
- `Raspbian Stretch <https://red-discordbot.readthedocs.io/en/v3-develop/install_raspbian.html>`_
Already using **Red** V2? Take a look at the `Data Converter <https://red-discordbot.readthedocs.io/en/v3-develop/cog_dataconverter.html>`_ to import your data to V3.
If `after reading the guides <https://red-discordbot.readthedocs.io/en/v3-develop/>`_ you are still experiencing issues, feel free to join the `Official Server <https://discord.gg/red>`_ and ask in the **#support** channel for help.
=====================
Join the community!
=====================
**Red** is in continuous development, and its supported by an active community which produces new content (cogs/plugins) for everyone to enjoy. New features are constantly added. If you cant `find <https://github.com/Cog-Creators/Red-DiscordBot/issues/1398>`_ what youre looking for, consult our `guide <https://red-discordbot.readthedocs.io/en/v3-develop/guide_cog_creation.html>`_ on building your own cogs!
Join us on our `Official Discord Server <https://discord.gg/red>`_!
=========
License
=========
Released under the `GNU GPL v3 <#License>`_.
Red is named after the main character of "Transistor", a videogame by `Super Giant Games <https://www.supergiantgames.com/games/transistor/>`_
Artwork created by `Sinlaire <https://sinlaire.deviantart.com/>`_ on Deviant Art for the Red Bot Project.

View File

@@ -14,6 +14,9 @@ help:
.PHONY: help Makefile .PHONY: help Makefile
init:
cd .. && pipenv lock -r --dev > docs/requirements.txt && echo 'git+https://github.com/Rapptz/discord.py@rewrite#egg=discord.py-1.0' >> docs/requirements.txt
# Catch-all target: route all unknown targets to Sphinx using the new # Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile %: Makefile

View File

@@ -0,0 +1,53 @@
.. systemd service guide
==============================================
Setting up auto-restart using systemd on Linux
==============================================
-------------------------
Creating the service file
-------------------------
Create the new service file:
:code:`sudo nano /etc/systemd/system/red@.service`
Paste the following and replace all instances of :code:`username` with the username your bot is running under (hopefully not root):
.. code-block:: none
[Unit]
Description=%I redbot
After=multi-user.target
[Service]
ExecStart=/home/username/.local/bin/redbot %I --no-prompt
User=username
Group=username
Type=idle
Restart=always
RestartSec=15
RestartPreventExitStatus=0
[Install]
WantedBy=multi-user.target
Save and exit :code:`ctrl + O; enter; ctrl + x`
---------------------------------
Starting and enabling the service
---------------------------------
.. note:: This same file can be used to start as many instances of the bot as you wish, without creating more service files, just start and enable more services and add any bot instance name after the **@**
To start the bot, run the service and add the instance name after the **@**:
:code:`sudo systemctl start red@instancename`
To set the bot to start on boot, you must enable the service, again adding the instance name after the **@**:
:code:`sudo systemctl enable red@instancename`
To view Reds log, you can acccess through journalctl:
:code:`sudo journalctl -u red@instancename`

View File

@@ -0,0 +1,62 @@
.. Importing data from a V2 install
================================
Importing data from a V2 install
================================
----------------
What you'll need
----------------
1. A Running V3 bot
2. The path where your V2 bot is installed
--------------
Importing data
--------------
.. important::
Unless otherwise specified, the V2 data will take priority over V3 data for the same entires
.. important::
For the purposes of this guide, your prefix will be denoted as
[p]
You should swap whatever you made your prefix in for this.
All of the below are commands to be entered in discord where the bot can
see them.
The dataconverter cog is not loaded by default. To start, load it with
.. code-block:: none
[p]load dataconverter
Next, you'll need to give it the path where your V2 install is.
On linux and OSX, it may look something like:
.. code-block:: none
/home/username/Red-DiscordBot/
On Windows it will look something like:
.. code-block:: none
C:\Users\yourusername\Red-DiscordBot
Once you have that path, give it to the bot with the following command
(make sure to swap your own path in)
.. code-block:: none
[p]convertdata /home/username/Red-DiscordBot/
From here, if the path is correct, you will be prompted with an interactive menu asking you
what data you would like to import
You can select an entry by number, or quit with any of 'quit', 'exit', 'q', '-1', or 'cancel'

75
docs/cog_permissions.rst Normal file
View File

@@ -0,0 +1,75 @@
.. Permissions Cog Reference
=========================
Permissions Cog Reference
=========================
------------
How it works
------------
When loaded, the permissions cog will allow you
to define extra custom rules for who can use a command
If no applicable rules are found, the command will behave as if
the cog was not loaded.
-------------
Rule priority
-------------
Rules set will be checked in the following order
1. Owner level command specific settings
2. Owner level cog specific settings
3. Server level command specific settings
4. Server level cog specific settings
For each of those, settings have varying priorities (listed below, highest to lowest priority)
1. User whitelist
2. User blacklist
3. Voice Channel whitelist
4. Voice Channel blacklist
5. Text Channel whitelist
6. Text Channel blacklist
7. Role settings (see below)
8. Server whitelist
9. Server blacklist
For the role whitelist and blacklist settings,
roles will be checked individually in order from highest to lowest role the user has
Each role will be checked for whitelist, then blacklist. The first role with a setting
found will be the one used.
-------------------------
Setting Rules from a file
-------------------------
The permissions cog can set rules from a yaml file:
All entries are based on ID.
An example of the expected format is shown below.
.. code-block:: yaml
cogs:
Admin:
allow:
- 78631113035100160
deny:
- 96733288462286848
Audio:
allow:
- 133049272517001216
default: deny
commands:
cleanup bot:
allow:
- 78631113035100160
default: deny
ping:
deny:
- 96733288462286848
default: allow

View File

@@ -19,9 +19,10 @@
# #
import os import os
import sys import sys
sys.path.insert(0, os.path.abspath('..'))
os.environ['BUILDING_DOCS'] = "1" sys.path.insert(0, os.path.abspath(".."))
os.environ["BUILDING_DOCS"] = "1"
# -- General configuration ------------------------------------------------ # -- General configuration ------------------------------------------------
@@ -34,38 +35,40 @@ os.environ['BUILDING_DOCS'] = "1"
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones. # ones.
extensions = [ extensions = [
'sphinx.ext.autodoc', "sphinx.ext.autodoc",
'sphinx.ext.intersphinx', "sphinx.ext.intersphinx",
'sphinx.ext.viewcode', "sphinx.ext.viewcode",
'sphinx.ext.napoleon', "sphinx.ext.napoleon",
'sphinxcontrib.asyncio' "sphinxcontrib.asyncio",
] ]
# Add any paths that contain templates here, relative to this directory. # Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates'] templates_path = ["_templates"]
# The suffix(es) of source filenames. # The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string: # You can specify multiple suffix as a list of string:
# #
# source_suffix = ['.rst', '.md'] # source_suffix = ['.rst', '.md']
source_suffix = '.rst' source_suffix = ".rst"
# The master toctree document. # The master toctree document.
master_doc = 'index' master_doc = "index"
# General information about the project. # General information about the project.
project = 'Red - Discord Bot' project = "Red - Discord Bot"
copyright = '2017, Cog Creators' copyright = "2018, Cog Creators"
author = 'Cog Creators' author = "Cog Creators"
# The version info for the project you're documenting, acts as replacement for # The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the # |version| and |release|, also used in various other places throughout the
# built documents. # built documents.
# #
from redbot.core import __version__
# The short X.Y version. # The short X.Y version.
version = '3.0.0a1' version = __version__
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = '3.0.0a1' release = __version__
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.
@@ -77,10 +80,10 @@ language = None
# List of patterns, relative to source directory, that match files and # List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files. # directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path # This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
# The name of the Pygments (syntax highlighting) style to use. # The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx' pygments_style = "sphinx"
# If true, `todo` and `todoList` produce output, else they produce nothing. # If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False todo_include_todos = False
@@ -94,7 +97,7 @@ default_role = "any"
# The theme to use for HTML and HTML Help pages. See the documentation for # The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes. # a list of builtin themes.
# #
html_theme = 'sphinx_rtd_theme' html_theme = "sphinx_rtd_theme"
# Theme options are theme-specific and customize the look and feel of a theme # Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the # further. For a list of options available for each theme, see the
@@ -104,16 +107,16 @@ html_theme = 'sphinx_rtd_theme'
html_context = { html_context = {
# Enable the "Edit in GitHub link within the header of each page. # Enable the "Edit in GitHub link within the header of each page.
'display_github': True, "display_github": True,
'github_user': 'Cog-Creators', "github_user": "Cog-Creators",
'github_repo': 'Red-DiscordBot', "github_repo": "Red-DiscordBot",
'github_version': 'V3/develop/docs/' "github_version": "V3/develop/docs/",
} }
# Add any paths that contain custom static files (such as style sheets) here, # Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files, # relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css". # so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static'] # html_static_path = ['_static']
# Custom sidebar templates, must be a dictionary that maps document names # Custom sidebar templates, must be a dictionary that maps document names
# to template names. # to template names.
@@ -121,12 +124,12 @@ html_static_path = ['_static']
# This is required for the alabaster theme # This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars # refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
html_sidebars = { html_sidebars = {
'**': [ "**": [
'about.html', "about.html",
'navigation.html', "navigation.html",
'relations.html', # needs 'show_related': True theme option to display "relations.html", # needs 'show_related': True theme option to display
'searchbox.html', "searchbox.html",
'donate.html', "donate.html",
] ]
} }
@@ -134,7 +137,7 @@ html_sidebars = {
# -- Options for HTMLHelp output ------------------------------------------ # -- Options for HTMLHelp output ------------------------------------------
# Output file base name for HTML help builder. # Output file base name for HTML help builder.
htmlhelp_basename = 'Red-DiscordBotdoc' htmlhelp_basename = "Red-DiscordBotdoc"
# -- Options for LaTeX output --------------------------------------------- # -- Options for LaTeX output ---------------------------------------------
@@ -143,15 +146,12 @@ latex_elements = {
# The paper size ('letterpaper' or 'a4paper'). # The paper size ('letterpaper' or 'a4paper').
# #
# 'papersize': 'letterpaper', # 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt'). # The font size ('10pt', '11pt' or '12pt').
# #
# 'pointsize': '10pt', # 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble. # Additional stuff for the LaTeX preamble.
# #
# 'preamble': '', # 'preamble': '',
# Latex figure (float) alignment # Latex figure (float) alignment
# #
# 'figure_align': 'htbp', # 'figure_align': 'htbp',
@@ -161,8 +161,7 @@ latex_elements = {
# (source start file, target name, title, # (source start file, target name, title,
# author, documentclass [howto, manual, or own class]). # author, documentclass [howto, manual, or own class]).
latex_documents = [ latex_documents = [
(master_doc, 'Red-DiscordBot.tex', 'Red - Discord Bot Documentation', (master_doc, "Red-DiscordBot.tex", "Red - Discord Bot Documentation", "Cog Creators", "manual")
'Cog Creators', 'manual'),
] ]
@@ -170,10 +169,7 @@ latex_documents = [
# One entry per manual page. List of tuples # One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section). # (source start file, name, description, authors, manual section).
man_pages = [ man_pages = [(master_doc, "red-discordbot", "Red - Discord Bot Documentation", [author], 1)]
(master_doc, 'red-discordbot', 'Red - Discord Bot Documentation',
[author], 1)
]
# -- Options for Texinfo output ------------------------------------------- # -- Options for Texinfo output -------------------------------------------
@@ -182,15 +178,21 @@ man_pages = [
# (source start file, target name, title, author, # (source start file, target name, title, author,
# dir menu entry, description, category) # dir menu entry, description, category)
texinfo_documents = [ texinfo_documents = [
(master_doc, 'Red-DiscordBot', 'Red - Discord Bot Documentation', (
author, 'Red-DiscordBot', 'One line description of project.', master_doc,
'Miscellaneous'), "Red-DiscordBot",
"Red - Discord Bot Documentation",
author,
"Red-DiscordBot",
"One line description of project.",
"Miscellaneous",
)
] ]
# Example configuration for intersphinx: refer to the Python standard library. # Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'python': ('https://docs.python.org/3.5', None), intersphinx_mapping = {
'dpy': ('https://discordpy.readthedocs.io/en/rewrite/', None), "python": ("https://docs.python.org/3.6", None),
'motor': ('https://motor.readthedocs.io/en/stable/', None)} "dpy": ("https://discordpy.readthedocs.io/en/rewrite/", None),
"motor": ("https://motor.readthedocs.io/en/stable/", None),
}

20
docs/framework_bot.rst Normal file
View File

@@ -0,0 +1,20 @@
.. bot module docs
===
Bot
===
.. automodule:: redbot.core.bot
RedBase
^^^^^^^
.. autoclass:: RedBase
:members:
:exclude-members: get_context
Red
^^^
.. autoclass:: Red
:members:

View File

@@ -0,0 +1,21 @@
.. red commands module documentation
================
Commands Package
================
This package acts almost identically to ``discord.ext.commands``; i.e. they both have the same
attributes. Some of these attributes, however, have been slightly modified, as outlined below.
.. autofunction:: redbot.core.commands.command
.. autofunction:: redbot.core.commands.group
.. autoclass:: redbot.core.commands.Command
:members:
.. autoclass:: redbot.core.commands.Group
:members:
.. autoclass:: redbot.core.commands.Context
:members:

View File

@@ -29,7 +29,7 @@ Basic Usage
@commands.command() @commands.command()
async def return_some_data(self, ctx): async def return_some_data(self, ctx):
await ctx.send(await config.foo()) await ctx.send(await self.config.foo())
******** ********
Tutorial Tutorial

View File

@@ -1,10 +0,0 @@
.. red invocation context documentation
==========================
Command Invocation Context
==========================
.. automodule:: redbot.core.context
.. autoclass:: redbot.core.RedContext
:members:

View File

@@ -6,22 +6,31 @@ Downloader Framework
Info.json Info.json
********* *********
The info.json file may exist inside every package folder in the repo, The optional info.json file may exist inside every package folder in the repo,
it is optional however. This string describes the valid keys within as well as in the root of the repo. The following sections describe the valid
an info file (and maybe how the Downloader cog uses them). keys within an info file (and maybe how the Downloader cog uses them).
KEYS (case sensitive): Keys common to both repo and cog info.json (case sensitive)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- ``author`` (list of strings) - list of names of authors of the cog - ``author`` (list of strings) - list of names of authors of the cog or repo.
- ``description`` (string) - A long description of the cog or repo. For cogs, this
is displayed when a user executes ``!cog info``.
- ``install_msg`` (string) - The message that gets displayed when a cog
is installed or a repo is added
- ``short`` (string) - A short description of the cog or repo. For cogs, this info
is displayed when a user executes ``!cog list``
Keys specific to the cog info.json (case sensitive)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- ``bot_version`` (list of integer) - Min version number of Red in the format ``(MAJOR, MINOR, PATCH)`` - ``bot_version`` (list of integer) - Min version number of Red in the format ``(MAJOR, MINOR, PATCH)``
- ``description`` (string) - A long description of the cog that appears when a user executes ```!cog info``.
- ``hidden`` (bool) - Determines if a cog is available for install. - ``hidden`` (bool) - Determines if a cog is available for install.
- ``install_msg`` (string) - The message that gets displayed when a cog is installed
- ``required_cogs`` (map of cogname to repo URL) - A map of required cogs that this cog depends on. - ``required_cogs`` (map of cogname to repo URL) - A map of required cogs that this cog depends on.
Downloader will not deal with this functionality but it may be useful for other cogs. Downloader will not deal with this functionality but it may be useful for other cogs.
@@ -29,9 +38,6 @@ KEYS (case sensitive):
passed to pip on cog install. ``SHARED_LIBRARIES`` do NOT go in this passed to pip on cog install. ``SHARED_LIBRARIES`` do NOT go in this
list. list.
- ``short`` (string) - A short description of the cog that appears when
a user executes `!cog list`
- ``tags`` (list of strings) - A list of strings that are related to the - ``tags`` (list of strings) - A list of strings that are related to the
functionality of the cog. Used to aid in searching. functionality of the cog. Used to aid in searching.

View File

@@ -13,11 +13,12 @@ Basic Usage
.. code-block:: python .. code-block:: python
from discord.ext import commands from redbot.core import commands
from redbot.core.i18n import CogI18n from redbot.core.i18n import Translator, cog_i18n
_ = CogI18n("ExampleCog", __file__) _ = Translator("ExampleCog", __file__)
@cog_i18n(_)
class ExampleCog: class ExampleCog:
"""description""" """description"""
@@ -39,16 +40,19 @@ In a command prompt in your cog's package (where yourcog.py is),
create a directory called "locales". create a directory called "locales".
Then do one of the following: Then do one of the following:
Windows: :code:`python <your python install path>\Tools\i18n\pygettext.py -n -p locales` Windows: :code:`python <your python install path>\Tools\i18n\pygettext.py -D -n -p locales`
Mac: ? Mac: ?
Linux: :code:`pygettext3 -n -p locales` Linux: :code:`pygettext3 -D -n -p locales`
This will generate a messages.pot file with strings to be translated This will generate a messages.pot file with strings to be translated, including
docstrings.
------------- -------------
API Reference API Reference
------------- -------------
.. automodule:: redbot.core.i18n .. automodule:: redbot.core.i18n
:members:
:special-members: __call__

39
docs/framework_rpc.rst Normal file
View File

@@ -0,0 +1,39 @@
.. rpc docs
===
RPC
===
.. currentmodule:: redbot.core.rpc
V3 comes default with an internal RPC server that may be used to remotely control the bot in various ways.
Cogs must register functions to be exposed to RPC clients.
Each of those functions must only take JSON serializable parameters and must return JSON serializable objects.
To begin, register all methods using individual calls to the :func:`Methods.add` method.
********
Examples
********
Coming soon to a docs page near you!
*************
API Reference
*************
.. py:attribute:: redbot.core.rpc.methods
An instance of the :class:`Methods` class.
All attempts to register new RPC methods **MUST** use this object.
You should never create a new instance of the :class:`Methods` class!
RPC
^^^
.. autoclass:: redbot.core.rpc.RPC
:members:
Methods
^^^^^^^
.. autoclass:: redbot.core.rpc.Methods
:members:

View File

@@ -10,8 +10,32 @@ Chat Formatting
.. automodule:: redbot.core.utils.chat_formatting .. automodule:: redbot.core.utils.chat_formatting
:members: :members:
Embed Helpers
=============
.. automodule:: redbot.core.utils.embed
:members:
Menu Helpers
============
.. automodule:: redbot.core.utils.menus
:members:
Mod Helpers Mod Helpers
=========== ===========
.. automodule:: redbot.core.utils.mod .. automodule:: redbot.core.utils.mod
:members: :members:
V2 Data Conversion
==================
.. automodule:: redbot.core.utils.data_converter
:members: DataConverter
Tunnel
======
.. automodule:: redbot.core.utils.tunnel
:members: Tunnel

View File

@@ -90,6 +90,6 @@ have successfully created a cog!
Additional resources Additional resources
-------------------- --------------------
Be sure to check out the `migration guide </guide_migration>`_ for some resources Be sure to check out the :doc:`/guide_migration` for some resources
on developing cogs for V3. This will also cover differences between V2 and V3 for on developing cogs for V3. This will also cover differences between V2 and V3 for
those who developed cogs for V2. those who developed cogs for V2.

View File

@@ -0,0 +1,154 @@
.. Converting Data from a V2 cog
.. role:: python(code)
:language: python
============================
Importing Data From a V2 Cog
============================
This guide serves as a tutorial on using the DataConverter class
to import settings from a V2 cog.
------------------
Things you'll need
------------------
1. The path where each file holding related settings in v2 is
2. A conversion function to take the data and transform it to conform to Config
-----------------------
Getting your file paths
-----------------------
You should probably not try to find the files manually.
Asking the user for the base install path and using a relative path to where the
data should be, then testing that the file exists there is safer. This is especially
True if your cog has multiple settings files
Example
.. code-block:: python
from discord.ext import commands
from pathlib import Path
@commands.command(name="filefinder")
async def file_finding_command(self, ctx, filepath):
"""
this finds a file based on a user provided input and a known relative path
"""
base_path = Path(filepath)
fp = base_path / 'data' / 'mycog' / 'settings.json'
if not fp.is_file():
pass
# fail, prompting user
else:
pass
# do something with the file
---------------
Converting data
---------------
Once you've gotten your v2 settings file, you'll want to be able to import it
There are a couple options available depending on how you would like to convert
the data.
The first one takes a data path, and a conversion function and does the rest for you.
This is great for simple data that just needs to quickly be imported without much
modification.
Here's an example of that in use:
.. code-block:: python
from pathlib import Path
from discord.ext import commands
from redbot.core.utils.data_converter import DataConverter as dc
from redbot.core.config import Config
...
async def import_v2(self, file_path: Path):
"""
to be called from a command limited to owner
This should be a coroutine as the convert function will
need to be awaited
"""
# First we give the converter our cog's Config instance.
converter = dc(self.config)
# next we design a way to get all of the data into Config's internal
# format. This should be a generator, but you can also return a single
# list with identical results outside of memory usage
def conversion_spec(v2data):
for guild_id in v2.data.keys():
yield {(Config.GUILD, guild_id): {('blacklisted',): True}}
# This is yielding a dictionary that is designed for config's set_raw.
# The keys should be a tuple of Config scopes + the needed Identifiers. The
# values should be another dictionary whose keys are tuples representing
# config settings, the value should be the value to set for that.
# Then we pass the file and the conversion function
await converter.convert(file_path, conversion_spec)
# From here, our data should be imported
You can also choose to convert all of your data and pass it as a single dict
This can be useful if you want finer control over the dataconversion or want to
preserve any data from v3 that may share the same entry and set it aside to prompt
a user
.. code-block:: python
from pathlib import Path
from discord.ext import commands
from redbot.core.utils.data_converter import DataConverter as dc
from redbot.core.config import Config
...
await dc(config_instance).dict_import(some_processed_dict)
The format of the items of the dict is the same as in the above example
-----------------------------------
Config Scopes and their Identifiers
-----------------------------------
This section is provided as a quick reference for the identifiers for default
scopes available in Config. This does not cover usage of custom scopes, though the
data converter is compatible with those as well.
Global::
:code:`(Config.GLOBAL,)`
Guild::
:code:`(Config.GUILD, guild_id)`
Channel::
:code:`(Config.CHANNEL, channel_id)`
User::
:code:`(Config.USER, user_id)`
Member::
:code:`(Config.MEMBER, guild_id, user_id)`
Role::
:code:`(Config.ROLE, role_id)`
-----------------------------
More information and Examples
-----------------------------
For a more in depth look at how all of these commands function
You may want to take a look at how core data is being imported
:code:`redbot/cogs/dataconverter/core_specs.py`

View File

@@ -12,16 +12,21 @@ Welcome to Red - Discord Bot's documentation!
install_windows install_windows
install_mac install_mac
install_ubuntu install_ubuntu_xenial
install_ubuntu_bionic
install_debian install_debian
install_centos install_centos
install_arch
install_raspbian install_raspbian
cog_dataconverter
autostart_systemd
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
:caption: Cog Reference: :caption: Cog Reference:
cog_downloader cog_downloader
cog_permissions
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
@@ -29,14 +34,18 @@ Welcome to Red - Discord Bot's documentation!
guide_migration guide_migration
guide_cog_creation guide_cog_creation
guide_data_conversion
framework_bank framework_bank
framework_bot
framework_cogmanager framework_cogmanager
framework_datamanager
framework_config framework_config
framework_datamanager
framework_downloader framework_downloader
framework_events
framework_i18n framework_i18n
framework_modlog framework_modlog
framework_context framework_commands
framework_rpc
framework_utils framework_utils

View File

@@ -1,18 +1,20 @@
.. ubuntu install guide .. arch install guide
============================== ==============================
Installing Red on Ubuntu 16.04 Installing Red on Arch Linux
============================== ==============================
.. warning:: For safety reasons, DO NOT install Red with a root user. Instead, make a new one. .. warning:: For safety reasons, DO NOT install Red with a root user. Instead, make a new one.
:code:`https://wiki.archlinux.org/index.php/Users_and_groups`
------------------------------- -------------------------------
Installing the pre-requirements Installing the pre-requirements
------------------------------- -------------------------------
.. code-block:: none .. code-block:: none
sudo apt install python3.5-dev python3-pip build-essential libssl-dev libffi-dev git ffmpeg libopus-dev unzip default-jre -y sudo pacman -Syu python-pip git base-devel jre8-openjdk
------------------ ------------------
Installing the bot Installing the bot
@@ -20,19 +22,19 @@ Installing the bot
To install without audio: To install without audio:
:code:`pip3 install -U --process-dependency-links red-discordbot` :code:`pip3 install -U --process-dependency-links red-discordbot --user`
To install with audio: To install with audio:
:code:`pip3 install -U --process-dependency-links red-discordbot[voice]` :code:`pip3 install -U --process-dependency-links red-discordbot[voice] --user`
To install the development version (without audio): To install the development version (without audio):
:code:`pip3 install -U --process-dependency-links git+https://github.com/Cog-Creators/Red-DiscordBot@V3/develop#egg=red-discordbot` :code:`pip3 install -U --process-dependency-links git+https://github.com/Cog-Creators/Red-DiscordBot@V3/develop#egg=red-discordbot --user`
To install the development version (with audio): To install the development version (with audio):
:code:`pip3 install -U --process-dependency-links git+https://github.com/Cog-Creators/Red-DiscordBot@V3/develop#egg=red-discordbot[voice]` :code:`pip3 install -U --process-dependency-links git+https://github.com/Cog-Creators/Red-DiscordBot@V3/develop#egg=red-discordbot[voice] --user`
------------------------ ------------------------
Setting up your instance Setting up your instance
@@ -50,4 +52,4 @@ Running Red
----------- -----------
Run :code:`redbot <your instance name>` and run through the initial setup. This will ask for Run :code:`redbot <your instance name>` and run through the initial setup. This will ask for
your token and a prefix. your token and a prefix.

View File

@@ -4,6 +4,8 @@
Installing Red on CentOS 7 Installing Red on CentOS 7
========================== ==========================
.. warning:: For safety reasons, DO NOT install Red with a root user. Instead, `make a new one <https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/4/html/Step_by_Step_Guide/s1-starting-create-account.html>`_.
--------------------------- ---------------------------
Installing pre-requirements Installing pre-requirements
--------------------------- ---------------------------
@@ -12,8 +14,7 @@ Installing pre-requirements
yum -y groupinstall development yum -y groupinstall development
yum -y install https://centos7.iuscommunity.org/ius-release.rpm yum -y install https://centos7.iuscommunity.org/ius-release.rpm
yum -y install yum-utils wget which python35u python35u-pip python35u-devel openssl-devel libffi-devel git opus-devel java-1.8.0-openjdk yum -y install yum-utils wget which python36u python36u-pip python36u-devel openssl-devel libffi-devel git java-1.8.0-openjdk
sh -c "$(wget https://gist.githubusercontent.com/mustafaturan/7053900/raw/27f4c8bad3ee2bb0027a1a52dc8501bf1e53b270/latest-ffmpeg-centos6.sh -O -)"
-------------- --------------
Installing Red Installing Red
@@ -21,19 +22,19 @@ Installing Red
Without audio: Without audio:
:code:`pip3 install -U --process-dependency-links red-discordbot` :code:`pip3 install -U --process-dependency-links red-discordbot --user`
With audio: With audio:
:code:`pip3 install -U --process-dependency-links red-discordbot[voice]` :code:`pip3 install -U --process-dependency-links red-discordbot[voice] --user`
To install the development version (without audio): To install the development version (without audio):
:code:`pip3 install -U --process-dependency-links git+https://github.com/Cog-Creators/Red-DiscordBot@V3/develop#egg=red-discordbot` :code:`pip3 install -U --process-dependency-links git+https://github.com/Cog-Creators/Red-DiscordBot@V3/develop#egg=red-discordbot --user`
To install the development version (with audio): To install the development version (with audio):
:code:`pip3 install -U --process-dependency-links git+https://github.com/Cog-Creators/Red-DiscordBot@V3/develop#egg=red-discordbot[voice]` :code:`pip3 install -U --process-dependency-links git+https://github.com/Cog-Creators/Red-DiscordBot@V3/develop#egg=red-discordbot[voice] --user`
---------------------- ----------------------
Setting up an instance Setting up an instance
@@ -51,4 +52,4 @@ Running Red
----------- -----------
Run :code:`redbot <your instance name>` and run through the initial setup. This will ask for Run :code:`redbot <your instance name>` and run through the initial setup. This will ask for
your token and a prefix. your token and a prefix.

View File

@@ -4,7 +4,7 @@
Installing Red on Debian Stretch Installing Red on Debian Stretch
================================ ================================
.. warning:: For safety reasons, DO NOT install Red with a root user. Instead, make a new one. .. warning:: For safety reasons, DO NOT install Red with a root user. Instead, `make a new one <https://manpages.debian.org/stretch/adduser/adduser.8.en.html>`_.
--------------------------- ---------------------------
Installing pre-requirements Installing pre-requirements
@@ -12,9 +12,24 @@ Installing pre-requirements
.. code-block:: none .. code-block:: none
echo "deb http://httpredir.debian.org/debian stretch-backports main contrib non-free" >> /etc/apt/sources.list sudo apt install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev git unzip default-jre
apt-get update curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
apt-get install python3.5-dev python3-pip build-essential libssl-dev libffi-dev git ffmpeg libopus-dev unzip default-jre -y
After that last command, you may see a warning about 'pyenv' not being in the load path. Follow the instructions given to fix that, then close and reopen your shell
Then run the following command:
.. code-block:: none
CONFIGURE_OPTS=--enable-optimizations pyenv install 3.6.5 -v
This may take a long time to complete.
After that is finished, run:
.. code-block:: none
pyenv global 3.6.5
------------------ ------------------
Installing the bot Installing the bot
@@ -52,4 +67,4 @@ Running Red
----------- -----------
Run :code:`redbot <your instance name>` and run through the initial setup. This will ask for Run :code:`redbot <your instance name>` and run through the initial setup. This will ask for
your token and a prefix. your token and a prefix.

View File

@@ -15,8 +15,6 @@ Installing pre-requirements
* After the installation, install the required packages by pasting the commands and pressing enter, one-by-one: * After the installation, install the required packages by pasting the commands and pressing enter, one-by-one:
* :code:`brew install python3 --with-brewed-openssl` * :code:`brew install python3 --with-brewed-openssl`
* :code:`brew install git` * :code:`brew install git`
* :code:`brew install ffmpeg --with-ffplay`
* :code:`brew install opus`
* :code:`brew tap caskroom/versions` * :code:`brew tap caskroom/versions`
* :code:`brew cask install java8` * :code:`brew cask install java8`

View File

@@ -4,13 +4,32 @@
Installing Red on Raspbian Stretch Installing Red on Raspbian Stretch
================================== ==================================
.. warning:: For safety reasons, DO NOT install Red with a root user. Instead, `make a new one <https://www.raspberrypi.org/documentation/linux/usage/users.md>`_.
--------------------------- ---------------------------
Installing pre-requirements Installing pre-requirements
--------------------------- ---------------------------
.. code-block:: none .. code-block:: none
sudo apt-get install python3.5-dev python3-pip build-essential libssl-dev libffi-dev git libav-tools libopus-dev unzip default-jre -y sudo apt install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev git unzip default-jre
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
After that last command, you may see a warning about 'pyenv' not being in the load path. Follow the instructions given to fix that, then close and reopen your shell
Then run the following command:
.. code-block:: none
CONFIGURE_OPTS=--enable-optimizations pyenv install 3.6.5 -v
This may take a long time to complete.
After that is finished, run:
.. code-block:: none
pyenv global 3.6.5
-------------- --------------
Installing Red Installing Red
@@ -18,19 +37,19 @@ Installing Red
Without audio: Without audio:
:code:`pip3 install -U --process-dependency-links red-discordbot` :code:`pip3 install -U --process-dependency-links red-discordbot --user`
With audio: With audio:
:code:`pip3 install -U --process-dependency-links red-discordbot[voice]` :code:`pip3 install -U --process-dependency-links red-discordbot[voice] --user`
To install the development version (without audio): To install the development version (without audio):
:code:`pip3 install -U --process-dependency-links git+https://github.com/Cog-Creators/Red-DiscordBot@V3/develop#egg=red-discordbot` :code:`pip3 install -U --process-dependency-links git+https://github.com/Cog-Creators/Red-DiscordBot@V3/develop#egg=red-discordbot --user`
To install the development version (with audio): To install the development version (with audio):
:code:`pip3 install -U --process-dependency-links git+https://github.com/Cog-Creators/Red-DiscordBot@V3/develop#egg=red-discordbot[voice]` :code:`pip3 install -U --process-dependency-links git+https://github.com/Cog-Creators/Red-DiscordBot@V3/develop#egg=red-discordbot[voice] --user`
---------------------- ----------------------
Setting up an instance Setting up an instance
@@ -50,4 +69,4 @@ Running Red
Run :code:`redbot <your instance name>` and run through the initial setup. This will ask for Run :code:`redbot <your instance name>` and run through the initial setup. This will ask for
your token and a prefix. your token and a prefix.
.. warning:: Audio will not work on Raspberry Pi's **below** 2B. This is a CPU problem and *cannot* be fixed. .. warning:: Audio will not work on Raspberry Pi's **below** 2B. This is a CPU problem and *cannot* be fixed.

View File

@@ -0,0 +1,54 @@
.. ubuntu bionic install guide
==============================
Installing Red on Ubuntu 18.04
==============================
.. warning:: For safety reasons, DO NOT install Red with a root user. Instead, `make a new one <http://manpages.ubuntu.com/manpages/artful/man8/adduser.8.html>`_.
-------------------------------
Installing the pre-requirements
-------------------------------
.. code-block:: none
sudo apt install python3.6-dev python3-pip build-essential libssl-dev libffi-dev git unzip default-jre -y
------------------
Installing the bot
------------------
To install without audio:
:code:`pip3 install -U --process-dependency-links red-discordbot --user`
To install with audio:
:code:`pip3 install -U --process-dependency-links red-discordbot[voice] --user`
To install the development version (without audio):
:code:`pip3 install -U --process-dependency-links git+https://github.com/Cog-Creators/Red-DiscordBot@V3/develop#egg=red-discordbot --user`
To install the development version (with audio):
:code:`pip3 install -U --process-dependency-links git+https://github.com/Cog-Creators/Red-DiscordBot@V3/develop#egg=red-discordbot[voice] --user`
------------------------
Setting up your instance
------------------------
Run :code:`redbot-setup` and follow the prompts. It will ask first for where you want to
store the data (the default is :code:`~/.local/share/Red-DiscordBot`) and will then ask
for confirmation of that selection. Next, it will ask you to choose your storage backend
(the default here is JSON). It will then ask for a name for your instance. This can be
anything as long as it does not contain spaces; however, keep in mind that this is the
name you will use to run your bot, and so it should be something you can remember.
-----------
Running Red
-----------
Run :code:`redbot <your instance name>` and run through the initial setup. This will ask for
your token and a prefix.

View File

@@ -0,0 +1,59 @@
.. ubuntu xenial install guide
==============================
Installing Red on Ubuntu 16.04
==============================
.. warning:: For safety reasons, DO NOT install Red with a root user. Instead, `make a new one <http://manpages.ubuntu.com/manpages/artful/man8/adduser.8.html>`_.
-------------------------------
Installing the pre-requirements
-------------------------------
.. code-block:: none
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.6-dev build-essential libssl-dev libffi-dev git unzip default-jre wget -y
wget https://bootstrap.pypa.io/get-pip.py
sudo python3.6 get-pip.py
------------------
Installing the bot
------------------
To install without audio:
:code:`pip3.6 install -U --process-dependency-links red-discordbot --user`
To install with audio:
:code:`pip3.6 install -U --process-dependency-links red-discordbot[voice] --user`
To install the development version (without audio):
:code:`pip3.6 install -U --process-dependency-links git+https://github.com/Cog-Creators/Red-DiscordBot@V3/develop#egg=red-discordbot --user`
To install the development version (with audio):
:code:`pip3.6 install -U --process-dependency-links git+https://github.com/Cog-Creators/Red-DiscordBot@V3/develop#egg=red-discordbot[voice] --user`
------------------------
Setting up your instance
------------------------
Run :code:`redbot-setup` and follow the prompts. It will ask first for where you want to
store the data (the default is :code:`~/.local/share/Red-DiscordBot`) and will then ask
for confirmation of that selection. Next, it will ask you to choose your storage backend
(the default here is JSON). It will then ask for a name for your instance. This can be
anything as long as it does not contain spaces; however, keep in mind that this is the
name you will use to run your bot, and so it should be something you can remember.
-----------
Running Red
-----------
Run :code:`redbot <your instance name>` and run through the initial setup. This will ask for
your token and a prefix.

View File

@@ -8,11 +8,7 @@ Installing Red on Windows
Needed Software Needed Software
--------------- ---------------
* `Python <https://python.org/downloads/>`_ - Red needs at least Python 3.5 * `Python <https://python.org/downloads/>`_ - Red needs Python 3.6
.. attention:: Please note that 3.6 has issues on some versions of Windows.
If you try using Red with 3.6 and experience issues, uninstall
Python 3.6 and install the latest version of Python 3.5
.. note:: Please make sure that the box to add Python to PATH is CHECKED, otherwise .. note:: Please make sure that the box to add Python to PATH is CHECKED, otherwise
you may run into issues when trying to run Red you may run into issues when trying to run Red
@@ -44,4 +40,4 @@ Installing Red
running the bot) running the bot)
4. Once done setting up the instance, run :code:`redbot <your instance name>` to run Red. 4. Once done setting up the instance, run :code:`redbot <your instance name>` to run Red.
It will walk through the initial setup, asking for your token and a prefix It will walk through the initial setup, asking for your token and a prefix

View File

@@ -1,4 +1,29 @@
sphinx==1.6.3 -i https://pypi.org/simple
sphinxcontrib-asyncio alabaster==0.7.10
sphinx_rtd_theme attrs==18.1.0
git+https://github.com/Rapptz/discord.py@rewrite#egg=discord.py[voice] babel==2.5.3
certifi==2018.4.16
chardet==3.0.4
docutils==0.14
idna==2.6
imagesize==1.0.0
jinja2==2.10
markupsafe==1.0
more-itertools==4.1.0
packaging==17.1
pluggy==0.6.0
py==1.5.3
pygments==2.2.0
pyparsing==2.2.0
pytest-asyncio==0.8.0
pytest==3.5.1
pytz==2018.4
requests==2.18.4
six==1.11.0
snowballstemmer==1.2.1
sphinx-rtd-theme==0.3.1
sphinx==1.7.4
sphinxcontrib-asyncio==0.2.0
sphinxcontrib-websupport==1.0.1
urllib3==1.22
git+https://github.com/Rapptz/discord.py@rewrite#egg=discord.py-1.0

View File

@@ -12,7 +12,11 @@ def main():
if "locales" in os.listdir(os.path.join("redbot/cogs", d)): if "locales" in os.listdir(os.path.join("redbot/cogs", d)):
os.chdir(os.path.join("redbot/cogs", d, "locales")) os.chdir(os.path.join("redbot/cogs", d, "locales"))
if "regen_messages.py" not in os.listdir(os.getcwd()): if "regen_messages.py" not in os.listdir(os.getcwd()):
print("Directory 'locales' exists for {} but no 'regen_messages.py' is available!".format(d)) print(
"Directory 'locales' exists for {} but no 'regen_messages.py' is available!".format(
d
)
)
exit(1) exit(1)
else: else:
print("Running 'regen_messages.py' for {}".format(d)) print("Running 'regen_messages.py' for {}".format(d))

30
make.bat Normal file
View File

@@ -0,0 +1,30 @@
@echo off
if "%1"=="" goto help
REM This allows us to expand variables at execution
setlocal ENABLEDELAYEDEXPANSION
REM This will set PYFILES as a list of tracked .py files
set PYFILES=
for /F "tokens=* USEBACKQ" %%A in (`git ls-files "*.py"`) do (
set PYFILES=!PYFILES! %%A
)
goto %1
:reformat
black -l 99 !PYFILES!
exit /B %ERRORLEVEL%
:stylecheck
black -l 99 --check !PYFILES!
exit /B %ERRORLEVEL%
:help
echo Usage:
echo make ^<command^>
echo.
echo Commands:
echo reformat Reformat all .py files being tracked by git.
echo stylecheck Check which tracked .py files need reformatting.

View File

@@ -1,11 +1,23 @@
import sys import sys
import typing
import discord import discord
from colorama import init, Back
init()
# Let's do all the dumb version checking in one place. # Let's do all the dumb version checking in one place.
if discord.version_info.major < 1: if discord.version_info.major < 1:
print("You are not running the rewritten version of discord.py.\n\n" print(
"In order to use Red v3 you MUST be running d.py version" "You are not running the rewritten version of discord.py.\n\n"
" >= 1.0.0.") "In order to use Red v3 you MUST be running d.py version"
" >= 1.0.0."
)
sys.exit(1) sys.exit(1)
if sys.version_info < (3, 6, 0):
print(Back.RED + "[DEPRECATION WARNING]")
print(
Back.RED + "You are currently running Python 3.5."
" Support for Python 3.5 will end with the release of beta 16."
" Please update your environment to Python 3.6 as soon as possible to avoid"
" any interruptions after the beta 16 release."
)

View File

@@ -40,24 +40,25 @@ def init_loggers(cli_flags):
logger = logging.getLogger("red") logger = logging.getLogger("red")
red_format = logging.Formatter( red_format = logging.Formatter(
'%(asctime)s %(levelname)s %(module)s %(funcName)s %(lineno)d: ' "%(asctime)s %(levelname)s %(module)s %(funcName)s %(lineno)d: " "%(message)s",
'%(message)s', datefmt="[%d/%m/%Y %H:%M]",
datefmt="[%d/%m/%Y %H:%M]") )
stdout_handler = logging.StreamHandler(sys.stdout) stdout_handler = logging.StreamHandler(sys.stdout)
stdout_handler.setFormatter(red_format) stdout_handler.setFormatter(red_format)
if cli_flags.debug: if cli_flags.debug:
os.environ['PYTHONASYNCIODEBUG'] = '1' os.environ["PYTHONASYNCIODEBUG"] = "1"
logger.setLevel(logging.DEBUG) logger.setLevel(logging.DEBUG)
else: else:
logger.setLevel(logging.WARNING) logger.setLevel(logging.WARNING)
from redbot.core.data_manager import core_data_path from redbot.core.data_manager import core_data_path
logfile_path = core_data_path() / 'red.log'
logfile_path = core_data_path() / "red.log"
fhandler = logging.handlers.RotatingFileHandler( fhandler = logging.handlers.RotatingFileHandler(
filename=str(logfile_path), encoding='utf-8', mode='a', filename=str(logfile_path), encoding="utf-8", mode="a", maxBytes=10 ** 7, backupCount=5
maxBytes=10**7, backupCount=5) )
fhandler.setFormatter(red_format) fhandler.setFormatter(red_format)
logger.addHandler(fhandler) logger.addHandler(fhandler)
@@ -76,15 +77,17 @@ async def _get_prefix_and_token(red, indict):
:param indict: :param indict:
:return: :return:
""" """
indict['token'] = await red.db.token() indict["token"] = await red.db.token()
indict['prefix'] = await red.db.prefix() indict["prefix"] = await red.db.prefix()
indict['enable_sentry'] = await red.db.enable_sentry() indict["enable_sentry"] = await red.db.enable_sentry()
def list_instances(): def list_instances():
if not config_file.exists(): if not config_file.exists():
print("No instances have been configured! Configure one " print(
"using `redbot-setup` before trying to run the bot!") "No instances have been configured! Configure one "
"using `redbot-setup` before trying to run the bot!"
)
sys.exit(1) sys.exit(1)
else: else:
data = JsonIO(config_file)._load_json() data = JsonIO(config_file)._load_json()
@@ -96,15 +99,18 @@ def list_instances():
def main(): def main():
description = "Red - Version {}".format(__version__)
cli_flags = parse_cli_flags(sys.argv[1:]) cli_flags = parse_cli_flags(sys.argv[1:])
if cli_flags.list_instances: if cli_flags.list_instances:
list_instances() list_instances()
elif cli_flags.version:
print(description)
sys.exit(0)
elif not cli_flags.instance_name: elif not cli_flags.instance_name:
print("Error: No instance name was provided!") print("Error: No instance name was provided!")
sys.exit(1) sys.exit(1)
load_basic_configuration(cli_flags.instance_name) load_basic_configuration(cli_flags.instance_name)
log, sentry_log = init_loggers(cli_flags) log, sentry_log = init_loggers(cli_flags)
description = "Red - Version {}".format(__version__)
red = Red(cli_flags, description=description, pm_help=None) red = Red(cli_flags, description=description, pm_help=None)
init_global_checks(red) init_global_checks(red)
init_events(red, cli_flags) init_events(red, cli_flags)
@@ -115,29 +121,34 @@ def main():
loop = asyncio.get_event_loop() loop = asyncio.get_event_loop()
tmp_data = {} tmp_data = {}
loop.run_until_complete(_get_prefix_and_token(red, tmp_data)) loop.run_until_complete(_get_prefix_and_token(red, tmp_data))
token = os.environ.get("RED_TOKEN", tmp_data['token']) token = os.environ.get("RED_TOKEN", tmp_data["token"])
prefix = cli_flags.prefix or tmp_data['prefix'] prefix = cli_flags.prefix or tmp_data["prefix"]
if token is None or not prefix: if token is None or not prefix:
if cli_flags.no_prompt is False: if cli_flags.no_prompt is False:
new_token = interactive_config(red, token_set=bool(token), new_token = interactive_config(red, token_set=bool(token), prefix_set=bool(prefix))
prefix_set=bool(prefix))
if new_token: if new_token:
token = new_token token = new_token
else: else:
log.critical("Token and prefix must be set in order to login.") log.critical("Token and prefix must be set in order to login.")
sys.exit(1) sys.exit(1)
loop.run_until_complete(_get_prefix_and_token(red, tmp_data)) loop.run_until_complete(_get_prefix_and_token(red, tmp_data))
if tmp_data['enable_sentry']:
if cli_flags.dry_run:
loop.run_until_complete(red.http.close())
sys.exit(0)
if tmp_data["enable_sentry"]:
red.enable_sentry() red.enable_sentry()
cleanup_tasks = True cleanup_tasks = True
try: try:
loop.run_until_complete(red.start(token, bot=not cli_flags.not_bot)) loop.run_until_complete(red.start(token, bot=not cli_flags.not_bot))
except discord.LoginFailure: except discord.LoginFailure:
cleanup_tasks = False # No login happened, no need for this cleanup_tasks = False # No login happened, no need for this
log.critical("This token doesn't seem to be valid. If it belongs to " log.critical(
"a user account, remember that the --not-bot flag " "This token doesn't seem to be valid. If it belongs to "
"must be used. For self-bot functionalities instead, " "a user account, remember that the --not-bot flag "
"--self-bot") "must be used. For self-bot functionalities instead, "
"--self-bot"
)
db_token = red.db.token() db_token = red.db.token()
if db_token and not cli_flags.no_prompt: if db_token and not cli_flags.no_prompt:
print("\nDo you want to reset the token? (y/n)") print("\nDo you want to reset the token? (y/n)")
@@ -153,15 +164,13 @@ def main():
sentry_log.critical("Fatal Exception", exc_info=e) sentry_log.critical("Fatal Exception", exc_info=e)
loop.run_until_complete(red.logout()) loop.run_until_complete(red.logout())
finally: finally:
rpc.clean_up()
if cleanup_tasks: if cleanup_tasks:
pending = asyncio.Task.all_tasks(loop=red.loop) pending = asyncio.Task.all_tasks(loop=red.loop)
gathered = asyncio.gather( gathered = asyncio.gather(*pending, loop=red.loop, return_exceptions=True)
*pending, loop=red.loop, return_exceptions=True)
gathered.cancel() gathered.cancel()
sys.exit(red._shutdown_mode.value) sys.exit(red._shutdown_mode.value)
if __name__ == '__main__': if __name__ == "__main__":
main() main()

View File

@@ -20,14 +20,14 @@ GENERIC_FORBIDDEN = (
HIERARCHY_ISSUE = ( HIERARCHY_ISSUE = (
"I tried to add {role.name} to {member.display_name} but that role" "I tried to add {role.name} to {member.display_name} but that role"
" is higher than my highest role in the Discord heirarchy so I was" " is higher than my highest role in the Discord hierarchy so I was"
" unable to successfully add it. Please give me a higher role and " " unable to successfully add it. Please give me a higher role and "
"try again." "try again."
) )
USER_HIERARCHY_ISSUE = ( USER_HIERARCHY_ISSUE = (
"I tried to add {role.name} to {member.display_name} but that role" "I tried to add {role.name} to {member.display_name} but that role"
" is higher than your highest role in the Discord heirarchy so I was" " is higher than your highest role in the Discord hierarchy so I was"
" unable to successfully add it. Please get a higher role and " " unable to successfully add it. Please get a higher role and "
"try again." "try again."
) )
@@ -40,18 +40,16 @@ RUNNING_ANNOUNCEMENT = (
class Admin: class Admin:
def __init__(self, config=Config):
self.conf = config.get_conf(self, 8237492837454039,
force_registration=True)
self.conf.register_global( def __init__(self, config=Config):
serverlocked=False self.conf = config.get_conf(self, 8237492837454039, force_registration=True)
)
self.conf.register_global(serverlocked=False)
self.conf.register_guild( self.conf.register_guild(
announce_ignore=False, announce_ignore=False,
announce_channel=None, # Integer ID announce_channel=None, # Integer ID
selfroles=[] # List of integer ID's selfroles=[], # List of integer ID's
) )
self.__current_announcer = None self.__current_announcer = None
@@ -63,8 +61,7 @@ class Admin:
pass pass
@staticmethod @staticmethod
async def complain(ctx: commands.Context, message: str, async def complain(ctx: commands.Context, message: str, **kwargs):
**kwargs):
await ctx.send(message.format(**kwargs)) await ctx.send(message.format(**kwargs))
def is_announcing(self) -> bool: def is_announcing(self) -> bool:
@@ -78,8 +75,7 @@ class Admin:
return self.__current_announcer.active or False return self.__current_announcer.active or False
@staticmethod @staticmethod
def pass_heirarchy_check(ctx: commands.Context, def pass_hierarchy_check(ctx: commands.Context, role: discord.Role) -> bool:
role: discord.Role) -> bool:
""" """
Determines if the bot has a higher role than the given one. Determines if the bot has a higher role than the given one.
:param ctx: :param ctx:
@@ -89,8 +85,7 @@ class Admin:
return ctx.guild.me.top_role > role return ctx.guild.me.top_role > role
@staticmethod @staticmethod
def pass_user_heirarchy_check(ctx: commands.Context, def pass_user_hierarchy_check(ctx: commands.Context, role: discord.Role) -> bool:
role: discord.Role) -> bool:
""" """
Determines if a user is allowed to add/remove/edit the given role. Determines if a user is allowed to add/remove/edit the given role.
:param ctx: :param ctx:
@@ -99,50 +94,47 @@ class Admin:
""" """
return ctx.author.top_role > role return ctx.author.top_role > role
async def _addrole(self, ctx: commands.Context, member: discord.Member, async def _addrole(self, ctx: commands.Context, member: discord.Member, role: discord.Role):
role: discord.Role):
try: try:
await member.add_roles(role) await member.add_roles(role)
except discord.Forbidden: except discord.Forbidden:
if not self.pass_heirarchy_check(ctx, role): if not self.pass_hierarchy_check(ctx, role):
await self.complain(ctx, HIERARCHY_ISSUE, role=role, await self.complain(ctx, HIERARCHY_ISSUE, role=role, member=member)
member=member)
else: else:
await self.complain(ctx, GENERIC_FORBIDDEN) await self.complain(ctx, GENERIC_FORBIDDEN)
else: else:
await ctx.send("I successfully added {role.name} to" await ctx.send(
" {member.display_name}".format( "I successfully added {role.name} to"
role=role, member=member " {member.display_name}".format(role=role, member=member)
)) )
async def _removerole(self, ctx: commands.Context, member: discord.Member, async def _removerole(self, ctx: commands.Context, member: discord.Member, role: discord.Role):
role: discord.Role):
try: try:
await member.remove_roles(role) await member.remove_roles(role)
except discord.Forbidden: except discord.Forbidden:
if not self.pass_heirarchy_check(ctx, role): if not self.pass_hierarchy_check(ctx, role):
await self.complain(ctx, HIERARCHY_ISSUE, role=role, await self.complain(ctx, HIERARCHY_ISSUE, role=role, member=member)
member=member)
else: else:
await self.complain(ctx, GENERIC_FORBIDDEN) await self.complain(ctx, GENERIC_FORBIDDEN)
else: else:
await ctx.send("I successfully removed {role.name} from" await ctx.send(
" {member.display_name}".format( "I successfully removed {role.name} from"
role=role, member=member " {member.display_name}".format(role=role, member=member)
)) )
@commands.command() @commands.command()
@commands.guild_only() @commands.guild_only()
@checks.admin_or_permissions(manage_roles=True) @checks.admin_or_permissions(manage_roles=True)
async def addrole(self, ctx: commands.Context, rolename: discord.Role, *, async def addrole(
user: MemberDefaultAuthor=None): self, ctx: commands.Context, rolename: discord.Role, *, user: MemberDefaultAuthor = None
):
""" """
Adds a role to a user. If user is left blank it defaults to the Adds a role to a user. If user is left blank it defaults to the
author of the command. author of the command.
""" """
if user is None: if user is None:
user = ctx.author user = ctx.author
if self.pass_user_heirarchy_check(ctx, rolename): if self.pass_user_hierarchy_check(ctx, rolename):
# noinspection PyTypeChecker # noinspection PyTypeChecker
await self._addrole(ctx, user, rolename) await self._addrole(ctx, user, rolename)
else: else:
@@ -151,15 +143,16 @@ class Admin:
@commands.command() @commands.command()
@commands.guild_only() @commands.guild_only()
@checks.admin_or_permissions(manage_roles=True) @checks.admin_or_permissions(manage_roles=True)
async def removerole(self, ctx: commands.Context, rolename: discord.Role, *, async def removerole(
user: MemberDefaultAuthor=None): self, ctx: commands.Context, rolename: discord.Role, *, user: MemberDefaultAuthor = None
):
""" """
Removes a role from a user. If user is left blank it defaults to the Removes a role from a user. If user is left blank it defaults to the
author of the command. author of the command.
""" """
if user is None: if user is None:
user = ctx.author user = ctx.author
if self.pass_user_heirarchy_check(ctx, rolename): if self.pass_user_hierarchy_check(ctx, rolename):
# noinspection PyTypeChecker # noinspection PyTypeChecker
await self._removerole(ctx, user, rolename) await self._removerole(ctx, user, rolename)
else: else:
@@ -173,9 +166,10 @@ class Admin:
if ctx.invoked_subcommand is None: if ctx.invoked_subcommand is None:
await ctx.send_help() await ctx.send_help()
@editrole.command(name="colour", aliases=["color", ]) @editrole.command(name="colour", aliases=["color"])
async def editrole_colour(self, ctx: commands.Context, role: discord.Role, async def editrole_colour(
value: discord.Colour): self, ctx: commands.Context, role: discord.Role, value: discord.Colour
):
"""Edits a role's colour """Edits a role's colour
Use double quotes if the role contains spaces. Use double quotes if the role contains spaces.
@@ -185,10 +179,9 @@ class Admin:
!editrole colour \"The Transistor\" #ff0000 !editrole colour \"The Transistor\" #ff0000
!editrole colour Test #ff9900""" !editrole colour Test #ff9900"""
author = ctx.author author = ctx.author
reason = "{}({}) changed the colour of role '{}'".format( reason = "{}({}) changed the colour of role '{}'".format(author.name, author.id, role.name)
author.name, author.id, role.name)
if not self.pass_user_heirarchy_check(ctx, role): if not self.pass_user_hierarchy_check(ctx, role):
await self.complain(ctx, USER_HIERARCHY_ISSUE) await self.complain(ctx, USER_HIERARCHY_ISSUE)
return return
@@ -211,9 +204,10 @@ class Admin:
author = ctx.message.author author = ctx.message.author
old_name = role.name old_name = role.name
reason = "{}({}) changed the name of role '{}' to '{}'".format( reason = "{}({}) changed the name of role '{}' to '{}'".format(
author.name, author.id, old_name, name) author.name, author.id, old_name, name
)
if not self.pass_user_heirarchy_check(ctx, role): if not self.pass_user_hierarchy_check(ctx, role):
await self.complain(ctx, USER_HIERARCHY_ISSUE) await self.complain(ctx, USER_HIERARCHY_ISSUE)
return return
@@ -240,8 +234,7 @@ class Admin:
await ctx.send("The announcement has begun.") await ctx.send("The announcement has begun.")
else: else:
prefix = ctx.prefix prefix = ctx.prefix
await self.complain(ctx, RUNNING_ANNOUNCEMENT, await self.complain(ctx, RUNNING_ANNOUNCEMENT, prefix=prefix)
prefix=prefix)
@announce.command(name="cancel") @announce.command(name="cancel")
@checks.is_owner() @checks.is_owner()
@@ -259,7 +252,7 @@ class Admin:
@announce.command(name="channel") @announce.command(name="channel")
@commands.guild_only() @commands.guild_only()
@checks.guildowner_or_permissions(administrator=True) @checks.guildowner_or_permissions(administrator=True)
async def announce_channel(self, ctx, *, channel: discord.TextChannel=None): async def announce_channel(self, ctx, *, channel: discord.TextChannel = None):
""" """
Changes the channel on which the bot makes announcements. Changes the channel on which the bot makes announcements.
""" """
@@ -267,14 +260,12 @@ class Admin:
channel = ctx.channel channel = ctx.channel
await self.conf.guild(ctx.guild).announce_channel.set(channel.id) await self.conf.guild(ctx.guild).announce_channel.set(channel.id)
await ctx.send("The announcement channel has been set to {}".format( await ctx.send("The announcement channel has been set to {}".format(channel.mention))
channel.mention
))
@announce.command(name="ignore") @announce.command(name="ignore")
@commands.guild_only() @commands.guild_only()
@checks.guildowner_or_permissions(administrator=True) @checks.guildowner_or_permissions(administrator=True)
async def announce_ignore(self, ctx, *, guild: discord.Guild=None): async def announce_ignore(self, ctx, *, guild: discord.Guild = None):
""" """
Toggles whether the announcements will ignore the given server. Toggles whether the announcements will ignore the given server.
Defaults to the current server if none is provided. Defaults to the current server if none is provided.
@@ -287,9 +278,7 @@ class Admin:
verb = "will" if ignored else "will not" verb = "will" if ignored else "will not"
await ctx.send("The server {} {} receive announcements.".format( await ctx.send("The server {} {} receive announcements.".format(guild.name, verb))
guild.name, verb
))
async def _valid_selfroles(self, guild: discord.Guild) -> Tuple[discord.Role]: async def _valid_selfroles(self, guild: discord.Guild) -> Tuple[discord.Role]:
""" """
@@ -375,7 +364,7 @@ class Admin:
@checks.is_owner() @checks.is_owner()
async def serverlock(self, ctx: commands.Context): async def serverlock(self, ctx: commands.Context):
""" """
Locks a bot to it's current servers only. Locks a bot to its current servers only.
""" """
serverlocked = await self.conf.serverlocked() serverlocked = await self.conf.serverlocked()
await self.conf.serverlocked.set(not serverlocked) await self.conf.serverlocked.set(not serverlocked)
@@ -384,8 +373,10 @@ class Admin:
await ctx.send("The bot {} serverlocked.".format(verb)) await ctx.send("The bot {} serverlocked.".format(verb))
# region Event Handlers # region Event Handlers
async def on_guild_join(self, guild: discord.Guild): async def on_guild_join(self, guild: discord.Guild):
if await self._serverlock_check(guild): if await self._serverlock_check(guild):
return return
# endregion # endregion

View File

@@ -5,9 +5,8 @@ from discord.ext import commands
class Announcer: class Announcer:
def __init__(self, ctx: commands.Context,
message: str, def __init__(self, ctx: commands.Context, message: str, config=None):
config=None):
""" """
:param ctx: :param ctx:
:param message: :param message:
@@ -65,10 +64,7 @@ class Announcer:
try: try:
await channel.send(self.message) await channel.send(self.message)
except discord.Forbidden: except discord.Forbidden:
await bot_owner.send("I could not announce to guild: {}".format( await bot_owner.send("I could not announce to server: {}".format(g.id))
g.id
))
await asyncio.sleep(0.5) await asyncio.sleep(0.5)
self.active = False self.active = False

View File

@@ -3,6 +3,7 @@ from discord.ext import commands
class MemberDefaultAuthor(commands.Converter): class MemberDefaultAuthor(commands.Converter):
async def convert(self, ctx: commands.Context, arg: str) -> discord.Member: async def convert(self, ctx: commands.Context, arg: str) -> discord.Member:
member_converter = commands.MemberConverter() member_converter = commands.MemberConverter()
try: try:
@@ -16,6 +17,7 @@ class MemberDefaultAuthor(commands.Converter):
class SelfRole(commands.Converter): class SelfRole(commands.Converter):
async def convert(self, ctx: commands.Context, arg: str) -> discord.Role: async def convert(self, ctx: commands.Context, arg: str) -> discord.Role:
admin = ctx.command.instance admin = ctx.command.instance
if admin is None: if admin is None:
@@ -28,6 +30,5 @@ class SelfRole(commands.Converter):
role = await role_converter.convert(ctx, arg) role = await role_converter.convert(ctx, arg)
if role.id not in selfroles: if role.id not in selfroles:
raise commands.BadArgument("The provided role is not a valid" raise commands.BadArgument("The provided role is not a valid" " selfrole.")
" selfrole.")
return role return role

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:32-0500\n" "PO-Revision-Date: 2018-04-15 16:41-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Arabic\n" "Language-Team: Arabic\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:33-0500\n" "PO-Revision-Date: 2018-04-15 16:42-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Bulgarian\n" "Language-Team: Bulgarian\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:33-0500\n" "PO-Revision-Date: 2018-04-15 16:42-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Danish\n" "Language-Team: Danish\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:33-0500\n" "PO-Revision-Date: 2018-04-15 16:42-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: German\n" "Language-Team: German\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:33-0500\n" "PO-Revision-Date: 2018-04-15 16:42-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Greek\n" "Language-Team: Greek\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:34-0500\n" "PO-Revision-Date: 2018-04-15 16:43-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Pirate English\n" "Language-Team: Pirate English\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:32-0500\n" "PO-Revision-Date: 2018-04-15 16:41-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Spanish\n" "Language-Team: Spanish\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:33-0500\n" "PO-Revision-Date: 2018-04-15 16:42-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Finnish\n" "Language-Team: Finnish\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:32-0500\n" "PO-Revision-Date: 2018-04-15 16:41-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: French\n" "Language-Team: French\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:33-0500\n" "PO-Revision-Date: 2018-04-15 16:42-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Hungarian\n" "Language-Team: Hungarian\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:34-0500\n" "PO-Revision-Date: 2018-04-15 16:43-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Indonesian\n" "Language-Team: Indonesian\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:33-0500\n" "PO-Revision-Date: 2018-04-15 16:42-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Italian\n" "Language-Team: Italian\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:33-0500\n" "PO-Revision-Date: 2018-04-15 16:42-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Japanese\n" "Language-Team: Japanese\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:33-0500\n" "PO-Revision-Date: 2018-04-15 16:42-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Korean\n" "Language-Team: Korean\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:34-0500\n" "PO-Revision-Date: 2018-04-15 16:43-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: LOLCAT\n" "Language-Team: LOLCAT\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:33-0500\n" "PO-Revision-Date: 2018-04-15 16:42-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Dutch\n" "Language-Team: Dutch\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:33-0500\n" "PO-Revision-Date: 2018-04-15 16:42-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Norwegian\n" "Language-Team: Norwegian\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:33-0500\n" "PO-Revision-Date: 2018-04-15 16:43-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Polish\n" "Language-Team: Polish\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:34-0500\n" "PO-Revision-Date: 2018-04-15 16:43-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Portuguese, Brazilian\n" "Language-Team: Portuguese, Brazilian\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:33-0500\n" "PO-Revision-Date: 2018-04-15 16:43-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Portuguese\n" "Language-Team: Portuguese\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -1,14 +1,10 @@
import subprocess import subprocess
TO_TRANSLATE = [ TO_TRANSLATE = ["../admin.py"]
'../admin.py'
]
def regen_messages(): def regen_messages():
subprocess.run( subprocess.run(["pygettext", "-n"] + TO_TRANSLATE)
['pygettext', '-n'] + TO_TRANSLATE
)
if __name__ == "__main__": if __name__ == "__main__":

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:33-0500\n" "PO-Revision-Date: 2018-04-15 16:43-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Russian\n" "Language-Team: Russian\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:34-0500\n" "PO-Revision-Date: 2018-04-15 16:43-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Swedish\n" "Language-Team: Swedish\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:34-0500\n" "PO-Revision-Date: 2018-04-15 16:43-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Chinese Simplified\n" "Language-Team: Chinese Simplified\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -3,17 +3,17 @@ from re import search
from typing import Generator, Tuple, Iterable from typing import Generator, Tuple, Iterable
import discord import discord
from redbot.core import Config from redbot.core import Config, commands, checks
from redbot.core.i18n import CogI18n from redbot.core.i18n import Translator, cog_i18n
from redbot.core.utils.chat_formatting import box from redbot.core.utils.chat_formatting import box
from discord.ext import commands
from redbot.core.bot import Red from redbot.core.bot import Red
from .alias_entry import AliasEntry from .alias_entry import AliasEntry
_ = CogI18n("Alias", __file__) _ = Translator("Alias", __file__)
@cog_i18n(_)
class Alias: class Alias:
""" """
Alias Alias
@@ -26,14 +26,9 @@ class Alias:
and append them to the stored alias and append them to the stored alias
""" """
default_global_settings = { default_global_settings = {"entries": []}
"entries": []
}
default_guild_settings = { default_guild_settings = {"enabled": False, "entries": []} # Going to be a list of dicts
"enabled": False,
"entries": [] # Going to be a list of dicts
}
def __init__(self, bot: Red): def __init__(self, bot: Red):
self.bot = bot self.bot = bot
@@ -49,14 +44,17 @@ class Alias:
return (AliasEntry.from_json(d) for d in (await self._aliases.entries())) return (AliasEntry.from_json(d) for d in (await self._aliases.entries()))
async def loaded_aliases(self, guild: discord.Guild) -> Generator[AliasEntry, None, None]: async def loaded_aliases(self, guild: discord.Guild) -> Generator[AliasEntry, None, None]:
return (AliasEntry.from_json(d, bot=self.bot) return (
for d in (await self._aliases.guild(guild).entries())) AliasEntry.from_json(d, bot=self.bot)
for d in (await self._aliases.guild(guild).entries())
)
async def loaded_global_aliases(self) -> Generator[AliasEntry, None, None]: async def loaded_global_aliases(self) -> Generator[AliasEntry, None, None]:
return (AliasEntry.from_json(d, bot=self.bot) for d in (await self._aliases.entries())) return (AliasEntry.from_json(d, bot=self.bot) for d in (await self._aliases.entries()))
async def is_alias(self, guild: discord.Guild, alias_name: str, async def is_alias(
server_aliases: Iterable[AliasEntry]=()) -> (bool, AliasEntry): self, guild: discord.Guild, alias_name: str, server_aliases: Iterable[AliasEntry] = ()
) -> (bool, AliasEntry):
if not server_aliases: if not server_aliases:
server_aliases = await self.unloaded_aliases(guild) server_aliases = await self.unloaded_aliases(guild)
@@ -76,10 +74,11 @@ class Alias:
@staticmethod @staticmethod
def is_valid_alias_name(alias_name: str) -> bool: def is_valid_alias_name(alias_name: str) -> bool:
return not bool(search(r'\s', alias_name)) and alias_name.isprintable() return not bool(search(r"\s", alias_name)) and alias_name.isprintable()
async def add_alias(self, ctx: commands.Context, alias_name: str, async def add_alias(
command: Tuple[str], global_: bool=False) -> AliasEntry: self, ctx: commands.Context, alias_name: str, command: Tuple[str], global_: bool = False
) -> AliasEntry:
alias = AliasEntry(alias_name, command, ctx.author, global_=global_) alias = AliasEntry(alias_name, command, ctx.author, global_=global_)
if global_: if global_:
@@ -93,8 +92,9 @@ class Alias:
return alias return alias
async def delete_alias(self, ctx: commands.Context, alias_name: str, async def delete_alias(
global_: bool=False) -> bool: self, ctx: commands.Context, alias_name: str, global_: bool = False
) -> bool:
if global_: if global_:
settings = self._aliases settings = self._aliases
else: else:
@@ -120,16 +120,15 @@ class Alias:
""" """
content = message.content content = message.content
prefix_list = await self.bot.command_prefix(self.bot, message) prefix_list = await self.bot.command_prefix(self.bot, message)
prefixes = sorted(prefix_list, prefixes = sorted(prefix_list, key=lambda pfx: len(pfx), reverse=True)
key=lambda pfx: len(pfx),
reverse=True)
for p in prefixes: for p in prefixes:
if content.startswith(p): if content.startswith(p):
return p return p
raise ValueError(_("No prefix found.")) raise ValueError(_("No prefix found."))
def get_extra_args_from_alias(self, message: discord.Message, prefix: str, def get_extra_args_from_alias(
alias: AliasEntry) -> str: self, message: discord.Message, prefix: str, alias: AliasEntry
) -> str:
""" """
When an alias is executed by a user in chat this function tries When an alias is executed by a user in chat this function tries
to get any extra arguments passed in with the call. to get any extra arguments passed in with the call.
@@ -143,25 +142,27 @@ class Alias:
extra = message.content[known_content_length:].strip() extra = message.content[known_content_length:].strip()
return extra return extra
async def maybe_call_alias(self, message: discord.Message, async def maybe_call_alias(
aliases: Iterable[AliasEntry]=None): self, message: discord.Message, aliases: Iterable[AliasEntry] = None
):
try: try:
prefix = await self.get_prefix(message) prefix = await self.get_prefix(message)
except ValueError: except ValueError:
return return
try: try:
potential_alias = message.content[len(prefix):].split(" ")[0] potential_alias = message.content[len(prefix) :].split(" ")[0]
except IndexError: except IndexError:
return False return False
is_alias, alias = await self.is_alias(message.guild, potential_alias, server_aliases=aliases) is_alias, alias = await self.is_alias(
message.guild, potential_alias, server_aliases=aliases
)
if is_alias: if is_alias:
await self.call_alias(message, prefix, alias) await self.call_alias(message, prefix, alias)
async def call_alias(self, message: discord.Message, prefix: str, async def call_alias(self, message: discord.Message, prefix: str, alias: AliasEntry):
alias: AliasEntry):
new_message = copy(message) new_message = copy(message)
args = self.get_extra_args_from_alias(message, prefix, alias) args = self.get_extra_args_from_alias(message, prefix, alias)
@@ -181,83 +182,108 @@ class Alias:
""" """
Manage global aliases. Manage global aliases.
""" """
if ctx.invoked_subcommand is None or \ if ctx.invoked_subcommand is None or isinstance(ctx.invoked_subcommand, commands.Group):
isinstance(ctx.invoked_subcommand, commands.Group):
await ctx.send_help() await ctx.send_help()
@checks.mod_or_permissions(manage_guild=True)
@alias.command(name="add") @alias.command(name="add")
@commands.guild_only() @commands.guild_only()
async def _add_alias(self, ctx: commands.Context, async def _add_alias(self, ctx: commands.Context, alias_name: str, *, command):
alias_name: str, *, command):
""" """
Add an alias for a command. Add an alias for a command.
""" """
# region Alias Add Validity Checking # region Alias Add Validity Checking
is_command = self.is_command(alias_name) is_command = self.is_command(alias_name)
if is_command: if is_command:
await ctx.send(_("You attempted to create a new alias" await ctx.send(
" with the name {} but that" _(
" name is already a command on this bot.").format(alias_name)) "You attempted to create a new alias"
" with the name {} but that"
" name is already a command on this bot."
).format(alias_name)
)
return return
is_alias, something_useless = await self.is_alias(ctx.guild, alias_name) is_alias, something_useless = await self.is_alias(ctx.guild, alias_name)
if is_alias: if is_alias:
await ctx.send(_("You attempted to create a new alias" await ctx.send(
" with the name {} but that" _(
" alias already exists on this server.").format(alias_name)) "You attempted to create a new alias"
" with the name {} but that"
" alias already exists on this server."
).format(alias_name)
)
return return
is_valid_name = self.is_valid_alias_name(alias_name) is_valid_name = self.is_valid_alias_name(alias_name)
if not is_valid_name: if not is_valid_name:
await ctx.send(_("You attempted to create a new alias" await ctx.send(
" with the name {} but that" _(
" name is an invalid alias name. Alias" "You attempted to create a new alias"
" names may not contain spaces.").format(alias_name)) " with the name {} but that"
" name is an invalid alias name. Alias"
" names may not contain spaces."
).format(alias_name)
)
return return
# endregion # endregion
# At this point we know we need to make a new alias # At this point we know we need to make a new alias
# and that the alias name is valid. # and that the alias name is valid.
await self.add_alias(ctx, alias_name, command) await self.add_alias(ctx, alias_name, command)
await ctx.send(_("A new alias with the trigger `{}`" await ctx.send(
" has been created.").format(alias_name)) _("A new alias with the trigger `{}`" " has been created.").format(alias_name)
)
@checks.is_owner()
@global_.command(name="add") @global_.command(name="add")
async def _add_global_alias(self, ctx: commands.Context, async def _add_global_alias(self, ctx: commands.Context, alias_name: str, *, command):
alias_name: str, *, command):
""" """
Add a global alias for a command. Add a global alias for a command.
""" """
# region Alias Add Validity Checking # region Alias Add Validity Checking
is_command = self.is_command(alias_name) is_command = self.is_command(alias_name)
if is_command: if is_command:
await ctx.send(_("You attempted to create a new global alias" await ctx.send(
" with the name {} but that" _(
" name is already a command on this bot.").format(alias_name)) "You attempted to create a new global alias"
" with the name {} but that"
" name is already a command on this bot."
).format(alias_name)
)
return return
is_alias, something_useless = await self.is_alias(ctx.guild, alias_name) is_alias, something_useless = await self.is_alias(ctx.guild, alias_name)
if is_alias: if is_alias:
await ctx.send(_("You attempted to create a new global alias" await ctx.send(
" with the name {} but that" _(
" alias already exists on this server.").format(alias_name)) "You attempted to create a new global alias"
" with the name {} but that"
" alias already exists on this server."
).format(alias_name)
)
return return
is_valid_name = self.is_valid_alias_name(alias_name) is_valid_name = self.is_valid_alias_name(alias_name)
if not is_valid_name: if not is_valid_name:
await ctx.send(_("You attempted to create a new global alias" await ctx.send(
" with the name {} but that" _(
" name is an invalid alias name. Alias" "You attempted to create a new global alias"
" names may not contain spaces.").format(alias_name)) " with the name {} but that"
" name is an invalid alias name. Alias"
" names may not contain spaces."
).format(alias_name)
)
return return
# endregion # endregion
await self.add_alias(ctx, alias_name, command, global_=True) await self.add_alias(ctx, alias_name, command, global_=True)
await ctx.send(_("A new global alias with the trigger `{}`" await ctx.send(
" has been created.").format(alias_name)) _("A new global alias with the trigger `{}`" " has been created.").format(alias_name)
)
@alias.command(name="help") @alias.command(name="help")
@commands.guild_only() @commands.guild_only()
@@ -280,11 +306,15 @@ class Alias:
is_alias, alias = await self.is_alias(ctx.guild, alias_name) is_alias, alias = await self.is_alias(ctx.guild, alias_name)
if is_alias: if is_alias:
await ctx.send(_("The `{}` alias will execute the" await ctx.send(
" command `{}`").format(alias_name, alias.command)) _("The `{}` alias will execute the" " command `{}`").format(
alias_name, alias.command
)
)
else: else:
await ctx.send(_("There is no alias with the name `{}`").format(alias_name)) await ctx.send(_("There is no alias with the name `{}`").format(alias_name))
@checks.mod_or_permissions(manage_guild=True)
@alias.command(name="del") @alias.command(name="del")
@commands.guild_only() @commands.guild_only()
async def _del_alias(self, ctx: commands.Context, alias_name: str): async def _del_alias(self, ctx: commands.Context, alias_name: str):
@@ -299,11 +329,13 @@ class Alias:
return return
if await self.delete_alias(ctx, alias_name): if await self.delete_alias(ctx, alias_name):
await ctx.send(_("Alias with the name `{}` was successfully" await ctx.send(
" deleted.").format(alias_name)) _("Alias with the name `{}` was successfully" " deleted.").format(alias_name)
)
else: else:
await ctx.send(_("Alias with name `{}` was not found.").format(alias_name)) await ctx.send(_("Alias with name `{}` was not found.").format(alias_name))
@checks.is_owner()
@global_.command(name="del") @global_.command(name="del")
async def _del_global_alias(self, ctx: commands.Context, alias_name: str): async def _del_global_alias(self, ctx: commands.Context, alias_name: str):
""" """
@@ -317,8 +349,9 @@ class Alias:
return return
if await self.delete_alias(ctx, alias_name, global_=True): if await self.delete_alias(ctx, alias_name, global_=True):
await ctx.send(_("Alias with the name `{}` was successfully" await ctx.send(
" deleted.").format(alias_name)) _("Alias with the name `{}` was successfully" " deleted.").format(alias_name)
)
else: else:
await ctx.send(_("Alias with name `{}` was not found.").format(alias_name)) await ctx.send(_("Alias with name `{}` was not found.").format(alias_name))
@@ -328,7 +361,9 @@ class Alias:
""" """
Lists the available aliases on this server. Lists the available aliases on this server.
""" """
names = [_("Aliases:"), ] + sorted(["+ " + a.name for a in (await self.unloaded_aliases(ctx.guild))]) names = [_("Aliases:")] + sorted(
["+ " + a.name for a in (await self.unloaded_aliases(ctx.guild))]
)
if len(names) == 0: if len(names) == 0:
await ctx.send(_("There are no aliases on this server.")) await ctx.send(_("There are no aliases on this server."))
else: else:
@@ -339,7 +374,9 @@ class Alias:
""" """
Lists the available global aliases on this bot. Lists the available global aliases on this bot.
""" """
names = [_("Aliases:"), ] + sorted(["+ " + a.name for a in await self.unloaded_global_aliases()]) names = [_("Aliases:")] + sorted(
["+ " + a.name for a in await self.unloaded_global_aliases()]
)
if len(names) == 0: if len(names) == 0:
await ctx.send(_("There are no aliases on this server.")) await ctx.send(_("There are no aliases on this server."))
else: else:

View File

@@ -1,12 +1,14 @@
from typing import Tuple from typing import Tuple
from discord.ext import commands
import discord import discord
from redbot.core import commands
class AliasEntry: class AliasEntry:
def __init__(self, name: str, command: Tuple[str],
creator: discord.Member, global_: bool=False): def __init__(
self, name: str, command: Tuple[str], creator: discord.Member, global_: bool = False
):
super().__init__() super().__init__()
self.has_real_data = False self.has_real_data = False
self.name = name self.name = name
@@ -43,13 +45,12 @@ class AliasEntry:
"creator": creator, "creator": creator,
"guild": guild, "guild": guild,
"global": self.global_, "global": self.global_,
"uses": self.uses "uses": self.uses,
} }
@classmethod @classmethod
def from_json(cls, data: dict, bot: commands.Bot=None): def from_json(cls, data: dict, bot: commands.Bot = None):
ret = cls(data["name"], data["command"], ret = cls(data["name"], data["command"], data["creator"], global_=data["global"])
data["creator"], global_=data["global"])
if bot: if bot:
ret.has_real_data = True ret.has_real_data = True

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:32-0500\n" "PO-Revision-Date: 2018-04-15 16:41-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Arabic\n" "Language-Team: Arabic\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:33-0500\n" "PO-Revision-Date: 2018-04-15 16:42-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Bulgarian\n" "Language-Team: Bulgarian\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:33-0500\n" "PO-Revision-Date: 2018-04-15 16:42-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Danish\n" "Language-Team: Danish\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:33-0500\n" "PO-Revision-Date: 2018-04-15 16:42-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: German\n" "Language-Team: German\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:33-0500\n" "PO-Revision-Date: 2018-04-15 16:42-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Greek\n" "Language-Team: Greek\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:34-0500\n" "PO-Revision-Date: 2018-04-15 16:43-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Pirate English\n" "Language-Team: Pirate English\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@@ -22,15 +22,15 @@ msgstr "Arrr, no prefix found capt'n!"
#: ../alias.py:198 #: ../alias.py:198
msgid "You attempted to create a new alias with the name {} but that name is already a command on this bot." msgid "You attempted to create a new alias with the name {} but that name is already a command on this bot."
msgstr "" msgstr "Ye try and make a squeeky-clean alias with the name {} but 'she be taken by another order."
#: ../alias.py:205 #: ../alias.py:205
msgid "You attempted to create a new alias with the name {} but that alias already exists on this server." msgid "You attempted to create a new alias with the name {} but that alias already exists on this server."
msgstr "" msgstr "Ye try and make a Squeeky-clean alias with the name {} but 'she already be on the island."
#: ../alias.py:212 #: ../alias.py:212
msgid "You attempted to create a new alias with the name {} but that name is an invalid alias name. Alias names may not contain spaces." msgid "You attempted to create a new alias with the name {} but that name is an invalid alias name. Alias names may not contain spaces."
msgstr "" msgstr "Ye try and make a Squeeky-clean alias with the name {} but 'she walk the plank! Spaces in an alias must walk the plank."
#: ../alias.py:224 #: ../alias.py:224
msgid "A new alias with the trigger `{}` has been created." msgid "A new alias with the trigger `{}` has been created."
@@ -38,15 +38,15 @@ msgstr "Arrr! A new alias with thee trigger `{}` has been created."
#: ../alias.py:236 #: ../alias.py:236
msgid "You attempted to create a new global alias with the name {} but that name is already a command on this bot." msgid "You attempted to create a new global alias with the name {} but that name is already a command on this bot."
msgstr "" msgstr "Ye try and make a squeeky-clean global alias with the name {} but 'she be taken by another order."
#: ../alias.py:243 #: ../alias.py:243
msgid "You attempted to create a new global alias with the name {} but that alias already exists on this server." msgid "You attempted to create a new global alias with the name {} but that alias already exists on this server."
msgstr "" msgstr "Ye try and make a Squeeky-clean global alias with the name {} but 'she already be on the island."
#: ../alias.py:250 #: ../alias.py:250
msgid "You attempted to create a new global alias with the name {} but that name is an invalid alias name. Alias names may not contain spaces." msgid "You attempted to create a new global alias with the name {} but that name is an invalid alias name. Alias names may not contain spaces."
msgstr "" msgstr "Ye try and make a Squeeky-clean global alias with the name {} but 'she walk the plank! Spaces in an alias must walk the plank."
#: ../alias.py:259 #: ../alias.py:259
msgid "A new global alias with the trigger `{}` has been created." msgid "A new global alias with the trigger `{}` has been created."

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:32-0500\n" "PO-Revision-Date: 2018-04-15 16:41-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Spanish\n" "Language-Team: Spanish\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:33-0500\n" "PO-Revision-Date: 2018-04-15 16:42-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Finnish\n" "Language-Team: Finnish\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:32-0500\n" "PO-Revision-Date: 2018-04-15 16:41-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: French\n" "Language-Team: French\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:33-0500\n" "PO-Revision-Date: 2018-04-15 16:42-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Hungarian\n" "Language-Team: Hungarian\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:34-0500\n" "PO-Revision-Date: 2018-04-15 16:43-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Indonesian\n" "Language-Team: Indonesian\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@@ -22,15 +22,15 @@ msgstr "Awalan tidak ditemukan."
#: ../alias.py:198 #: ../alias.py:198
msgid "You attempted to create a new alias with the name {} but that name is already a command on this bot." msgid "You attempted to create a new alias with the name {} but that name is already a command on this bot."
msgstr "" msgstr "Anda mencoba untuk membuat sebuah alias baru dengan nama {} tetapi nama itu sudah menjadi perintah pada bot ini."
#: ../alias.py:205 #: ../alias.py:205
msgid "You attempted to create a new alias with the name {} but that alias already exists on this server." msgid "You attempted to create a new alias with the name {} but that alias already exists on this server."
msgstr "" msgstr "Anda mencoba untuk membuat sebuah alias baru dengan nama {} tetapi alias itu sudah ada pada server ini."
#: ../alias.py:212 #: ../alias.py:212
msgid "You attempted to create a new alias with the name {} but that name is an invalid alias name. Alias names may not contain spaces." msgid "You attempted to create a new alias with the name {} but that name is an invalid alias name. Alias names may not contain spaces."
msgstr "" msgstr "Anda mencoba untuk membuat sebuah alias baru dengan nama {} tetapi nama itu adalah sebuah nama alias yang tidak berlaku. Nama alias tidak boleh berisi spasi."
#: ../alias.py:224 #: ../alias.py:224
msgid "A new alias with the trigger `{}` has been created." msgid "A new alias with the trigger `{}` has been created."
@@ -38,15 +38,15 @@ msgstr "Alias baru dengan pemicu '{}' telah dibuat."
#: ../alias.py:236 #: ../alias.py:236
msgid "You attempted to create a new global alias with the name {} but that name is already a command on this bot." msgid "You attempted to create a new global alias with the name {} but that name is already a command on this bot."
msgstr "" msgstr "Anda mencoba untuk membuat sebuah alias global baru dengan nama {} tetapi nama itu sudah menjadi sebuah perintah pada bot ini."
#: ../alias.py:243 #: ../alias.py:243
msgid "You attempted to create a new global alias with the name {} but that alias already exists on this server." msgid "You attempted to create a new global alias with the name {} but that alias already exists on this server."
msgstr "" msgstr "Anda mencoba untuk membuat sebuah alias global baru dengan nama {} tetapi alias itu sudah ada pada server ini."
#: ../alias.py:250 #: ../alias.py:250
msgid "You attempted to create a new global alias with the name {} but that name is an invalid alias name. Alias names may not contain spaces." msgid "You attempted to create a new global alias with the name {} but that name is an invalid alias name. Alias names may not contain spaces."
msgstr "" msgstr "Anda mencoba untuk membuat sebuah alias global baru dengan nama {} tetapi nama itu adalah sebuah nama alias yang tidak berlaku. Nama alias tidak boleh berisi spasi."
#: ../alias.py:259 #: ../alias.py:259
msgid "A new global alias with the trigger `{}` has been created." msgid "A new global alias with the trigger `{}` has been created."

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:33-0500\n" "PO-Revision-Date: 2018-04-15 16:42-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Italian\n" "Language-Team: Italian\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:33-0500\n" "PO-Revision-Date: 2018-04-15 16:42-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Japanese\n" "Language-Team: Japanese\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:33-0500\n" "PO-Revision-Date: 2018-04-15 16:42-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Korean\n" "Language-Team: Korean\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@@ -18,73 +18,73 @@ msgstr ""
#: ../alias.py:129 #: ../alias.py:129
msgid "No prefix found." msgid "No prefix found."
msgstr "접두사가 발견되지 않았습니다." msgstr "프리픽스를 찾을 수 없어요."
#: ../alias.py:198 #: ../alias.py:198
msgid "You attempted to create a new alias with the name {} but that name is already a command on this bot." msgid "You attempted to create a new alias with the name {} but that name is already a command on this bot."
msgstr "" msgstr "이름이 {} 인 바로가기를 만들려고 했지만, 이 봇의 커맨드와 중복돼요."
#: ../alias.py:205 #: ../alias.py:205
msgid "You attempted to create a new alias with the name {} but that alias already exists on this server." msgid "You attempted to create a new alias with the name {} but that alias already exists on this server."
msgstr "" msgstr "이름이 {} 인 바로가기를 만들려고 했지만, 해당 바로가기가 이미 이 서버에 등록되어 있어요."
#: ../alias.py:212 #: ../alias.py:212
msgid "You attempted to create a new alias with the name {} but that name is an invalid alias name. Alias names may not contain spaces." msgid "You attempted to create a new alias with the name {} but that name is an invalid alias name. Alias names may not contain spaces."
msgstr "" msgstr "이름이 {} 인 바로가기를 만들려고 했지만, 잘못된 바로가기 이름에요. 바로가기 이름에는 공백이 포함될 수 없어요."
#: ../alias.py:224 #: ../alias.py:224
msgid "A new alias with the trigger `{}` has been created." msgid "A new alias with the trigger `{}` has been created."
msgstr "`{}`로 발동되는 바로가기가 생성되었습니다." msgstr "트리거 `{}` 이(가) 포함된 별칭이 등록됐어요."
#: ../alias.py:236 #: ../alias.py:236
msgid "You attempted to create a new global alias with the name {} but that name is already a command on this bot." msgid "You attempted to create a new global alias with the name {} but that name is already a command on this bot."
msgstr "" msgstr "이름이 {} 인 글로벌 별칭을 만들려고 했지만, 이 봇의 커맨드와 중복돼요."
#: ../alias.py:243 #: ../alias.py:243
msgid "You attempted to create a new global alias with the name {} but that alias already exists on this server." msgid "You attempted to create a new global alias with the name {} but that alias already exists on this server."
msgstr "" msgstr "이름이 {} 인 글로벌 별칭을 만들려고 했지만, 해당 별칭이 이미 이 서버에 등록되어 있어요."
#: ../alias.py:250 #: ../alias.py:250
msgid "You attempted to create a new global alias with the name {} but that name is an invalid alias name. Alias names may not contain spaces." msgid "You attempted to create a new global alias with the name {} but that name is an invalid alias name. Alias names may not contain spaces."
msgstr "" msgstr "이름이 {} 인 글로벌 별칭을 만들려고 했지만, 잘못된 별칭 이름에요. 별칭 이름에는 공백이 포함될 수 없어요."
#: ../alias.py:259 #: ../alias.py:259
msgid "A new global alias with the trigger `{}` has been created." msgid "A new global alias with the trigger `{}` has been created."
msgstr "`{}`로 발동되는 전역 바로가기가 생성 되었습니다." msgstr "트리거 `{}` 이(가) 포함된 글로벌 별칭이 등록됐어요."
#: ../alias.py:274 #: ../alias.py:274
msgid "No such alias exists." msgid "No such alias exists."
msgstr "해당 바로가기가 없습니다." msgstr "그런 별칭은 등록되어 있지 않아요."
#: ../alias.py:283 #: ../alias.py:283
msgid "The `{}` alias will execute the command `{}`" msgid "The `{}` alias will execute the command `{}`"
msgstr "바로가기 `{}`는 명령어 `{}` 를 실행 합니다." msgstr "`{}` 별칭이 `{}` 커맨드를 실행했어요."
#: ../alias.py:286 #: ../alias.py:286
msgid "There is no alias with the name `{}`" msgid "There is no alias with the name `{}`"
msgstr "`{}`로 지정된 바로가기가 없습니다." msgstr "`{}` 이란 이름으로 등록된 별칭이 없어요."
#: ../alias.py:298 #: ../alias.py:298
msgid "There are no aliases on this guild." msgid "There are no aliases on this guild."
msgstr "이 길드에는 바로가기가 없습니다." msgstr "이 길드에 등록된 별칭이 없어요."
#: ../alias.py:302 ../alias.py:320 #: ../alias.py:302 ../alias.py:320
msgid "Alias with the name `{}` was successfully deleted." msgid "Alias with the name `{}` was successfully deleted."
msgstr "바로가기 `{}` 성공적으로 삭제 되었습니다." msgstr "별칭 `{}` 이(가) 성공적으로 삭제됐어요."
#: ../alias.py:305 ../alias.py:323 #: ../alias.py:305 ../alias.py:323
msgid "Alias with name `{}` was not found." msgid "Alias with name `{}` was not found."
msgstr "바로가기 `{}` 가 발견되지 않았습니다." msgstr "`{}` 바로가기가 등록되어 있지 않아요."
#: ../alias.py:316 #: ../alias.py:316
msgid "There are no aliases on this bot." msgid "There are no aliases on this bot."
msgstr "이 봇에는 바로가기가 없습니다." msgstr "이 봇에 등록된 별칭이 없어요."
#: ../alias.py:331 ../alias.py:342 #: ../alias.py:331 ../alias.py:342
msgid "Aliases:" msgid "Aliases:"
msgstr "바로가기 리스트:" msgstr "등록된 별칭 리스트 :"
#: ../alias.py:333 ../alias.py:344 #: ../alias.py:333 ../alias.py:344
msgid "There are no aliases on this server." msgid "There are no aliases on this server."
msgstr "이 서버에 별칭이 없습니다." msgstr "이 서버에 등록된 별칭이 없어요."

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:34-0500\n" "PO-Revision-Date: 2018-04-15 16:43-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: LOLCAT\n" "Language-Team: LOLCAT\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:33-0500\n" "PO-Revision-Date: 2018-04-15 16:42-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Dutch\n" "Language-Team: Dutch\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:33-0500\n" "PO-Revision-Date: 2018-04-15 16:42-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Norwegian\n" "Language-Team: Norwegian\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:33-0500\n" "PO-Revision-Date: 2018-04-15 16:43-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Polish\n" "Language-Team: Polish\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:34-0500\n" "PO-Revision-Date: 2018-04-15 16:43-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Portuguese, Brazilian\n" "Language-Team: Portuguese, Brazilian\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:33-0500\n" "PO-Revision-Date: 2018-04-15 16:43-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Portuguese\n" "Language-Team: Portuguese\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

View File

@@ -1,15 +1,11 @@
import subprocess import subprocess
TO_TRANSLATE = [ TO_TRANSLATE = ["../alias.py"]
'../alias.py'
]
def regen_messages(): def regen_messages():
subprocess.run( subprocess.run(["pygettext", "-n"] + TO_TRANSLATE)
['pygettext', '-n'] + TO_TRANSLATE
)
if __name__ == "__main__": if __name__ == "__main__":
regen_messages() regen_messages()

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:33-0500\n" "PO-Revision-Date: 2018-04-15 16:43-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Russian\n" "Language-Team: Russian\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@@ -22,15 +22,15 @@ msgstr "Префикс не найден."
#: ../alias.py:198 #: ../alias.py:198
msgid "You attempted to create a new alias with the name {} but that name is already a command on this bot." msgid "You attempted to create a new alias with the name {} but that name is already a command on this bot."
msgstr "" msgstr "Вы пытались создать новый псевдоним с именем {}, но это имя используется как команда в этом боте."
#: ../alias.py:205 #: ../alias.py:205
msgid "You attempted to create a new alias with the name {} but that alias already exists on this server." msgid "You attempted to create a new alias with the name {} but that alias already exists on this server."
msgstr "" msgstr "Вы пытались создать новый псевдоним с именем {}, но это имя используется как команда на этом сервере."
#: ../alias.py:212 #: ../alias.py:212
msgid "You attempted to create a new alias with the name {} but that name is an invalid alias name. Alias names may not contain spaces." msgid "You attempted to create a new alias with the name {} but that name is an invalid alias name. Alias names may not contain spaces."
msgstr "" msgstr "Вы пытались создать новый псевдоним с именем {}, но это имя является недопустимым псевдонимом. Имена псевдонимов не могут содержать пробелы."
#: ../alias.py:224 #: ../alias.py:224
msgid "A new alias with the trigger `{}` has been created." msgid "A new alias with the trigger `{}` has been created."
@@ -38,15 +38,15 @@ msgstr "Был создан новый псевдоним с триггером
#: ../alias.py:236 #: ../alias.py:236
msgid "You attempted to create a new global alias with the name {} but that name is already a command on this bot." msgid "You attempted to create a new global alias with the name {} but that name is already a command on this bot."
msgstr "" msgstr "Вы пытались создать новый глобальный псевдоним с именем {}, но это имя уже используется как команда в этом боте."
#: ../alias.py:243 #: ../alias.py:243
msgid "You attempted to create a new global alias with the name {} but that alias already exists on this server." msgid "You attempted to create a new global alias with the name {} but that alias already exists on this server."
msgstr "" msgstr "Вы пытались создать новый глобальный псевдоним с именем {}, но это имя уже существует на этом сервере."
#: ../alias.py:250 #: ../alias.py:250
msgid "You attempted to create a new global alias with the name {} but that name is an invalid alias name. Alias names may not contain spaces." msgid "You attempted to create a new global alias with the name {} but that name is an invalid alias name. Alias names may not contain spaces."
msgstr "" msgstr "Вы пытались создать новый псевдоним с именем {], но это имя явлется недопустимым именем для псевдонима. Псевдонимы не могут содержать пробелы."
#: ../alias.py:259 #: ../alias.py:259
msgid "A new global alias with the trigger `{}` has been created." msgid "A new global alias with the trigger `{}` has been created."
@@ -86,5 +86,5 @@ msgstr "Алиасы:"
#: ../alias.py:333 ../alias.py:344 #: ../alias.py:333 ../alias.py:344
msgid "There are no aliases on this server." msgid "There are no aliases on this server."
msgstr "На этом сервере еще нет алиасов." msgstr "На этом сервере нет псевдонимов."

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: red-discordbot\n" "Project-Id-Version: red-discordbot\n"
"POT-Creation-Date: 2018-02-18 14:42+AKST\n" "POT-Creation-Date: 2018-02-18 14:42+AKST\n"
"PO-Revision-Date: 2018-02-25 21:34-0500\n" "PO-Revision-Date: 2018-04-15 16:43-0400\n"
"Last-Translator: Kowlin <boxedpp@gmail.com>\n" "Last-Translator: Kowlin <boxedpp@gmail.com>\n"
"Language-Team: Swedish\n" "Language-Team: Swedish\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"

Some files were not shown because too many files have changed in this diff Show More