MCPcopy Create free account
hub / github.com/TechifyBots/Rename-Bot / get_seconds_first

Function get_seconds_first

helper/utils.py:82–100  ·  view source on GitHub ↗
(time_string)

Source from the content-addressed store, hash-verified

80 await b.send_message(Config.LOG_CHANNEL, log_message)
81
82async def get_seconds_first(time_string):
83 conversion_factors = {
84 's': 1,
85 'min': 60,
86 'hour': 3600,
87 'day': 86400,
88 'month': 86400 * 30,
89 'year': 86400 * 365
90 }
91
92 parts = time_string.split()
93 total_seconds = 0
94
95 for i in range(0, len(parts), 2):
96 value = int(parts[i])
97 unit = parts[i+1].rstrip('s') # Remove 's' from unit
98 total_seconds += value * conversion_factors.get(unit, 0)
99
100 return total_seconds
101
102async def get_seconds(time_string):
103 conversion_factors = {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected