aboutsummaryrefslogtreecommitdiff
path: root/cogs/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'cogs/utils.py')
-rwxr-xr-xcogs/utils.py85
1 files changed, 58 insertions, 27 deletions
diff --git a/cogs/utils.py b/cogs/utils.py
index 2a77653..c4b1317 100755
--- a/cogs/utils.py
+++ b/cogs/utils.py
@@ -110,15 +110,12 @@ class Utils(commands.Cog):
}
if ctx.author.id in rigged_findseed:
- totalEyes = rigged_findseed[ctx.author.id]
+ total_eyes = rigged_findseed[ctx.author.id]
else:
- totalEyes = 0
- for i in range(12):
- randomness = randint(1, 10)
- if randomness <= 1:
- totalEyes += 1
+ total_eyes = sum([1 for i in range(12) if randint(1,10) == 1])
+
await ctx.send(
- f"{discord.utils.escape_mentions(ctx.message.author.display_name)} -> your seed is a {totalEyes} eye"
+ f"{discord.utils.escape_mentions(ctx.message.author.display_name)} -> your seed is a {total_eyes} eye"
)
@findseed.error
@@ -222,91 +219,97 @@ class Utils(commands.Cog):
async def on_message(self, message):
if not message.guild:
return
- if message.channel.id != int(self.bot.config[str(
- message.guild.id)]["fair_channel"]):
- return
if message.author.bot:
return
badWords = ["fair", "ⓕⓐⓘⓡ"]
count = 0
+ year = datetime.date.today().year
coolKids = [
[
'Cameron',
self.bot.get_user(468262902969663488),
- datetime.date(2020, 10, 8)
+ datetime.date(year, 10, 8)
],
[
'Indy',
self.bot.get_user(274923326890311691),
- datetime.date(2020, 9, 10)
+ datetime.date(year, 9, 10)
],
[
'Kai',
self.bot.get_user(199070670221475842),
- datetime.date(2020, 11, 20)
+ datetime.date(year, 11, 20)
],
[
'Luca',
self.bot.get_user(99457716614885376),
- datetime.date(2020, 11, 5)
+ datetime.date(year, 11, 5)
],
[
'Max',
self.bot.get_user(543958509243596800),
- datetime.date(2020, 11, 10)
+ datetime.date(year, 11, 10)
],
[
'Mistaken',
self.bot.get_user(264121998173536256),
- datetime.date(2020, 7, 6)
+ datetime.date(year, 7, 6)
],
[
- 'Murray',
+ 'Jake',
self.bot.get_user(400344183333847060),
datetime.date(2020, 11, 10)
],
[
'Nevaeh',
self.bot.get_user(738279874749530172),
- datetime.date(2020, 11, 5)
+ datetime.date(year, 11, 5)
],
# idk if she goes by her irl name but I'm sticking with it for the sake of uniformity
# also idk how to pronounce prakxo
+
+ # EDIT: Seems like real names are the standard now lol
+ # its just a name, aliases are stupid
[
'Samantha',
self.bot.get_user(226312219787264000),
- datetime.date(2020, 6, 24)
+ datetime.date(year, 6, 24)
],
[
'Scott',
self.bot.get_user(223937483774230528),
- datetime.date(2020, 6, 23)
+ datetime.date(year, 6, 23)
],
[
'Ben',
self.bot.get_user(329538915805691905),
- datetime.date(2020, 6, 24)
+ datetime.date(year, 6, 24)
],
[
'Thomas',
self.bot.get_user(280428276810383370),
- datetime.date(2020, 9, 29)
+ datetime.date(year, 9, 29)
],
[
- 'Samantha', # This one is Zyemlus
+ 'Samantha', # This one is Zyemlus
self.bot.get_user(536071288859656193),
- datetime.date(2020, 8, 23)
+ datetime.date(year, 8, 23)
],
[
'Landen',
self.bot.get_user(654025117025828885),
- datetime.date(2020, 8, 24)
+ datetime.date(year, 8, 24)
],
[
'Oceanlight',
self.bot.get_user(615658069132836865),
- datetime.date(2020, 4, 9)
+ datetime.date(year, 4, 9)
+ ],
+ [
+ 'Shadowfi',
+ self.bot.get_user(586664256217415681),
+ datetime.date(year, 11, 14)
]
]
@@ -315,7 +318,7 @@ class Utils(commands.Cog):
try:
for i in range(self.tries):
await coolKid[1].send(
- f'Happy Birthday {coolKid[0]}! You\'re a boomer now! :mango:'
+ f'Happy Birthday {coolKid[0]}! You\'re a boomer now! <:mangopog:730683234039365722>'
)
self.tries = 1
except:
@@ -382,5 +385,33 @@ class Utils(commands.Cog):
output = ", ".join([*commands])
await ctx.send(f"```List of custom commands:\n{output}```")
+ @commands.command()
+ async def retime(self, ctx, start_sec, end_sec, frames=0, framerate=30):
+ """Retimes a run using the start/end timestamps, leftover frames, and framerate"""
+ if start_sec.count(':') == 2:
+ start_sec = sum(
+ x * int(t)
+ for x, t in zip([3600, 60, 1], start_sec.split(":")))
+ elif start_sec.count(':') == 1:
+ start_sec = sum(x * int(t)
+ for x, t in zip([60, 1], start_sec.split(":")))
+ else:
+ start_sec = int(start_sec)
+
+ if end_sec.count(':') == 2:
+ end_sec = sum(x * int(t)
+ for x, t in zip([3600, 60, 1], end_sec.split(":")))
+ elif end_sec.count(':') == 1:
+ end_sec = sum(x * int(t)
+ for x, t in zip([60, 1], end_sec.split(":")))
+ else:
+ end_sec = int(end_sec)
+
+ await ctx.send(
+ str(
+ timedelta(seconds=end_sec - start_sec +
+ round((int(frames) / int(framerate)), 3))).replace('000', ''))
+
+
def setup(bot):
bot.add_cog(Utils(bot))