mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
[V3 Reports] Rewording Responses/Docstrings (#1860)
* [v3 Reports] Rewording Responses/Docstrings * Add the old name for [p]reportset toggle as alias Also made some lines a bit shorter * A few more * Fix typo * Clarity in [p]report docstring
This commit is contained in:
parent
1c2196f78f
commit
5c514fd663
@ -59,29 +59,29 @@ class Reports:
|
|||||||
@commands.group(name="reportset")
|
@commands.group(name="reportset")
|
||||||
async def reportset(self, ctx: commands.Context):
|
async def reportset(self, ctx: commands.Context):
|
||||||
"""
|
"""
|
||||||
settings for reports
|
Settings for the report system.
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@checks.admin_or_permissions(manage_guild=True)
|
@checks.admin_or_permissions(manage_guild=True)
|
||||||
@reportset.command(name="output")
|
@reportset.command(name="output")
|
||||||
async def setoutput(self, ctx: commands.Context, channel: discord.TextChannel):
|
async def setoutput(self, ctx: commands.Context, channel: discord.TextChannel):
|
||||||
"""sets the output channel"""
|
"""Set the channel where reports will show up"""
|
||||||
await self.config.guild(ctx.guild).output_channel.set(channel.id)
|
await self.config.guild(ctx.guild).output_channel.set(channel.id)
|
||||||
await ctx.send(_("Report Channel Set."))
|
await ctx.send(_("The report channel has been set."))
|
||||||
|
|
||||||
@checks.admin_or_permissions(manage_guild=True)
|
@checks.admin_or_permissions(manage_guild=True)
|
||||||
@reportset.command(name="toggleactive")
|
@reportset.command(name="toggle", aliases=["toggleactive"])
|
||||||
async def report_toggle(self, ctx: commands.Context):
|
async def report_toggle(self, ctx: commands.Context):
|
||||||
"""Toggles whether the Reporting tool is enabled or not"""
|
"""Enables or Disables reporting for the server"""
|
||||||
|
|
||||||
active = await self.config.guild(ctx.guild).active()
|
active = await self.config.guild(ctx.guild).active()
|
||||||
active = not active
|
active = not active
|
||||||
await self.config.guild(ctx.guild).active.set(active)
|
await self.config.guild(ctx.guild).active.set(active)
|
||||||
if active:
|
if active:
|
||||||
await ctx.send(_("Reporting now enabled"))
|
await ctx.send(_("Reporting is now enabled"))
|
||||||
else:
|
else:
|
||||||
await ctx.send(_("Reporting disabled."))
|
await ctx.send(_("Reporting is now disabled."))
|
||||||
|
|
||||||
async def internal_filter(self, m: discord.Member, mod=False, perms=None):
|
async def internal_filter(self, m: discord.Member, mod=False, perms=None):
|
||||||
ret = False
|
ret = False
|
||||||
@ -201,10 +201,10 @@ class Reports:
|
|||||||
@commands.group(name="report", invoke_without_command=True)
|
@commands.group(name="report", invoke_without_command=True)
|
||||||
async def report(self, ctx: commands.Context, *, _report: str = ""):
|
async def report(self, ctx: commands.Context, *, _report: str = ""):
|
||||||
"""
|
"""
|
||||||
Follow the prompts to make a report
|
Send a report.
|
||||||
|
|
||||||
optionally use with a report message
|
Use without arguments for interactive reporting, or do
|
||||||
to use it non interactively
|
[p]report <text> to use it non-interactively.
|
||||||
"""
|
"""
|
||||||
author = ctx.author
|
author = ctx.author
|
||||||
guild = ctx.guild
|
guild = ctx.guild
|
||||||
@ -224,14 +224,17 @@ class Reports:
|
|||||||
if self.antispam[guild.id][author.id].spammy:
|
if self.antispam[guild.id][author.id].spammy:
|
||||||
return await author.send(
|
return await author.send(
|
||||||
_(
|
_(
|
||||||
"You've sent a few too many of these recently. "
|
"You've sent too many reports recently. "
|
||||||
"Contact a server admin to resolve this, or try again "
|
"Please contact a server admin if this is important matter, "
|
||||||
"later."
|
"or please wait and try again later."
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if author.id in self.user_cache:
|
if author.id in self.user_cache:
|
||||||
return await author.send(
|
return await author.send(
|
||||||
_("Please finish making your prior report before making an additional one")
|
_(
|
||||||
|
"Please finish making your prior report before trying to make an "
|
||||||
|
"additional one!"
|
||||||
|
)
|
||||||
)
|
)
|
||||||
self.user_cache.append(author.id)
|
self.user_cache.append(author.id)
|
||||||
|
|
||||||
@ -263,7 +266,9 @@ class Reports:
|
|||||||
|
|
||||||
with contextlib.suppress(discord.Forbidden, discord.HTTPException):
|
with contextlib.suppress(discord.Forbidden, discord.HTTPException):
|
||||||
if val is None:
|
if val is None:
|
||||||
await author.send(_("There was an error sending your report."))
|
await author.send(
|
||||||
|
_("There was an error sending your report, please contact a server admin.")
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
await author.send(_("Your report was submitted. (Ticket #{})").format(val))
|
await author.send(_("Your report was submitted. (Ticket #{})").format(val))
|
||||||
self.antispam[guild.id][author.id].stamp()
|
self.antispam[guild.id][author.id].stamp()
|
||||||
@ -313,10 +318,12 @@ class Reports:
|
|||||||
@report.command(name="interact")
|
@report.command(name="interact")
|
||||||
async def response(self, ctx, ticket_number: int):
|
async def response(self, ctx, ticket_number: int):
|
||||||
"""
|
"""
|
||||||
opens a message tunnel between things you say in this channel
|
Open a message tunnel.
|
||||||
and the ticket opener's direct messages
|
|
||||||
|
|
||||||
tunnels do not persist across bot restarts
|
This tunnel will forward things you say in this channel
|
||||||
|
to the ticket opener's direct messages.
|
||||||
|
|
||||||
|
Tunnels do not persist across bot restarts.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# note, mod_or_permissions is an implicit guild_only
|
# note, mod_or_permissions is an implicit guild_only
|
||||||
@ -342,14 +349,15 @@ class Reports:
|
|||||||
)
|
)
|
||||||
|
|
||||||
big_topic = _(
|
big_topic = _(
|
||||||
"{who} opened a 2-way communication."
|
"{who} opened a 2-way communication "
|
||||||
"about ticket number {ticketnum}. Anything you say or upload here "
|
"about ticket number {ticketnum}. Anything you say or upload here "
|
||||||
"(8MB file size limitation on uploads) "
|
"(8MB file size limitation on uploads) "
|
||||||
"will be forwarded to them until the communication is closed.\n"
|
"will be forwarded to them until the communication is closed.\n"
|
||||||
"You can close a communication at any point "
|
"You can close a communication at any point by reacting with "
|
||||||
"by reacting with the X to the last message recieved. "
|
"the \N{NEGATIVE SQUARED CROSS MARK} to the last message recieved.\n"
|
||||||
"\nAny message succesfully forwarded will be marked with a check."
|
"Any message succesfully forwarded will be marked with "
|
||||||
"\nTunnels are not persistent across bot restarts."
|
"\N{WHITE HEAVY CHECK MARK}.\n"
|
||||||
|
"Tunnels are not persistent across bot restarts."
|
||||||
)
|
)
|
||||||
topic = big_topic.format(
|
topic = big_topic.format(
|
||||||
ticketnum=ticket_number, who=_("A moderator in `{guild.name}` has").format(guild=guild)
|
ticketnum=ticket_number, who=_("A moderator in `{guild.name}` has").format(guild=guild)
|
||||||
@ -357,7 +365,7 @@ class Reports:
|
|||||||
try:
|
try:
|
||||||
m = await tun.communicate(message=ctx.message, topic=topic, skip_message_content=True)
|
m = await tun.communicate(message=ctx.message, topic=topic, skip_message_content=True)
|
||||||
except discord.Forbidden:
|
except discord.Forbidden:
|
||||||
await ctx.send(_("User has disabled DMs."))
|
await ctx.send(_("That user has DMs disabled."))
|
||||||
else:
|
else:
|
||||||
self.tunnel_store[(guild, ticket_number)] = {"tun": tun, "msgs": m}
|
self.tunnel_store[(guild, ticket_number)] = {"tun": tun, "msgs": m}
|
||||||
await ctx.send(big_topic.format(who=_("You have"), ticketnum=ticket_number))
|
await ctx.send(big_topic.format(who=_("You have"), ticketnum=ticket_number))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user