Skip to content

Commit

Permalink
Merge branch 'v3' into warnsystem/1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
laggron42 committed Aug 2, 2019
2 parents 1534c15 + b3ed3e1 commit b97486b
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 24 deletions.
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

patreon: retke
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
"python": ("https://docs.python.org/3.6", None),
"discord": ("https://discordpy.readthedocs.io/en/rewrite/", None),
"discord": ("https://discordpy.readthedocs.io/en/latest/", None),
"redbot": ("https://red-discordbot.readthedocs.io/en/v3-develop/", None),
}

Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
sphinxcontrib-asyncio
sphinx_autodoc_napoleon_typehints
sphinx_rtd_theme
Red-DiscordBot
Red-DiscordBot
5 changes: 2 additions & 3 deletions docs/roleinvite-api.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.. automodule:: roleinvite.roleinvite

.. role:: python(code)
:language: python
Expand All @@ -11,12 +10,12 @@ RoleInvite
API Reference
-------------

.. autoclass:: API
.. autoclass:: roleinvite.api.API
:members:

------
Errors
------

.. autoclass:: Errors
.. automodule:: roleinvite.errors
:members:
16 changes: 8 additions & 8 deletions docs/roleinvite.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ inviteset

**Syntax**::

[p]inviteset
[p]roleinviteset

**Description**

Expand All @@ -82,7 +82,7 @@ inviteset add

**Syntax**::

[p]inviteset add <invite|main|default> <role>
[p]roleinviteset add <invite|main|default> <role>

**Description**

Expand Down Expand Up @@ -120,7 +120,7 @@ inviteset remove

**Syntax**::

[p]inviteset remove <invite|main|default> [role]
[p]roleinviteset remove <invite|main|default> [role]

**Description**

Expand Down Expand Up @@ -152,7 +152,7 @@ inviteset list

.. code-block:: none
[p]inviteset list
[p]roleinviteset list
**Description**

Expand All @@ -168,7 +168,7 @@ inviteset enable

.. code-block:: none
[p]inviteset enable
[p]roleinviteset enable
**Description**

Expand Down Expand Up @@ -196,15 +196,15 @@ Can I make it so the bot adds x roles if the invite used is unknown?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Yes, by using the ``main`` value instead of using a discord invite
when creating a new invite link. See :ref:`inviteset add <command-inviteset-add>` command's
when creating a new invite link. See :ref:`roleinviteset add <command-inviteset-add>` command's
arguments for more informations.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Can I make it so the bot always adds x roles, regardless of the invite used?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Yes, by using the ``default`` value instead of using a discord invite
when creating a new invite link. See :ref:`inviteset add <command-inviteset-add>` command's
when creating a new invite link. See :ref:`roleinviteset add <command-inviteset-add>` command's
arguments for more informations.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -243,4 +243,4 @@ An invite link was removed without any action
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Invite links will be deleted if the invite doesn't exist anymore
(manual delete or invite expired).
(manual delete or invite expired).
2 changes: 1 addition & 1 deletion roleinvite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The cog is built with an API, allowing you to use RoleInvite without a context o
[p]load roleinvite
```

RoleInvite is now installed! You can create a link with the command `[p]inviteset`.
RoleInvite is now installed! You can create a link with the command `[p]roleinviteset`.

## Discord server

Expand Down
14 changes: 7 additions & 7 deletions roleinvite/roleinvite.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ async def _check(self, ctx: commands.Context):
return False
return pred.result

@commands.group()
@commands.group(name="roleinviteset")
@checks.admin()
async def inviteset(self, ctx):
"""
Expand All @@ -132,7 +132,7 @@ async def add(self, ctx, invite: str, *, role: discord.Role):
"""
Link a role to an invite for the autorole system.
Example: `[p]inviteset add https://discord.gg/laggron Member`
Example: `[p]roleinviteset add https://discord.gg/laggron Member`
If this message still shows after using the command, you probably gave a wrong role name.
If you want to link roles to the main autorole system (user joined with an unknown invite),\
give `main` instead of a discord invite.
Expand Down Expand Up @@ -169,7 +169,7 @@ async def roles_iteration(invite: str):
"**Warning**: This invite is already registered and currently linked to "
"the role(s) `{}`.\nIf you continue, this invite will give all roles "
"given to the new member. \nIf you want to edit it, first delete the link "
"using `{}inviteset remove`.\n\nDo you want to link this invite to {} "
"using `{}roleinviteset remove`.\n\nDo you want to link this invite to {} "
"roles? (yes/no)"
).format("`, `".join(current_roles), ctx.prefix, len(current_roles) + 1)
)
Expand Down Expand Up @@ -286,7 +286,7 @@ async def remove(self, ctx, invite: str, *, role: discord.Role = None):
if len(bot_invite["roles"]) > 1:
message += _(
"Remember that you can remove a single role from this list by typing "
"`{}inviteset remove {} [role name]`"
"`{}roleinviteset remove {} [role name]`"
).format(ctx.prefix, invite)

await ctx.send(message)
Expand Down Expand Up @@ -373,14 +373,14 @@ async def list(self, ctx):
await ctx.send(
_(
"There is nothing set on RoleInvite. "
"Type `{}help inviteset` for more informations."
"Type `{}help roleinviteset` for more informations."
).format(ctx.prefix)
)
return
if not await self.data.guild(ctx.guild).enabled():
text += _(
"**Info:** RoleInvite is currently disabled and won't give roles on member "
"join.\nType `{}inviteset enable` to enable it."
"join.\nType `{}roleinviteset enable` to enable it."
).format(ctx.prefix)

text = (
Expand Down Expand Up @@ -412,7 +412,7 @@ async def enable(self, ctx):
await ctx.send(
_(
"The autorole system is now enabled on this server.\n"
"Type `{0.prefix}inviteset list` to see what's the current role list.\n"
"Type `{0.prefix}roleinviteset list` to see what's the current role list.\n"
"If the bot lose the `Manage roles` or the `Manage server` permissions "
).format(ctx)
)
Expand Down
1 change: 1 addition & 0 deletions warnsystem/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from copy import deepcopy
from typing import Union, Optional, Iterable, Callable, Awaitable
from datetime import datetime, timedelta
from redbot.core.utils.mod import is_allowed_by_hierarchy

try:
from redbot.core.modlog import get_modlog_channel as get_red_modlog_channel
Expand Down
6 changes: 3 additions & 3 deletions warnsystem/warnsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def __init__(self, bot):
self.task = bot.loop.create_task(self.api._loop_task())
self._init_logger()

__version__ = "1.0.6"
__version__ = "1.0.7"
__author__ = ["retke (El Laggron)"]
__info__ = {
"bot_version": [3, 1, 2],
Expand Down Expand Up @@ -823,12 +823,12 @@ async def warnset_substitutions_list(self, ctx: commands.Context):
text = ""
for substitution, content in substitutions.items():
text += f"+ {substitution}\n{content}\n\n"
messages = [x for x in pagify(text, page_length=1900)]
messages = [x for x in pagify(text, page_length=1800)]
total_pages = len(messages)
for i, page in enumerate(messages):
await ctx.send(
_("Substitutions for {server}:").format(server=guild.name)
+ f"\n```diff\n{text}\n```"
+ f"\n```diff\n{page}\n```"
+ _("Page {page}/{max}").format(page=i + 1, max=total_pages)
)

Expand Down

0 comments on commit b97486b

Please sign in to comment.