1from discord.ext import commands
2
3""" 4A custom Cooldown type subclassing built in cooldowns from discord.ext commands.
5This is a bucket type that allows cooldowns to work based on some text, allowing
6things like cooldown on individual `Tags`, or message spam detection.
193 await self.delete(message)
194 return True
195
196 """197 NEWLINE FILTER
198 """
199 if len(message.content.splitlines()) > 100:
103 await report_raid(member)
104 await self.freeze_server(member.guild)
105
106 """Detect whether more than 4 users created on the same day107 (after May 1st 2021) join within 45 minutes of each other"""
108
109 # skip if the user was created within the last 15 minutes
77 if member.bot:
78 return
79
80 """Detect whether more than 10 users join within 8 seconds""" 81 # add user to cooldown
82 current = datetime.now().timestamp()
83 join_spam_detection_bucket = self.join_raid_detection_threshold.get_bucket(
1884 ctx.voice_state.stopped = False
1885 return await self.respond(ctx.ctx, loc["messages"]["play_single_playlist"].format(args[0], entry['title']), color=0x1eff00)
1886 "Unfinished functions hehe"
1887 """elif args[1] in ("share", "export"):1888 await self.respond(ctx.ctx, f"Playlist Share - {args[0]}", description=base64.b64encode("\n".join(data[args[0]]).encode("utf-8")).decode("utf-8"))
1889 elif args[1] == "import":
1890 if len(args) < 2:
The string statement has not been assigned to anything. This is pointless and should be removed if not necessary. In case this is supposed to describe what's happening in the code, it is recommended to use comments or docstrings instead.
'Define a function to add 2 numbers here.'
def add(a, b):
return a + b
Use Comments:
# Define a function to add 2 numbers here.
def add(a, b):
return a + b
or, use docstrings:
def add(a, b):
'''Function to add 2 numbers here.'''
return a + b