133 Commits

Author SHA1 Message Date
Michael H
ee3be8b633 Extra info (#3008)
* Extra info

* changelog
2019-09-20 16:55:46 +02:00
Flame442
0be3b1acd7 Fixes the strings of [p]set usebotcolor (#2974)
* Fixes the help text of `[p]set usebotcolor`

* Create 2974.bugfix.rst
2019-09-02 09:43:56 -04:00
Michael H
6075c5bde0
Rename bot.db as bot._config (#2967)
* Rename `bot.db` as `bot._config`

  - Continues work towards strong version guarantees
  - Added methods for cog use for a few things which were previously
  only accessible via direct access.
  - Retained private use in a few internal use locations, though most
  methods were updated away from this.
  - Updated documentation for shared api token users

* changelog

* more detail

* docstring fixes

* Apparently, I forgot to commit something I had locally

  - + a copy/paste failue in the changelog

* *sigh*:

* *sigh*
2019-09-01 15:42:28 -04:00
Flame442
efcf91e934 Catch discord.errors.Forbidden when DMing a user the invite message (#2948)
* Catch discord.errors.Forbidden when DMing a user the invite message

Uses the same error message as `[p]help`

* Create 2948.bugfix.rst

* You saw nothing
2019-08-29 21:19:19 -04:00
aikaterna
b8a7a66566 [Core] Inviteset public and perms help cleanup (#2963)
* [Core] Inviteset public and perms help cleanup

* Towncrier entry
2019-08-29 21:18:43 -04:00
Toby Harradine
d1a46acc9a PostgreSQL driver, tests against DB backends, and general drivers cleanup (#2723)
* PostgreSQL driver and general drivers cleanup

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

* Make tests pass

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

* Add black --target-version flag in make.bat

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

* Rewrite postgres driver

Most of the logic is now in PL/pgSQL.

This completely avoids the use of Python f-strings to format identifiers into queries. Although an SQL-injection attack would have been impossible anyway (only the owner would have ever had the ability to do that), using PostgreSQL's format() is more reliable for unusual identifiers. Performance-wise, I'm not sure whether this is an improvement, but I highly doubt that it's worse.

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

* Reformat

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

* Fix PostgresDriver.delete_all_data()

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

* Clean up PL/pgSQL code

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

* More PL/pgSQL cleanup

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

* PL/pgSQL function optimisations

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

* Ensure compatibility with PostgreSQL 10 and below

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

* More/better docstrings for PG functions

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

* Fix typo in docstring

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

* Return correct value on toggle()

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

* Use composite type for PG function parameters

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

* Fix JSON driver's Config.clear_all()

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

* Correct description for Mongo tox recipe

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

* Fix linting errors

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

* Update dep specification after merging bumpdeps

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

* Add towncrier entries

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

* Update from merge

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

* Mention [postgres] extra in install docs

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

* Support more connection options and use better defaults

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

* Actually pass PG env vars in tox

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

* Replace event trigger with manual DELETE queries

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2019-08-26 22:02:26 -04:00
Michael H
984a97d958
[Core Commands] remove set owner and set token (#2928)
* remove set-owner and set token

* whoops, wrong number on the changelog

* whoops, git didnt detect the rename cause I didnt add the file
2019-08-13 13:57:16 -04:00
jack1142
081bf663a4 test(core): ignore pylint's ImportErrors for distro package (#2830) 2019-07-01 21:54:56 -04:00
Michael H
098540b9e5
[Core] Fix user output on cog load/reload (#2767)
* [Core] Fix user output on cog load/reload

  - Properly fixes the load/reload exception handling
  - Fixes some i18n use here to not make assumptions about other
  languages pluralization rules.

* Fix some typos

* Address Flame's Feedback

* It's important to save before committing ...

* formatting

* Fix some formats...
2019-06-29 12:16:28 -04:00
Elizabeth Sherrock
10412c4f51 Fix broken link in set color docstring (#2803) 2019-06-30 01:35:47 +10:00
Toby Harradine
bff7e214ab Kill JsonIO and fix JSON driver caching issues (#2796)
* Kill JsonIO and fix JSON driver caching issues

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

* Ensure lock covers critical region in set()

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

* Make tests pass

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

* Use pickle over deepcopy in Config

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

* Fix temp instance creation

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

* Serialise value before doing anything in set()

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2019-06-27 14:49:45 -04:00
DiscordLiz
6bdc9606f6 [Core] Multiple mod admin roles (#2783)
* Adds Schema versioning
  - Adds Migration tool
  - Adds tool to migrate to allow multiple admin and mod roles
  - Supports Multiple mod and admin roles

* Ensures migration is run prior to cog load and connection to discord

* Updates to not rely on singular mod/admin role id

* Update requires logic for multiple mod/admin roles

* Add new commands for managing mod/admin roles

* Feedback

Update strings
Update docstrings
Add aliases

* Use snowflakelist

* paginate

* Change variable name

* Fix mistake

* handle settings view fix

* Fix name error

* I'm bad at Ux

* style fix
2019-06-23 23:36:00 -04:00
Neuro Assassin
9d008d587a [V3 Core] Add checks to [p]command (#2770)
* Add checks to [p]command

* Change to privilege level
2019-06-18 21:35:56 -04:00
El Laggron
61b5730c48 [V3 Core] More features for the bot invite URL (#1847)
* Add inviteset group command

* Fix errors

* Fix line break

* Remove user bot support

* Fix docstrings line breaks

* Remove embed specific formatting

* Remove invite redirect

* Add self argument to _can_get_invite_url

* Remove unused import

* fix errors related to classes + double help

* Removed self bot support
2019-06-03 11:46:13 -04:00
Michael H
16443c8cc0 [CI] Improve automated checks (#2702)
* same stuff, but with some more spurious error supression

* fix issue in permissions found in this

* fix a few more spurious errors

* fix another issue

* semi-spurious error fixes

* .

* formatting

* move this to properly log

* distutils import + virtualenv

* more fixes
2019-06-02 19:42:57 +02:00
DiscordLiz
1ccc441aab [Core] Make contact use configured destinations (#2743)
* Make contact use configured destinations
2019-05-31 05:32:26 -04:00
DiscordLiz
8ddc5aa63e [Core] Add commands to manage owner notification destinations. (#2745) 2019-05-31 05:13:36 -04:00
PredaaA
b4f4e080af [core_commands] Using humanize_timedelta for [p]uptime command (#2735)
* Update core_commands.py
2019-05-27 20:39:36 -04:00
Michael H
68590dfdb8 [Core] Improve API token converter (#2692)
* improve api converter

* make usage more clear
2019-05-25 23:58:14 +02:00
Stonedestroyer
cd745d35c2 [Core] Add debug info command (#2728)
Shows useful debug information for debugging.
2019-05-24 17:55:48 -04:00
Michael H
644aaf0c0e
[Help] Continuing work and bug-fixes (#2676)
* [Help] Add settings for various things

  - Fixes a small issue in a previously not-exposed logic path
  - Fixes an issue with denied commands help invocation
  - Adds some global usage settings

* remove outdated comment

* improve intent of strings

* added punctuation

* Add DM forbidden handling

* use a slightly different method for shortening embed width specifically
2019-05-18 06:54:02 -04:00
zephyrkul
7dd3ff7c8d [Core] Strip commas in user input for load, reload, unload (#2693)
rstrip commas, closes #2695
2019-05-16 23:54:17 -04:00
Flame442
7400008384 Adds [p]datapath to print the bot's data path (#2652)
* Add `[p]datapath` to print the bot's datapath

* Adds 2652
2019-05-14 01:05:52 -04:00
Flame442
d1c903f36f Fix grammar mistake by changing "to large" to "too large" (#2646) 2019-05-06 12:18:57 -04:00
James
52433d253f String format failure when set invoked without subcommand (#2638) 2019-05-02 15:44:33 -04:00
Neuro Assassin
c79b5e6179 [Core Commands] Add patch for invalid path with [p]backup (#2626)
* Add patch
2019-04-29 19:38:36 -04:00
PredaaA
e3db3c0341 [Core_commands] Fix some missing i18n strings (#2631)
* Update core_commands.py

* Update core_commands.py
2019-04-29 15:21:58 -04:00
Flame442
22c318fda3 [Core] Adds a check to [p]set locale (#2553)
* Adds a check to [p]set locale

Fixes #2552
I would like a little bit of feedback on this change.
- Right now, `locale_name` is case sensitive. Should that remain case sensitive or should I allow it to accept it case insensitively?
- I made the invalid locale string an i18n string, however I don't know the process for how those are supposed to be made or if that will break anything. Should that remain an i18n string or should I make it a normal string?

* Case insensitivity and explicit en-US

-`[p]set locale` is now case insensitive
-`en-US` added to `[p]listlocales` instead of only existing in `[p]set locale`'s help text

* Remove spacing
2019-04-23 17:43:50 -04:00
Michael H
466b2b82d0 Fix localwhitelist/localblacklist add/remove (#2531) 2019-04-02 22:46:12 -04:00
Flame442
d52b3eaf21 Proper capitalization of [p]blacklist help text (#2511) 2019-03-07 08:57:06 +11:00
TrustyJAID
3f1d416526 Allow central storage of API keys (#2389)
This creates a central location to store external API tokens that can be used between cogs without requiring each cog to be loaded for it to work.

A new set option for `[p]set api` is created to assist in forming bot readable API token locations.

This also updates the Streams cog to utilize the central database.

Tokens are moved from the old data locations in core cogs on load.
2019-02-19 10:22:44 +11:00
zephyrkul
820be2a0ae [Core] Utilize consume rest, Union (#2407) 2019-02-13 14:11:22 +11:00
Twentysix
889fa63aff Sentry removal (#2439)
Resolves #2430.
2019-02-11 11:19:02 +11:00
Twentysix
b350ac38dc Allow [p]info customization (#2417)
* Allow [p]info customization

* Style

* Naming
2019-02-08 02:38:26 +01:00
zephyrkul
f2ebf52f6e Send help on empty [p]load/unload/reload (#2410)
Rather than attempting to load / reload / unload nothing, send command help on bare `[p]load`, etc. commands.
2019-02-04 17:39:03 +11:00
PredaaA
6d22c8faa5 [Core cmds] [p]servers: handle message deletion (#2400) 2019-02-03 23:32:45 +01:00
bobloy
abcf179042 [CogManager] Fix return type-hint (#2319) 2019-01-19 11:47:58 +11:00
Toby Harradine
e07408161a Merge branch 'V3/release/3.0.0' into V3/develop
# Conflicts:
#	redbot/cogs/mod/mod.py
2019-01-11 16:42:42 +11:00
Toby Harradine
7973babe4b
Catch exceptions in [p]backup (#2363)
Resolves #2354.

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2019-01-11 09:07:37 +11:00
Toby Harradine
bdcb69ad37 Merge branch 'V3/release/3.0.0' into V3/develop
# Conflicts:
#	redbot/cogs/audio/audio.py
2018-12-21 13:37:32 +11:00
Twentysix
8abb24bc01 [Core] [p]leave: Fix incorrect response handling (#2302) 2018-11-24 10:42:05 +11:00
Kowlin
92dbd14006
Fixes typos in permissions (#2288)
causing the checks to be thrown out of the window.
2018-11-05 04:19:54 +01:00
Toby Harradine
5ed8be9998
Merge V3/release/3.0.0 into V3/develop 2018-10-12 08:59:14 +11:00
Michael H
4357fe1ba9 [Core] Fixes reload, and prompted reload on cog update (#2226)
Fix something missed when QAing #2207
2018-10-12 07:23:04 +11:00
El Laggron
a64db76b4d [Core] Specify an error message on package loading (#2207)
Allows cog creators to explain clearly why a cog cannot load by raising  `redbot.core.errors.CogLoadError`. Instead of having to check in the console what's wrong, the message will directly be sent in the context channel.
2018-10-11 11:57:11 +11:00
Toby Harradine
849755ecd2
[Core] Fix errors with [p]backup on MongoDB (#2210)
Resolves #2094.

This command needs some more fixing and cleaning up than this, this is just a simple bugfix which gets it mostly working for now.

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2018-10-09 15:30:27 +11:00
El Laggron
76bbcf2f8c [Core] Support already loaded packages in [p]load (#2116) 2018-10-08 08:18:28 +11:00
Toby Harradine
91029b73e5
Use our own redbot.core.VersionInfo over distutils.StrictVersion (#2188)
* Implements our required subset of PEP 440 in redbot.core.VersionInfo
* Added unit tests for version string parsing and comparisons

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2018-10-06 19:11:05 +10:00
Michael H
d79996aeea [Downloader] Better user facing feedback on cog update (#2165) 2018-10-06 08:24:55 +10:00
Toby Harradine
fb839084fe
Merge branch V3/feature/predicates into V3/develop (#1986)
Predicate utility to replace common boilerplate predicates for event waiting.
2018-10-06 08:15:25 +10:00