13
13
from bot .converters import Duration , DurationDelta
14
14
from bot .log import get_logger
15
15
from bot .utils import time
16
- from bot .utils .time import format_relative , humanize_delta
17
16
18
17
log = get_logger (__name__ )
19
18
@@ -57,7 +56,7 @@ async def get_slowmode(self, ctx: Context, channel: MessageHolder) -> None:
57
56
if cached_data is not None :
58
57
original_delay , expiration_time = cached_data .partition (", " )
59
58
humanized_original_delay = time .humanize_delta (seconds = int (original_delay ))
60
- expiration_timestamp = format_relative (expiration_time )
59
+ expiration_timestamp = time . format_relative (expiration_time )
61
60
await ctx .send (
62
61
f"The slowmode delay for { channel .mention } is { humanized_delay } "
63
62
f" and will revert to { humanized_original_delay } { expiration_timestamp } ."
@@ -104,7 +103,7 @@ async def set_slowmode(
104
103
return
105
104
106
105
if expiry is not None :
107
- expiration_timestamp = format_relative (expiry )
106
+ expiration_timestamp = time . format_relative (expiry )
108
107
109
108
# Only cache the original slowmode delay if there is not already an ongoing temporary slowmode.
110
109
if not await self .slowmode_cache .contains (channel .id ):
@@ -114,12 +113,12 @@ async def set_slowmode(
114
113
delay_to_cache = cached_data .split (", " )[0 ]
115
114
self .scheduler .cancel (channel .id )
116
115
await self .slowmode_cache .set (channel .id , f"{ delay_to_cache } , { expiry } " )
117
- humanized_original_delay = humanize_delta (seconds = int (delay_to_cache ))
116
+ humanized_original_delay = time . humanize_delta (seconds = int (delay_to_cache ))
118
117
119
118
self .scheduler .schedule_at (expiry , channel .id , self ._revert_slowmode (channel .id ))
120
119
log .info (
121
120
f"{ ctx .author } set the slowmode delay for #{ channel } to { humanized_delay } "
122
- f" which will revert to { humanized_original_delay } in { humanize_delta (expiry )} ."
121
+ f" which will revert to { humanized_original_delay } in { time . humanize_delta (expiry )} ."
123
122
)
124
123
await channel .edit (slowmode_delay = slowmode_delay )
125
124
await ctx .send (
0 commit comments