|
7 | 7 | from core import time |
8 | 8 | from core.models import PermissionLevel |
9 | 9 |
|
10 | | -CLOSING_MESSAGE = "Feel free to open a new thread if you need anything else." |
| 10 | +DEFAULT_CLOSE_MESSAGE = "Feel free to open a new thread if you need anything else." |
11 | 11 |
|
12 | 12 |
|
13 | | -class UserFriendlyTimeOnly(time.UserFriendlyTime): |
| 13 | +class UserFriendlyDuration(time.UserFriendlyTime): |
14 | 14 | """ |
15 | 15 | A converter which parses user-friendly time durations. |
16 | 16 |
|
@@ -46,9 +46,9 @@ async def convert(self, ctx: commands.Context, argument: str) -> str: |
46 | 46 |
|
47 | 47 | if self.arg: |
48 | 48 | add_period = not self.arg.endswith((".", "!", "?")) |
49 | | - self.arg = self.arg + (". " if add_period else " ") + CLOSING_MESSAGE |
| 49 | + self.arg = self.arg + (". " if add_period else " ") + DEFAULT_CLOSE_MESSAGE |
50 | 50 | else: |
51 | | - self.arg = CLOSING_MESSAGE |
| 51 | + self.arg = DEFAULT_CLOSE_MESSAGE |
52 | 52 |
|
53 | 53 | return self |
54 | 54 |
|
@@ -93,15 +93,15 @@ async def close_message( |
93 | 93 | # We're doing the conversion here to make the argument optional |
94 | 94 | # while still passing the converted argument instead of an |
95 | 95 | # empty string to the close command. |
96 | | - after = await UserFriendlyTimeOnly(default_close_duration='15m').convert(ctx, after) |
| 96 | + after = await UserFriendlyDuration(default_close_duration='15m').convert(ctx, after) |
97 | 97 | return await self.close_command(ctx, after=after) |
98 | 98 |
|
99 | 99 | @close_message.command(aliases=('msg',)) |
100 | 100 | @checks.has_permissions(PermissionLevel.SUPPORTER) |
101 | 101 | @checks.thread_only() |
102 | 102 | async def message(self, ctx: commands.Context) -> None: |
103 | | - """Send the closing message.""" |
104 | | - await ctx.send(f'> {CLOSING_MESSAGE}') |
| 103 | + """Send the default close message.""" |
| 104 | + await ctx.send(f'> {DEFAULT_CLOSE_MESSAGE}') |
105 | 105 |
|
106 | 106 |
|
107 | 107 | def setup(bot: ModmailBot) -> None: |
|
0 commit comments