260 Commits

Author SHA1 Message Date
GhOsT
c57ef4828e
[Core] add ctx.tick() to [p]invite (#5199) 2021-08-31 23:27:11 +02:00
Kowlin
3b7f9e24b4
Refined debuginfo (#5156)
* Oh my gosh Kowlin is finishing work!?

* fix style

* use f-strings

* moar f-strings actually

* Fix style...

* I did a poor job of find-replacing things

* Improve code readability per previous Kowlin's style

* And reformat it in such a way that get jack through the day

* Okay maybe some whitespace

* Update core_commands.py

* Update core_commands.py

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
2021-06-27 03:54:27 +02:00
El Laggron
dafffd969f
[Core] Limit server prefix length (#5117)
* Restrict prefix length

* Update docs
2021-06-12 17:41:29 +02:00
El Laggron
0ce2634bb3
[Core] Add toggle for the applications.commands invite scope (#5114)
* Add toggle for applications.commands invite scope

* Add support for i18n

* Fix formatting

Co-authored-by: Kowlin <boxedpp@gmail.com>
2021-06-03 17:36:28 +02:00
Lifeismana
2d8dbad63b
Docstring Fix (#5080)
* Missing word

* Make a little more sense
2021-05-25 17:58:10 +02:00
jack1142
2f7376169e
Stop reloading unrelated modules (#4958) 2021-05-24 11:17:45 +01:00
Kreusada
439033ea28
[Core] Improve regionalformat docstrings (#5055)
* [Docs] Update regionalformat docs

* [Core] Improve regionalformat docstrings
2021-05-19 14:47:29 +00:00
Kreusada
3ff2132570
[Core] Update [p]autoimmune remove docstring
* Merge pull request #5038

* update docstring

* update docs correspondingly
2021-05-19 15:10:31 +01:00
bobloy
75ce67837a
embedset - fix perm check for subcommands, add missing return (#4962) 2021-05-19 12:19:28 +02:00
Fabian H
cb45ef6c42
Fixed grammatical mistakes in core_commands.py (#4966)
This fixes some issues from the recent commit 'Core Cog Guide'
2021-05-18 17:17:44 -04:00
bobloy
0eaa0f494c
[Docs] Core Cog Guide (#4597)
* Core guide initial commit

* Mydata docstrings

* Regenerated docs

* Lots more docstrings

* Add document link

* Up to load docstrings

* Black formatting

* docstring semantics

* "cog packages" for loads

* Refix line lengths

* Regenerate docs

* Remove link

* Regenerate docs with new code

* Some small docstrings

* Regenerate docs with new .. warning code

* More docstrings into the `set` command

* Bullet lists need blank lines.

* Regenerate docs

* Regenerate docs (fix bullet lists)

* set activity statuses docstrings

* Docstrings up to helpset pagecharlimit

* Regenerate docs

* Core guide initial commit

* Mydata docstrings

* Regenerated docs

* Lots more docstrings

* Add document link

* Up to load docstrings

* Black formatting

* docstring semantics

* "cog packages" for loads

* Refix line lengths

* Regenerate docs

* Remove link

* Regenerate docs with new code

* Some small docstrings

* Regenerate docs with new .. warning code

* More docstrings into the `set` command

* Bullet lists need blank lines.

* Regenerate docs

* Regenerate docs (fix bullet lists)

* set activity statuses docstrings

* Docstrings up to helpset pagecharlimit

* Regenerate docs

* Maxpages and delete delay docstrings

* spagetthi ctrl+v

* tagline and contact

* A little more contact

* Up to allowlist

* Up to command defaultdisablecog

* Regenerate docs

* Redo custominfo to not be terrible

* Up to default enabled cog

* More docs

* Up to command disabledmsg

* Disabled message stuff was missed

* Finish the rest of the docstrings

* Regenerate docs

* Longer description of the cog

* Regenerate Docs

* Fix some of the suggestions

* Apply additional suggests and some small rewording.

* Regenerate docs.

* Apply suggestions and make additional fixes

* Regenerate docs

* Clarifies it's only loaded.

* Regenerate docs.

* New formatting, more examples, some fixes

* Regenerate docs

* Adds consistant use of dashes to arguments

* More consistant punctuation

* Regenerate docs

* Add labeler detection

* Fix example and use clearing language for helpset verifyexists docstring

* Regenerate docs

* Add leave example and arguments

* Regenerate docs

* Regenerate docs

* Make embedset more readable

(933aefd3ee9371b3b669cbdd2ac05f6b5532e4bb was the sphinx compatible update)

* Regenerate docs

* Black formatting

* Regenerate docs

* Adds docstring examples and arguments for multiple `embedset` subcommands

* Regenerate docs
2021-04-07 13:01:34 -04:00
Twentysix
c25095ba2d
[Core] Use menus for [p]servers, improve [p]leave (#4831)
* [Core] Use menus for [p]servers, improve [p]leave

* Apply suggestions from code review

Co-authored-by: Samuel <50765275+npc203@users.noreply.github.com>

* Few more changes

* Add empty line...

* style

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
Co-authored-by: Samuel <50765275+npc203@users.noreply.github.com>
2021-04-05 19:37:23 +00:00
jack1142
adda30cbee
Bump discord.py to 1.7.0 (#4928)
* Bump discord.py, but to the git version for now

* Import GuildConverter from d.py and deprecate our implementation

* Import PartialMessageConverter in our commands extension

* Use newly added `Cog.has_error_handler()` rather than private method

* Update snowflake regex to use 20 as max length

See Rapptz/discord.py#6501

* Use new supported way for custom cooldown buckets

* Include group args in command signature

* Update code to use `Client.close()` over `Client.logout()`

* Add StageChannelConverter and StoreChannelConverter

* Fix AttributeError in licenseinfo
2021-04-05 21:33:19 +02:00
jack1142
560e1dfc3d
Add per-command embed settings (embed_requested) (#4049)
* Add per-command embed settings

* Update `[p]embedset showsettings`

* Use command.qualified_name in `[p]embedset` commands

* Fix the call to subcommand and simplify it

* And I oversimplified this

* Update end user messages to use 'guild' rather than 'server'

* meh

* This should be a named field

* Add check for Embed Links perm to confuse users a bit less

* Wrap this string in _()

* Let's use a different exception then...

* Let's clear the setting when we can in whole `[p]embedset`

* Add the order of checking to help of `[p]embedset`

* Add note about full evaluation order to subcommands
2021-04-04 13:37:46 -06:00
Kreusada
76bb65912e
[Core] Improve responses to [p]set (server)prefix commands (#4898) 2021-04-03 03:10:53 +02:00
Kreusada
49da854eb7
Add user/role names to [p](local)allow/blocklist list (#4839)
* start

* Get user inside blocklist/allowlist lists

* Changes to cover unknown or deleted users

* Use square brackets for clarity

* Implement the above commit for all four versions

* Much improved UI, removed `[]` to fit new format

* updates to support roles in local version

* add /role to unknown str

* Improve variable names

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
2021-04-03 01:28:06 +02:00
Kowlin
df5926b51a
[Core] Clarify that the owner is a team in [p]info (#4851)
* Clarify that the owner is a team.

* This should do.

* Style check... for a comma, in your dreams Tox...

* Annndddd for the insane people who don't use embeds
2021-02-26 18:48:22 +01:00
bobloy
e24379973c
Add guild_only check to [p]command listdisabled guild (#4772) 2021-01-29 21:27:01 +01:00
Predeactor
2bffbd9001
[Core] Fix commands using plural with the same user (#4750)
* [Core] Fix commands using plural with the same user

Some plural checking have also been added to the local blocklist/allowlist and the wording has been revised.

* AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

* BLAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACK

* the

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
2021-01-29 19:03:24 +00:00
jack1142
991cd46ea3
Add non-generic message when loading a cog with command name that is already registered (#3870)
* Add non-generic message when loading a cog with command name that is already registered

* Use regex instead and add i18n support

* This requires d.py 1.4
2021-01-23 13:49:03 -07:00
Fabian H
e23d21ec08
Fixed grammatical mistake in allowlist_add. (#4748)
Changed:

            await ctx.send(_("Users has been added to the allowlist."))

to:

            await ctx.send(_("Users have been added to the allowlist."))
2021-01-22 18:25:46 +01:00
Predeactor
7630e24822
[Core] Add plural forms in allowlist and blocklist commands (#4705)
* Plurial for blocklist/allowlist

* duh

* Apply suggestions from code review

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
2021-01-22 02:56:07 +00:00
bobloy
676f34185d
[Core] Add sensible character lengths to activity statuses (#4663)
* Add sensible character lengths

* Add translation function

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
2021-01-21 13:41:28 +00:00
PredaaA
dcf7368e54
Show command aliases in help with setting to disable (#3040)
* Update help.py

* Create 3040.enhance.rst

* remove towncrier entry

* Make it i18n friendly.

* That was uneeded to change this actually.

* ...

* ..

* .

* Add a setting for aliases.

* DOTS

* Update redbot/core/core_commands.py

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>

* Address requested changes maybe

* New format + changes requested.

* okay we'll get there someday

* honk

* aaaaaaaaaaaaaaa

* Black

* Fix missing humanize_timedelta import.

* style

* Two things from my very old pending review, see commit desc

```py
            valid_alias_list = [
                af
                for a in aliases
                if (af := f"{a}")
                and len(af) < 500
                and ((a_counter + len(af)) < 500)
                and (a_counter := a_counter + len(af))
            ]
```
^ This can be simplified:
```suggestion
            valid_alias_list = [
                alias
                for alias in aliases
                if (a_counter := a_counter + len(alias)) < 500
            ]
```
Although I think it would be somewhat clearer to use a `for` loop rather than a list comprehension (+ we can just `break` when there's not gonna be another alias that could fit in the list since it's sorted):
```suggestion
            valid_alias_list = []

            for alias in aliases:
                if (a_counter := a_counter + len(alias)) < 500:
                    valid_alias_list.append(alias)
                else:
                    break
```

* style *again*

* use qualified name of the parent command

* meh

* another meh

* Revert the last commit...

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
Co-authored-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
2021-01-20 23:40:27 +01:00
jack1142
b36a702e62
Make command usage in help for required arguments consistent (#4589)
* Make command usage in help for required arguments consistent

* Bob 3

* Bob 1

* Docstring updates

* Address Flame's review

* Update cog guides in docs
2020-12-22 14:14:47 -05:00
bobloy
59e1e31634
Fix inviteset public link (#4641) 2020-12-19 21:06:38 +01:00
MAX
e87896815c
[Core] Add [p]set competing command (#4609)
* Update core_commands.py

* style

* Update core_commands.py

* Update core_commands.py

* does this fix tho?

* C
2020-11-16 15:18:44 +01:00
Kowlin
2413c6abd3
[Core] Guild scoped I18n (#3896)
* Guild I18n

Never again!

* Finish off guild scoped i18n

* Black formatting

* Added guild only flags.

* Fix missing import.

* Added listing of guild i18n settings

* Added API support

* Added API support... properly!

* Added API support... for realsies!

* Auto-translate create_cases instances

You're welcome cog creators! Jack talked me into this!

* Fix get_regional_format to actually return properly

* Cleanup `set showsettings`

* Style pass

* Update redbot/core/core_commands.py

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>

* Update redbot/core/events.py

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>

* Update redbot/core/core_commands.py

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>

* Fix missing import

* Improve caching

* Removal of unneeded function

* Fix some naming

* IDFK anymore...

* Reformat

* Update redbot/core/settings_caches.py

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>

* Update redbot/core/settings_caches.py

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>

* Update redbot/core/settings_caches.py

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>

* Remove line number

* Fix global sets

* Set contextual locale manually where needed

* Reports cog is wonderful...

* Update redbot/core/core_commands.py

Co-authored-by: Draper <27962761+Drapersniper@users.noreply.github.com>

* Set contextual locale manually where needed in Mutes cog

* s

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
Co-authored-by: Draper <27962761+Drapersniper@users.noreply.github.com>
2020-10-26 17:59:11 +01:00
jack1142
c1ab10e202
another reorder 2020-10-23 19:14:08 +02:00
jack1142
1d23c1f2bc
cast to str 2020-10-23 19:11:57 +02:00
jack1142
ef1582832d
More things 2020-10-23 19:09:08 +02:00
jack1142
95e342f4f4
Add data path to [p]debuginfo, add missing info in non-embed version 2020-10-23 18:28:44 +02:00
jack1142
e1226c6c88
Update to d.py 1.5.1, explicitly request privileged intents (#4423)
Co-authored-by: Draper <27962761+Drapersniper@users.noreply.github.com>
2020-10-21 19:55:25 +01:00
Flame442
694d379aef
[Core] Add default embed colour to [p]set showsettings (#4498)
* Add default color to [p]set showsettings

* I didn't want to since I thought it would be too long, but sure

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
2020-10-18 21:11:38 +02:00
palmtree5
ec90199950
Add a setting for adding a tick reaction when help is DMed (#4467)
* Tick response for help command

* Make this a setting instead

Co-authored-by: palmtree5 <palmtree5+3577255@users.noreply.github.com>
2020-10-18 16:10:00 +02:00
Stonedestroyer
08bd0567ad
Grammar fixes (#4500)
* Grammar fixes

* More changes

* Grammar

* Error grammar

* Spelling

* Grammar

* REsolves grammar

* grammar

* grammar

* grammar

* grammar

* grammar

* grammar

* grammar

* grammar

* "commited" > "committed"

* apostrophe

* more grammar

* grammar

* `funtion` to `function`

* grammar in alias cog

* grammar in cleanup cog

* grammar in customcom cog

* grammar in mod cog

* grammar in reports cog

* fix grammar in streams cog

* missing apostrophe

* grammar fix in trivia cog

Co-authored-by: Jyu Viole Grace <24418520+thisisjvgrace@users.noreply.github.com>
Co-authored-by: Jyu Viole Grace <thisisjvgrace@users.noreply.github.com>
2020-10-18 08:52:56 +01:00
maxbooiii
33cf275862
[Core] added some missing dots. (#4493)
* core added missing dots

* lower-case
2020-10-18 08:45:32 +01:00
Kowlin
9ae733181b
Handle verified bots, improve errors in [p]set username (#4463)
* handle verified bots, and more specific errors

* stuff

* fuck, I forgot

* Improve errors by splitting into few different messages

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
2020-10-17 02:45:52 +02:00
Vexed
c441857a4c
[Core] Add two missing full stops to licenseinfo (#4020)
* full stops

* hereafter -> hereinafter

* Add the other stop that was here...

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
2020-10-14 22:25:08 +02:00
aikaterna
ec94327b15
[Core] Pagify cog unload output properly (#4469)
* [Core] Pagify cog unload output properly

When you unload a large amount of cogs (close to message limit on characters), the character count is easily pushed over 2k characters on the command response with the cog names each being wrapped in 2x backticks. The current implementation breaks in the middle of cog names or wherever else it feels like it. 1600 might have been a safe value for splitting but at 1500 I don't see how multiple short cog names could make it break at least.

* Address review
2020-10-11 17:43:12 +02:00
aikaterna
5c00810166
Use bot name instead of "Red" in [p]info and [p]restart (#4470) 2020-10-11 17:21:54 +02:00
PredaaA
804219df29
Use bot.get_user() instead of get_all_members() in [p]dm (#4472) 2020-10-11 17:19:49 +02:00
Vuks
b45e62f354
[Core] add [p]set api list and [p]set api remove (#4370)
* add get_shared_api_keys

* add set listapi command

* fix typo

* refactor `[p]set listapi` into `[p]set api list`

* remove unnecessary check

* fix decorators

* corrected wording

* add remove_shared_api_services

* add `set api remove`

* further typo sniping

* bugsniping

* minor typo

* aaaaaaaaa

* Apply suggestions from code review

Co-authored-by: Draper <27962761+Drapersniper@users.noreply.github.com>

* update api docstring to reflect new subcommands

* Apply suggestions from code review

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>

* update framework_apikeys.rst with new methods

* Update redbot/core/bot.py

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>

* rewrite get_shared_api_services into a special case of
get_shared_api_tokens

* rewrite api_list to include keys and tokens in response

* don't show secrets

* better api_remove response

* black

* remove nonexistent method

* remove unnecessary import

* fix wording

* Improve docstrings and type hints

- added overloads to help out developers a bit more
  * this wasn't necessary, but development tools work better
    with this information
- fixed type hint to use Union as now
  its return type depends on whether `service_name` is passed
- updated docstrings to contain information about the added behavior

* Use `humanize_list()` rather than `str.join()`

This is done for consistency within Red
and it makes the list have the last element joined
with `and` (or its equivalent in chosen locale)

* Use `.format()` after translation is applied

If `.format()` is used before `_()`, the search for translation is done
with the string that already has the dynamic text added,
which results in no matches.

* Add plural support

* Improve error message

Updated message to be more specific
(used phrases: "None of the services" and "had any keys set")
and a bit more nice to the user (judging word "anyway" removed)

* Improve readability of `[p]set api list`

It's a lot clearer when the sublists are indented,
especially on mobile where code blocks aren't colored at all.

New look:
https://user-images.githubusercontent.com/6032823/94614944-3bbd7c80-02a7-11eb-89e4-64bdf06c650b.png

Co-authored-by: Draper <27962761+Drapersniper@users.noreply.github.com>
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
2020-10-05 22:10:14 +02:00
Fixator10
d6791111f3
fix [p]set nickname when no nickname specified (#4451) 2020-09-28 13:14:49 +02:00
Flame442
47d9069108
[Core] Catch errors about blocked DMs in [p]traceback (#4329) 2020-09-20 19:42:28 +02:00
PredaaA
343efba4d5
Handle aiohttp errors in [p]set avatar (#4437)
* [Core comands] Handle aiohttp errors in set avatar

* Update redbot/core/core_commands.py

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
2020-09-19 19:51:38 +02:00
PythonTryHard
e1261b92d1
Typo fix on [p]invite command (#4382) 2020-08-31 14:21:15 +01:00
jack1142
85afe19455
Bump black to 20.8b1 (and reformat) (#4371)
* Bump black version

* Reformat with black
2020-08-29 19:12:28 +02:00
Theo Suricate
ef839722f4
Added length validation for [p]set name and [p]set nickname (#4364) 2020-08-24 14:59:09 +01:00
maxbooiii
5cd3a5b5af
missing dots (#4031) 2020-08-23 03:13:09 +02:00