Best Python code snippet using autotest_python
commands.py
Source:commands.py
...20 async def on_member_join(self, member):21 try:22 embed=discord.Embed(title=f'',description=f'ð¥ {member.mention} [`{member.guild} ({str(len(member.guild.members))}ëª
)`]',color=0xe99fee)23 embed.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)24 embed.set_author(name=f"íìí©ëë¤!!", url=member.avatar_url, icon_url=member.avatar_url)25 await member.guild.system_channel.send(embed=embed)26 except:27 pass2829 @commands.Cog.listener()30 async def on_member_remove(self, member):31 try:32 embed=discord.Embed(title=f'',description=f'ð¤ {member.mention} [`{member.guild} ({str(len(member.guild.members))}ëª
)`]',color=0xe99fee)33 embed.set_author(name=f"ìë
íê°ì¸ì..!", url=member.avatar_url, icon_url=member.avatar_url)34 embed.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)35 await member.guild.system_channel.send(embed=embed)36 except:37 pass3839 @commands.command(name = 'ì ë³´', pass_context = True)40 @commands.cooldown(1, 10, commands.BucketType.user)41 @commands.guild_only()42 async def info(self,ctx, member: discord.Member = None):43 if member == None:44 memory_usage_dict = dict(psutil.virtual_memory()._asdict())45 memory_usage_percent = memory_usage_dict['percent']46 now = datetime.utcnow()47 elapsed = now - starttime48 seconds = elapsed.seconds49 minutes, seconds = divmod(seconds, 60)50 hours, minutes = divmod(minutes, 60)51 days, hours = divmod(hours, 24)52 53 help = "```\nð - 기본\nð - LINA\nð¶ - LINA MUSIC\nð - ANTI LINA\n```"54 emb = discord.Embed(color = 0xe99fee)55 emb.set_author(name=f'리ëì ì ë³´ 구ì±ì¤..!')56 emb.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)5758 editer = await ctx.send(embed=emb)59 em = discord.Embed(description = help, color = 0xe99fee)60 em.set_author(name=f'리ëì ì ë³´ìì!')61 em.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)6263 mainMessage = await editer.edit(content=None,64 embed = em,65 components = [66 [67 Button(style = ButtonStyle.grey, emoji = 'ð ', id = 'home'),68 Button(style = ButtonStyle.grey, emoji = 'ð', id = 'lina'),69 Button(style = ButtonStyle.grey, emoji = 'ð', id = 'antil')],[70 Button(label = f"{len(self.bot.guilds)+1}ë²ì§¸ë¡ 리ë ì´ëí기", style = 5 , url = "https://discord.com/api/oauth2/authorize?client_id=860130066913296394&permissions=8&scope=bot%20applications.commands",emoji='ð¥', id = 'invite')]71 ]72 )7374 while True:75 try:76 interaction = await self.bot.wait_for(77 "button_click",78 timeout = 2079 )8081 help1 = f"> **모ë** - discord py `V1.7.6`\n> **ìë²ì** - `{len(self.bot.guilds)}`\n> **ë°íì** - `{days}ì¼ {hours}ìê° {minutes}ë¶ {seconds}ì´`\n> **ë©ëª¨ë¦¬ ì¬ì©ë** - `{memory_usage_percent}%`"82 help2 = f"> **ë²ì ** - `{ver}`\n> **ê°ë°ì** - `pgr#8588`"83 help4 = f"> **ë²ì ** - `0.3`\n> **ê°ë°ì** - `pgr#8588`"8485 if interaction.component.id == 'home':86 generalem = discord.Embed(description = help1, color = 0xe99fee)87 generalem.set_author(name=f'ð 리ëì 기본ì ë³´')88 generalem.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)89 await interaction.respond(type = 7, embed = generalem)9091 if interaction.component.id == 'lina':92 modem = discord.Embed(description = help2, color = 0xe99fee)93 modem.set_author(name=f'ð LINA ì ë³´')94 modem.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)95 await interaction.respond(type = 7, embed = modem)9697 if interaction.component.id == 'antil':98 minecem = discord.Embed(description = help4, color = 0xe99fee)99 minecem.set_author(name=f'ð ANTI LINA ì ë³´')100 minecem.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)101 await interaction.respond(type = 7, embed = minecem)102103 except asyncio.TimeoutError:104 await editer.edit(105 components = [106 [107 Button(108 label = "â",109 id = "home",110 style = ButtonStyle.red,111 disabled = True112 ),113 Button(114 label = "â",115 id = "lina",116 style = ButtonStyle.red,117 disabled = True118 ),119 Button(120 label = "â",121 id = "antil",122 style = ButtonStyle.red,123 disabled = True124 )125 ]126 ]127 )128 break129 else:130 member = ctx.author if not member else member131 user = member132 date = datetime.utcfromtimestamp(((int(user.id) >> 22) + 1420070400000) / 1000)133 server = user.joined_at.isoformat().split("T")[0]134 embed = discord.Embed(title="", description=f"```cs\nëë¤ì - '{user.display_name}'\nì¬ì©ìëª
- '{user}'\nëì½ ê°ì
ë ì§ - {str(date.year)}-{str(date.month)}-{str(date.day)}\nìë² ê°ì
ë ì§ - {server}\n```", color=0xe99fee)135 embed.set_author(name=f"{user}ëì ì ë³´ìì!", url=member.avatar_url, icon_url=member.avatar_url)136 embed.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)137 await ctx.send(embed=embed)138 139 @info.error140 async def info_error(self,ctx, err):141 embed1 = discord.Embed(title="", description="```ini\n리ëì¼ ì ë³´ [ ì ì ]\n```", color=0xe99fee)142 embed1.set_author(name="ìì½ê²ë ìë ì ì ì¸ê² ê°ìì..", icon_url=botavatar)143 embed1.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)144 await ctx.send(embed=embed1)145146 if isinstance(err, commands.CommandOnCooldown):147 embed = discord.Embed(title='',description=f"ì´ ëª
ë ¹ì´ë {math.ceil(round(err.retry_after, 2))}ì´ë¤ì ì¬ì©íì¤ì ììµëë¤", color=0xe99fee)148 embed.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)149 await ctx.message.reply(embed=embed)150151 @commands.command(name = 'ëìë§')152 @commands.cooldown(1, 10, commands.BucketType.user)153 @commands.guild_only()154 async def hhee(self,ctx):155 help = "```\nâï¸ - ì¼ë° ëª
ë ¹ì´\nð® - ê²ì ëª
ë ¹ì´\n𧱠- ë§í¬ ëª
ë ¹ì´\nð§ - ìë²ê´ë¦¬ì¤ì \n```"156 emb = discord.Embed(color = 0xe99fee)157 emb.set_author(name=f'리ëì ëìë§ êµ¬ì±ì¤..!')158 emb.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)159160 editer = await ctx.send(embed=emb)161 em = discord.Embed(description = help, color = 0xe99fee)162 em.set_author(name=f'리ëì ëìë§ì´ìì!')163 em.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)164165 mainMessage = await editer.edit(content=None,166 embed = em,167 components = [168 [169 Button(style = ButtonStyle.grey, emoji = 'âï¸', id = 'general'),170 Button(style = ButtonStyle.grey, emoji = 'ð®', id = 'game'),171 Button(style = ButtonStyle.grey, emoji = 'ð§±', id = 'minec'),172 Button(style = ButtonStyle.grey, emoji = 'ð§', id = 'tool')]173 ]174 )175176 while True:177 try:178 interaction = await self.bot.wait_for(179 "button_click",180 timeout = 10181 )182183 help1 = "```ini\n리ëì¼ ë°´ [ ì ì ] [ ì¬ì ]\n리ëì¼ ì¸ë°´ [ ì ì ]\n리ëì¼ ì ë³´ [ ì ì ]\n리ëì¼ íë¡í [ ì ì ]\n리ëì¼ í¥ [ ì ì ] [ ì¬ì ]\n리ëì¼ í\n리ëì¼ ì
ëë¡ê·¸\n```"184 help3 = "```ini\n[ íì¬ ë¡¤ ëª
ë ¹ì´ì ì¤ë¥ê° ììµëë¤. ]\n리ëì¼ ë¡¤ í°ì´ [ ì ì ] \n리ëì¼ ë¡¤ ì ë³´ [ ì ì ]\n리ëì¼ ë¡¤ ì ì [ ì ì ] [ ê²ìì ]\n리ëì¼ ì¿ í°ì ì²´ [ ê³ì ]\n```"185 help4 = "```ini\n리ëì¼ ìë²ìí [ IP or 주ì ] [ PORT ]\n```"186 help5 = "```cs\n> #ANTICO íê·¸\nìì¤&ë¹ìì´ ê°ì§ëì\n> #ANTIIM íê·¸\níì¼,ì´ë¯¸ì§ ì¤í¬ì¼ë¬ ëì\n> #ANTIURL íê·¸\në³´ë´ë ì¬ì´í¸ê° ê°ë ¤ì§ë ëì```"187188 if interaction.component.id == 'general':189 generalem = discord.Embed(description = help1, color = 0xe99fee)190 generalem.set_author(name=f'âï¸ ë¦¬ëì ì¼ë° ëª
ë ¹ì´')191 generalem.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)192 await interaction.respond(type = 7, embed = generalem)193194 if interaction.component.id == 'game':195 gameem = discord.Embed(description = help3, color = 0xe99fee)196 gameem.set_author(name=f'ð® 리ëì ê²ì ëª
ë ¹ì´')197 gameem.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)198 await interaction.respond(type = 7, embed = gameem)199200 if interaction.component.id == 'minec':201 minecem = discord.Embed(description = help4, color = 0xe99fee)202 minecem.set_author(name=f'𧱠리ëì ë§í¬ ëª
ë ¹ì´')203 minecem.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)204 await interaction.respond(type = 7, embed = minecem)205206 if interaction.component.id == 'tool':207 toolem = discord.Embed(description = help5, color = 0xe99fee)208 toolem.set_author(name=f'ð§ 리ëì ìë²ê´ë¦¬ì¤ì ')209 toolem.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)210 await interaction.respond(type = 7, embed = toolem)211212 except asyncio.TimeoutError:213 await editer.edit(214 components = [215 [216 Button(217 label = "â",218 id = "general",219 style = ButtonStyle.red,220 disabled = True221 ),222 Button(223 label = "â",224 id = "game",225 style = ButtonStyle.red,226 disabled = True227 ),228 Button(229 label = "â",230 id = "minec",231 style = ButtonStyle.red,232 disabled = True233 ),234 Button(235 label = "â",236 id = "tool",237 style = ButtonStyle.red,238 disabled = True239 )240 ]241 ]242 )243 break244245 @hhee.error246 async def hhee_error(self, ctx, err):247 if isinstance(err, commands.CommandOnCooldown):248 embed = discord.Embed(title='',description=f"ì´ ëª
ë ¹ì´ë {math.ceil(round(err.retry_after, 2))}ì´ë¤ì ì¬ì©íì¤ì ììµëë¤", color=0xe99fee)249 embed.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)250 await ctx.message.reply(embed=embed)251252 @commands.command(name='í' , pass_context = True)253 async def pingg(self,ctx):254 embed = discord.Embed(title="", description=f"íì¬ ë¦¬ëì íì **{round(self.bot.latency*1000)}ms** ì
ëë¤!", color=0xe99fee)255 embed.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)256 await ctx.send(embed=embed)257258 @commands.command(name="íë¡í")259 async def profile(self, ctx, member: discord.Member = None):260 member = ctx.author if not member else member261 embed = discord.Embed(colour=0xe99fee)262 embed.set_author(name=f"{member} ì íë¡íì´ìì!", url=member.avatar_url, icon_url=member.avatar_url)263 embed.set_image(url=member.avatar_url)264 await ctx.send(embed=embed)265266 @profile.error267 async def pro_error(self,ctx, error):268 embed1 = discord.Embed(title="", description="```ini\n리ëì¼ íë¡í [ ì ì ]\n```", color=0xe99fee)269 embed1.set_author(name="ìì½ê²ë ìë ì ì ì¸ê² ê°ìì..", icon_url=botavatar)270 embed1.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)271 await ctx.send(embed=embed1)272 273274 @commands.command(name="ì
ëë¡ê·¸" , pass_context = True)275 @commands.cooldown(1, 3, commands.BucketType.user)276 async def updatelog(self ,ctx):277 contents = [278 discord.Embed(description='리ëì ì¤ëë ìì¬ë¤ì ë³´ì¸ì!\n`âï¸` ì `â¶ï¸` ë¡ íì´ì§ë¥¼ ë기ì¸ì', color = 0xe99fee).set_author(name=f'리ëì ì
ë°ì´í¸ ë¡ê·¸', icon_url=botavatar).set_footer(text=f"LINA BOT {ver}"),279 discord.Embed(description="```cs\n#2021-9-10\n1. '리ëì¶ì'\n2. '기본' ëª
ë ¹ì´ë¤ ì¶ê°\n3. 'ê°ì±'ìë ìë² ëë¡ ìì ```", color = 0xe99fee).set_author(name=f'LINA 0.0.01 Ver Log', icon_url=botavatar).set_footer(text=f"LINA BOT {ver}", icon_url=botavatar),280 discord.Embed(description="```cs\n#2022-3-17\n1. 'ì ë³´' ëª
ë ¹ì´ ì¶ê°\n2. 'íë¡í' ëª
ë ¹ì´ ì¶ê°\n3. ì¼ë¶ 'ëª
ë ¹ì´' ìì \n4. 'ìí° íê·¸'ê¸°ë¥ ì¶ê°```", color = 0xe99fee).set_author(name=f'LINA 0.0.03 Ver Log', icon_url=botavatar).set_footer(text=f"LINA BOT {ver}", icon_url=botavatar),281 discord.Embed(description="```cs\n#2022-4-23\n1. 'í¥,ë°´,ì¸ë°´' ëª
ë ¹ì´ ë¦¬ëª¨ë¸ë§ ë° ê¸°ë¥ì¶ê°\n2. 'ë§í¬ ìë² ìí'íì¸ ëª
ë ¹ì´ ì¶ê°\n3. ì¼ë¶ ëª
ë ¹ì´ 'ìì°ì¤ë¬ì´' ë§í¬ë¡ 리모ë¸ë§\n4. 'ì
í´ì¥' ë¡ê·¸ ì¶ê°```", color = 0xe99fee).set_author(name=f'LINA 0.0.05 Ver Log', icon_url=botavatar).set_footer(text=f"LINA BOT {ver}", icon_url=botavatar),282 discord.Embed(description="```cs\n#2022-5-12\n1. '(ìì ë¨)' ëª
ë ¹ì´ ì¤ì¬ ëê·ëª¨ ì
ë°ì´í¸\n2. 'ì¼ë¶' ëª
ë ¹ì´ ë¦¬ëª¨ë¸ë§```", color = 0xe99fee).set_author(name=f'LINA 0.0.1B Ver Log', icon_url=botavatar).set_footer(text=f"LINA BOT {ver}", icon_url=botavatar),283 discord.Embed(description="```cs\n#2022-6-3\n1. 'ì¼ë¶ ëª
ë ¹ì´' 'ë²í¼'ì íì©í ëª
ë ¹ì´ë¡ 리모ë¸ë§\n2. 'ëë°° ë°©ì§'ê¸°ë¥ ì¶ê°```", color = 0xe99fee).set_author(name=f'LINA 0.0.15 Ver Log', icon_url=botavatar).set_footer(text=f"LINA BOT {ver}", icon_url=botavatar),284 discord.Embed(description="```cs\n#2022-6-5\n1. 'ì¿ í¤ë° í¹ë¤' ê´ë ¨ ëª
ë ¹ì´ 1ì¢
ì¶ê°```", color = 0xe99fee).set_author(name=f'LINA 0.0.17 Ver Log', icon_url=botavatar).set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)285 ]286 287 pages = 7288 cur_page = 1289 message = await ctx.send(embed=contents[cur_page-1])290291 await message.add_reaction("âï¸")292 await message.add_reaction("â¶ï¸")293 def check(reaction, user):294 if reaction.message.id == message.id:295 return user == ctx.author and str(reaction.emoji) in ["âï¸", "â¶ï¸"]296 else:297 pass298299 while True:300 try:301 reaction, user = await self.bot.wait_for("reaction_add", timeout=60, check=check)302303 if str(reaction.emoji) == "â¶ï¸" and cur_page != pages:304 cur_page += 1305 await message.edit(embed=contents[cur_page-1])306 await message.remove_reaction(reaction, user)307308 elif str(reaction.emoji) == "âï¸" and cur_page > 1:309 cur_page -= 1310 await message.edit(embed=contents[cur_page-1])311 await message.remove_reaction(reaction, user)312313 else:314 await message.remove_reaction(reaction, user)315 except discord.errors.Forbidden:316 embed = discord.Embed(title="", description="ë©ìì§ ê´ë¦¬ ê¶íì ë£ì´ì£¼ì¸ì!", color=0xe99fee)317 embed.set_author(name="ë©ìì§ ê´ë¦¬ ê¶íì´ ìì´ì..!", icon_url=botavatar)318 embed.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)319 await ctx.send(embed = embed)320 return321 except asyncio.TimeoutError:322 await message.clear_reactions()323 break324325 @updatelog.error326 async def updatelog_error(self, ctx, err):327 if isinstance(err, commands.CommandOnCooldown):328 embed = discord.Embed(title='',description=f"ì´ ëª
ë ¹ì´ë {math.ceil(round(err.retry_after, 2))}ì´ë¤ì ì¬ì©íì¤ì ììµëë¤", color=0xe99fee)329 embed.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)330 await ctx.message.reply(embed=embed)331332 @commands.command(name="í¥")333 @commands.has_permissions(kick_members=True)334 async def kick(self, ctx, member: discord.Member = None, *, message=None):335 try:336 if member is None:337 embed = discord.Embed(title="", description="```ini\n리ëì¼ í¥ [ ì ì ] [ ì¬ì ]\n```", color=0xe99fee)338 embed.set_author(name="ì¶ë°©í ì ì 를 ì ì´ì£¼ì¸ì!", icon_url=botavatar)339 embed.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)340 await ctx.send(embed=embed)341 else:342 if member is ctx.author:343 embed = discord.Embed(title="", description="```ini\n리ëì¼ í¥ [ ì ì ] [ ì¬ì ]\n```", color=0xe99fee)344 embed.set_author(name="ì기ìì ì ì¶ë°© í ì ìì´ì!", icon_url=botavatar)345 embed.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)346 await ctx.send(embed=embed)347 elif member.guild_permissions.administrator is True:348 embed = discord.Embed(title="", description="```ini\n리ëì¼ í¥ [ ì ì ] [ ì¬ì ]\n```", color=0xe99fee)349 embed.set_author(name="ê´ë¦¬ìë ì¶ë°© í ì ìì´ì!", icon_url=botavatar)350 embed.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)351 return await ctx.send(embed=embed)352 elif message is None:353 embed=discord.Embed(title=f'',description=f'> `ì¬ì : ìì`',color=0xe99fee)354 embed.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)355 embed.set_author(name=f"{member.name} ëì´ ì¶ë°©ëìì´ì.", url=member.avatar_url, icon_url=member.avatar_url)356 await ctx.send(embed=embed)357 embed1=discord.Embed(title=f'',description=f'> `ì¬ì : ìì`',color=0xe99fee)358 embed1.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)359 embed1.set_author(name=f"{ctx.author}ëì ìí´ í¥ì´ ëìì´ì.", url=ctx.author.avatar_url, icon_url=ctx.author.avatar_url)360 channel = await member.create_dm()361 await channel.send(embed=embed1)362 await member.kick(reason=f"{ctx.author}ëì ìí´ ì¶ë°©ë¹íì´ì..")363 else:364 try:365 embed=discord.Embed(title=f'',description=f'> `ì¬ì : {message}`',color=0xe99fee)366 embed.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)367 embed.set_author(name=f"{member.name} ëì´ ì¶ë°©ëìì´ì.", url=member.avatar_url, icon_url=member.avatar_url)368 embed1=discord.Embed(title=f'',description=f'> `ì¬ì : {message}`',color=0xe99fee)369 embed1.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)370 embed1.set_author(name=f"{ctx.author}ëì ìí´ í¥ì´ ëìì´ì.", url=ctx.author.avatar_url, icon_url=ctx.author.avatar_url)371 channel = await member.create_dm()372 await channel.send(embed=embed1)373 await member.kick(reason=f"{ctx.author}ëì ìí´ ì¶ë°©ë¹íì´ì..\nì¬ì : {message}")374 await ctx.send(embed=embed)375 except:376 embed=discord.Embed(title=f'',description=f'> `ì¬ì : ì ì ìì`',color=0xe99fee)377 embed.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)378 embed.set_author(name=f"{member.name} ëì´ ì¶ë°©ëìì´ì.", url=member.avatar_url, icon_url=member.avatar_url)379 embed1=discord.Embed(title=f'',description=f'> `ì¬ì : ì ì ìì`',color=0xe99fee)380 embed1.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)381 embed1.set_author(name=f"{ctx.author}ëì ìí´ í¥ì´ ëìì´ì.", url=ctx.author.avatar_url, icon_url=ctx.author.avatar_url)382 channel = await member.create_dm()383 await channel.send(embed=embed1)384 await member.kick(reason=f"{ctx.author}ëì ìí´ ì¶ë°©ë¹íì´ì.")385 await ctx.send(embed=embed)386387 except discord.ext.commands.MissingPermissions:388 embed = discord.Embed(title="", description="```ini\n리ëì¼ í¥ [ ì ì ] [ ì¬ì ]\n```", color=0xe99fee)389 embed.set_author(name="ê¶íì´ ìì´ì ì¶ë°© í ì ìì´ì!", icon_url=botavatar)390 embed.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar) 391 await ctx.send(embed=embed)392393 except discord.Forbidden as owo:394 embed = discord.Embed(title="", description="ë§´ë² ì¶ë°© ê¶íì ë£ì´ì£¼ì¸ì!", color=0xe99fee)395 embed.set_author(name="ì¶ë°© ê¶íì´ ìì´ì!", icon_url=botavatar)396 embed.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar) 397 await ctx.send(embed = embed)398 @kick.error399 async def unban_error(self, ctx, err):400 embed = discord.Embed(title="", description="```ini\n리ëì¼ í¥ [ ì ì ] [ ì¬ì ]\n```", color=0xe99fee)401 embed.set_author(name="í´ë¹íë ì ì ê° ìë²ì ìì´ì!", icon_url=botavatar)402 embed.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar) 403 await ctx.send(embed = embed)404405406 @commands.command(name="ë°´")407 @commands.has_permissions(kick_members=True)408 async def ban(self, ctx, member: discord.Member = None, *, message=None):409 user: discord.Member410 try:411 if member is None:412 embed = discord.Embed(title="", description="```ini\n리ëì¼ ë°´ [ ì ì ] [ ì¬ì ]\n```", color=0xe99fee)413 embed.set_author(name="ë°´í ì ì 를 ì ì´ì£¼ì¸ì!", icon_url=botavatar)414 embed.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)415 await ctx.send(embed=embed)416 else:417 if member is ctx.author:418 embed = discord.Embed(title="", description="```ini\n리ëì¼ ë°´ [ ì ì ] [ ì¬ì ]\n```", color=0xe99fee)419 embed.set_author(name="ì기ìì ì ë°´ í ì ìì´ì!", icon_url=botavatar)420 embed.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)421 await ctx.send(embed=embed)422 elif member.guild_permissions.administrator is True:423 embed = discord.Embed(title="", description="```ini\n리ëì¼ ë°´ [ ì ì ] [ ì¬ì ]\n```", color=0xe99fee)424 embed.set_author(name="ê´ë¦¬ìë ë°´ í ì ìì´ì!", icon_url=botavatar)425 embed.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)426 return await ctx.send(embed=embed)427 elif message is None:428 embed=discord.Embed(title=f'',description=f'> `ì¬ì : ìì`',color=0xe99fee)429 embed.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)430 embed.set_author(name=f"{member.name} ëì´ ë°´ ëìì´ì.", url=member.avatar_url, icon_url=member.avatar_url)431 await ctx.send(embed=embed)432 embed1=discord.Embed(title=f'',description=f'> `ì¬ì : ìì`',color=0xe99fee)433 embed1.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)434 embed1.set_author(name=f"{ctx.author}ëì ìí´ ë°´ì´ ëìì´ì.", url=ctx.author.avatar_url, icon_url=ctx.author.avatar_url)435 channel = await member.create_dm()436 await channel.send(embed=embed1)437 await member.ban(reason=f"{ctx.author}ëì ìí´ ë°´ , ì¬ì : ìì")438 else:439 try:440 embed=discord.Embed(title=f'',description=f'> `ì¬ì : {message}`',color=0xe99fee)441 embed.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)442 embed.set_author(name=f"{member.name} ëì´ ë°´ ëìì´ì.", url=member.avatar_url, icon_url=member.avatar_url)443 await ctx.send(embed=embed)444 embed1=discord.Embed(title=f'',description=f'> `ì¬ì : {message}`',color=0xe99fee)445 embed1.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)446 embed1.set_author(name=f"{ctx.author}ëì ìí´ ë°´ì´ ëìì´ì.", url=ctx.author.avatar_url, icon_url=ctx.author.avatar_url)447 channel = await member.create_dm()448 await channel.send(embed=embed1)449 await member.ban(reason=f"{ctx.author}ëì ìí´ ë°´ , ì¬ì : {message}")450 except:451 embed=discord.Embed(title=f'',description=f'> `ì¬ì : ì ì ìì`',color=0xe99fee)452 embed.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)453 embed.set_author(name=f"{member.name} ëì´ ë°´ ëìì´ì.", url=member.avatar_url, icon_url=member.avatar_url)454 await ctx.send(embed=embed)455 embed1=discord.Embed(title=f'',description=f'> `ì¬ì : ì ì ìì`',color=0xe99fee)456 embed1.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)457 embed1.set_author(name=f"{ctx.author}ëì ìí´ ë°´ì´ ëìì´ì.", url=ctx.author.avatar_url, icon_url=ctx.author.avatar_url)458 channel = await member.create_dm()459 await channel.send(embed=embed1)460 await member.ban(reason=f"{ctx.author}ëì ìí´ ë°´ , ì¬ì : ì ì ìì")461462 except discord.ext.commands.MissingPermissions:463 embed = discord.Embed(title="", description="```ini\n리ëì¼ ë°´ [ ì ì ] [ ì¬ì ]\n```", color=0xe99fee)464 embed.set_author(name="ê¶íì´ ìì´ì ì¶ë°© í ì ìì´ì!", icon_url=botavatar)465 embed.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar) 466 await ctx.send(embed=embed)467468 except discord.Forbidden as owo:469 embed = discord.Embed(title="", description="ë§´ë² ë°´ ê¶íì ë£ì´ì£¼ì¸ì!", color=0xe99fee)470 embed.set_author(name="ë°´ ê¶íì´ ìì´ì!", icon_url=botavatar)471 embed.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar) 472 await ctx.send(embed = embed)473 @ban.error474 async def unban_error(self, ctx, err):475 embed = discord.Embed(title="", description="```ini\n리ëì¼ ë°´ [ ì ì ] [ ì¬ì ]\n```", color=0xe99fee)476 embed.set_author(name="í´ë¹íë ì ì ê° ìë²ì ìì´ì!", icon_url=botavatar)477 embed.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar) 478 await ctx.send(embed = embed)479480 @commands.command(name="ì¸ë°´")481 @commands.guild_only()482 @commands.has_permissions(ban_members=True)483 async def unban(self,ctx,member):484 banned_users = await ctx.guild.bans()485 found = False486 try:487 member_name,member_id = member.split("#")488 except ValueError:489 embed = discord.Embed(title="", description="```ini\n리ëì¼ ì¸ë°´ [ ì ì ]\n```", color=0xe99fee)490 embed.set_author(name="ì ì ì ìì´ë를 ì¨ì£¼ì¸ì! (OOO#1111)", icon_url=botavatar)491 embed.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar) 492 await ctx.send(embed = embed)493 return494495 if member_id.isnumeric() == False or len(member_id) >4:496 embed = discord.Embed(title="", description="```ini\n리ëì¼ ì¸ë°´ [ ì ì ]\n```", color=0xe99fee)497 embed.set_author(name="ì ì 를 ì ííê² ì¨ì£¼ì¸ì! (OOO#1111)", icon_url=botavatar)498 embed.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar) 499 await ctx.send(embed = embed)500 return501502 for ban_entry in banned_users:503 user = ban_entry.user504 if (user.name,user.discriminator) == (member_name,member_id):505 embed=discord.Embed(title=f'',description=f'',color=0xe99fee)506 embed.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar)507 embed.set_author(name=f"{user.name} ëì ë°´ì´ íë ¸ì´ì!!", url=user.avatar_url, icon_url=user.avatar_url)508 await ctx.send(embed=embed)509 await ctx.guild.unban(user)510 found = True511 return512 513 if found == False:514 embed = discord.Embed(title="", description="```ini\n리ëì¼ ì¸ë°´ [ ì ì ]n```", color=0xe99fee)515 embed.set_author(name="ì¸ê¸ë ì ì ê° ë°´ 리ì¤í¸ì ìì´ì!", icon_url=botavatar)516 embed.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar) 517 await ctx.send(embed = embed)518 return519520 @unban.error521 async def unban_error(self, ctx, err):522 if isinstance(err, commands.MissingRequiredArgument):523 embed = discord.Embed(title="", description="```ini\n리ëì¼ ì¸ë°´ [ ì ì ]\n```", color=0xe99fee)524 embed.set_author(name="ì¸ë°´í ì ì 를 ì ì´ì£¼ì¸ì!", icon_url=botavatar)525 embed.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar) 526 await ctx.send(embed = embed)527 else:528 embed = discord.Embed(title="", description="ë§´ë² ë°´ ê¶íì ë£ì´ì£¼ì¸ì!", color=0xe99fee)529 embed.set_author(name="ì¸ë°´ ê¶íì´ ìì´ì!", icon_url=botavatar)530 embed.set_footer(text=f"LINA BOT {ver}", icon_url=botavatar) 531 await ctx.send(embed = embed)532533starttime = datetime.utcnow()534def setup(bot):
...
class-alert-bot.py
Source:class-alert-bot.py
...22 if ctime == '09:25:00': #1st hr........replace with your time 23 print("first class")24 if cday=='Monday' or cday=='Wednesday': 25 embed = DiscordEmbed(title=mde, description=des, color='33ff00')26 embed.set_author(name='Maths')27 embed.set_footer(text='footer here'')28 embed.set_timestamp()29 webhook.add_embed(embed)30 webhook.execute()31 time.sleep(1800)32 continue;33 elif cday=='Tuesday': 34 embed = DiscordEmbed(title=psp, description=des, color='33ff00')35 embed.set_author(name='PSP')36 embed.set_footer(text='footer here'')37 embed.set_timestamp()38 webhook.add_embed(embed)39 webhook.execute()40 time.sleep(1800)41 continue;42 elif cday=='Thursday':43 embed = DiscordEmbed(title=che, description=des, color='33ff00')44 embed.set_author(name='Chemistry')45 embed.set_footer(text='footer here')46 embed.set_timestamp()47 webhook.add_embed(embed)48 webhook.execute()49 time.sleep(1800)50 continue;51 elif cday=='Friday':52 embed = DiscordEmbed(title=phy, description=des, color='33ff00')53 embed.set_author(name='Physics')54 embed.set_footer(text='footer here')55 embed.set_timestamp()56 webhook.add_embed(embed)57 webhook.execute()58 time.sleep(1800)59 continue;60 elif cday == 'Saturday':61 embed = DiscordEmbed(title=beee, description=des, color='33ff00')62 embed.set_author(name='BEEE')63 embed.set_footer(text='footer here')64 embed.set_timestamp()65 webhook.add_embed(embed)66 webhook.execute()67 time.sleep(1800)68 continue; 69 else:70 print("holiday. i'm sleeping for 6 hours")#change it to whatever you want71 time.sleep(21600)# in seconds72 elif ctime == '10:40:00': #2nd hour73 print("2nd class vro")74 if cday=='Monday': 75 embed = DiscordEmbed(title=eng, description=des, color='33ff00')76 embed.set_author(name='English')77 embed.set_footer(text='footer here')78 embed.set_timestamp()79 webhook.add_embed(embed)80 webhook.execute()81 time.sleep(1800)82 continue;83 elif cday=='Tuesday': 84 embed = DiscordEmbed(title=psp, description=des, color='33ff00')85 embed.set_author(name='PSP')86 embed.set_footer(text='footer here')87 embed.set_timestamp()88 webhook.add_embed(embed)89 webhook.execute()90 time.sleep(1800)91 continue;92 elif cday=='Wednesday': 93 embed = DiscordEmbed(title=phy, description=des, color='33ff00')94 embed.set_author(name='Physics')95 embed.set_footer(text='footer here')96 embed.set_timestamp()97 webhook.add_embed(embed)98 webhook.execute()99 time.sleep(1800)100 continue;101 elif cday=='Thursday':102 embed = DiscordEmbed(title=beee, description=des, color='33ff00')103 embed.set_author(name='BEEE')104 embed.set_footer(text='footer here')105 embed.set_timestamp()106 webhook.add_embed(embed)107 webhook.execute()108 time.sleep(1800)109 continue;110 elif cday=='Friday':111 embed = DiscordEmbed(title=mde, description=des, color='33ff00')112 embed.set_author(name='Maths')113 embed.set_footer(text='footer here')114 embed.set_timestamp()115 webhook.add_embed(embed)116 webhook.execute()117 time.sleep(1800)118 continue;119 elif cday == 'Saturday':120 embed = DiscordEmbed(title=che, description=des, color='33ff00')121 embed.set_author(name='Chemistry')122 embed.set_footer(text='footer here')123 embed.set_timestamp()124 webhook.add_embed(embed)125 webhook.execute()126 time.sleep(1800)127 continue; 128 else:129 print("Holiday :)")130 time.sleep(21600)131132 elif ctime == "11:35:00": #3rd hour133 print("3rd class")134 if cday=='Monday': 135 embed = DiscordEmbed(title=che, description=des, color='33ff00')136 embed.set_author(name='Chemistry')137 embed.set_footer(text='footer here')138 embed.set_timestamp()139 webhook.add_embed(embed)140 webhook.execute()141 time.sleep(1800)142 continue;143 elif cday=='Tuesday': 144 embed = DiscordEmbed(title=phy, description=des, color='33ff00')145 embed.set_author(name='Physics')146 embed.set_footer(text='footer here')147 embed.set_timestamp()148 webhook.add_embed(embed)149 webhook.execute()150 time.sleep(1800)151 continue;152 elif cday=='Wednesday': 153 embed = DiscordEmbed(title=eng, description=des, color='33ff00')154 embed.set_author(name='English')155 embed.set_footer(text='footer here')156 embed.set_timestamp()157 webhook.add_embed(embed)158 webhook.execute()159 time.sleep(1800)160 continue;161 elif cday=='Thursday':162 embed = DiscordEmbed(title=eng, description=des, color='33ff00')163 embed.set_author(name='English')164 embed.set_footer(text='footer here')165 embed.set_timestamp()166 webhook.add_embed(embed)167 webhook.execute()168 time.sleep(1800)169 continue;170 elif cday=='Friday':171 embed = DiscordEmbed(title=psp, description=des, color='33ff00')172 embed.set_author(name='PSP')173 embed.set_footer(text='footer here')174 embed.set_timestamp()175 webhook.add_embed(embed)176 webhook.execute()177 time.sleep(1800)178 continue;179 elif cday == 'Saturday':180 embed = DiscordEmbed(title=phy, description=des, color='33ff00')181 embed.set_author(name='Physics')182 embed.set_footer(text='footer here')183 embed.set_timestamp()184 webhook.add_embed(embed)185 webhook.execute()186 time.sleep(1800)187 continue; 188 else:189 print("Holiday :)")190 time.sleep(21600)191192 elif ctime == "13:25:00": #4th hour193 print("4th class")194 if cday=='Monday': 195 embed = DiscordEmbed(title=beee, description=des, color='33ff00')196 embed.set_author(name='BEEE')197 embed.set_footer(text='footer here')198 embed.set_timestamp()199 webhook.add_embed(embed)200 webhook.execute()201 time.sleep(1800)202 continue;203 elif cday=='Tuesday': 204 embed = DiscordEmbed(title=mde, description=des, color='33ff00')205 embed.set_author(name='Maths')206 embed.set_footer(text='footer here')207 embed.set_timestamp()208 webhook.add_embed(embed)209 webhook.execute()210 time.sleep(1800)211 continue;212 elif cday=='Wednesday': 213 embed = DiscordEmbed(title=che, description=des, color='33ff00')214 embed.set_author(name='Chemistry')215 embed.set_footer(text='footer here')216 embed.set_timestamp()217 webhook.add_embed(embed)218 webhook.execute()219 time.sleep(1800)220 continue;221 elif cday=='Thursday':222 embed = DiscordEmbed(title=psp, description=des, color='33ff00')223 embed.set_author(name='PSP')224 embed.set_footer(text='footer here')225 embed.set_timestamp()226 webhook.add_embed(embed)227 webhook.execute()228 time.sleep(1800)229 continue;230 elif cday=='Friday':231 embed = DiscordEmbed(title=beee, description=des, color='33ff00')232 embed.set_author(name='BEEE')233 embed.set_footer(text='footer here')234 embed.set_timestamp()235 webhook.add_embed(embed)236 webhook.execute()237 time.sleep(1800)238 continue;239 elif cday == 'Saturday':240 embed = DiscordEmbed(title=mde, description=des, color='33ff00')241 embed.set_author(name='Maths')242 embed.set_footer(text='footer here')243 embed.set_timestamp()244 webhook.add_embed(embed)245 webhook.execute()246 time.sleep(1800)247 continue; 248 else:249 print("Holiday :)")250 time.sleep(21600)251252 elif ctime == "14:20:00": #5th hr253 print("5th class")254 if cday=='Monday': 255 embed = DiscordEmbed(title=phy, description=des, color='33ff00')256 embed.set_author(name='Physics')257 embed.set_footer(text='footer here')258 embed.set_timestamp()259 webhook.add_embed(embed)260 webhook.execute()261 time.sleep(1800)262 continue;263 elif cday=='Tuesday': 264 embed = DiscordEmbed(title=che, description=des, color='33ff00')265 embed.set_author(name='Chemistry')266 embed.set_footer(text='footer here')267 embed.set_timestamp()268 webhook.add_embed(embed)269 webhook.execute()270 time.sleep(1800)271 continue;272 elif cday=='Wednesday': 273 embed = DiscordEmbed(title=beee, description=des, color='33ff00')274 embed.set_author(name='BEEE')275 embed.set_footer(text='footer here')276 embed.set_timestamp()277 webhook.add_embed(embed)278 webhook.execute()279 time.sleep(1800)280 continue;281 elif cday=='Thursday':282 embed = DiscordEmbed(title=psp, description=des, color='33ff00')283 embed.set_author(name='PSP')284 embed.set_footer(text='footer here')285 embed.set_timestamp()286 webhook.add_embed(embed)287 webhook.execute()288 time.sleep(1800)289 continue;290 elif cday=='Friday':291 embed = DiscordEmbed(title=eng, description=des, color='33ff00')292 embed.set_author(name='English')293 embed.set_footer(text='footer here')294 embed.set_timestamp()295 webhook.add_embed(embed)296 webhook.execute()297 time.sleep(1800)298 continue;299 elif cday == 'Saturday':300 embed = DiscordEmbed(title=eng, description=des, color='33ff00')301 embed.set_author(name='English')302 embed.set_footer(text='footer here')303 embed.set_timestamp()304 webhook.add_embed(embed)305 webhook.execute()306 time.sleep(1800)307 continue; 308 else:309 print("Holiday :)")310 time.sleep(21600)311312 else:313 #print(ctime)
...
Main.py
Source:Main.py
...29 await Devin.Log(client, LogChannel, f"{ctx.author.mention} **Generated Keys!**\n**Days -> `{days}`**\n**Amount -> `{amt}`**", f"{Name} Logs")30 if int(amt) > 1:31 Keys = Devin.GenerateLicenses(days, amt)32 embed = discord.Embed(color=SuccessColor)33 embed.set_author(name='Successful!')34 embed.add_field(name=f'Successfully Generated Licenses', value=f'\n**Days --> `{days}`\nAmount --> `{amt}`**', inline=False)35 for k in range(len(Keys)):36 embed.add_field(name=f'â', value=f'**`{Keys[k]}`**', inline=False)37 await ctx.send(embed=embed)38 elif int(amt) == 1:39 Key = Devin.GenerateLicense(days)40 embed = discord.Embed(color=SuccessColor)41 embed.set_author(name='Successful!')42 embed.add_field(name=f'Successfully Generated License', value=f'\n**Days --> `{days}`\nAmount --> `1`**', inline=False)43 embed.add_field(name=f'â', value=f'**`{Key}`**', inline=False)44 await ctx.send(embed=embed)45 else:46 embed = discord.Embed(color=ErrorColor)47 embed.set_author(name='Error!')48 embed.add_field(name=f'Information', value=f'**Please Specify Days And Amount!**\n\n**Example -> `{Prefix}genlicense [Days] [Amount]`**', inline=False)49 await ctx.send(embed=embed)50 else:51 embed = discord.Embed(color=ErrorColor)52 embed.set_author(name='Error!')53 embed.add_field(name=f'Information', value=f'**Please Execute This Command In A Different Channel!**', inline=False)54 await ctx.send(embed=embed)5556@client.command()57@commands.has_any_role(GenerateKeysRole) 58async def deleteuser(ctx, userid):59 await Devin.Log(client, LogChannel, f"{ctx.author.mention} **Deleted User! -> `{userid}`**", f"{Name} Logs")60 if Devin.DeleteUser(userid):61 embed = discord.Embed(color=SuccessColor)62 embed.set_author(name='Successful!')63 embed.add_field(name=f'Successfully Deleted User', value=f'â', inline=False)64 await ctx.send(embed=embed)65 else:66 embed = discord.Embed(color=ErrorColor)67 embed.set_author(name='Error!')68 embed.add_field(name=f'Errori Deleting User', value=f'â', inline=False)69 await ctx.send(embed=embed)7071@client.command()72@commands.has_any_role(GenerateKeysRole) 73async def extend(ctx, userid, days):74 if Devin.ExtendUser(userid, days):75 await Devin.Log(client, LogChannel, f"{ctx.author.mention} **Extended User -> `{userid}` | Days -> `{days}`**", f"{Name} Logs")76 embed = discord.Embed(color=SuccessColor)77 embed.set_author(name='Successful!')78 embed.add_field(name=f'Successfully Extended User', value=f'â', inline=False)79 await ctx.send(embed=embed)80 else:81 embed = discord.Embed(color=ErrorColor)82 embed.set_author(name='Error!')83 embed.add_field(name=f'Error Extending User', value=f'â', inline=False)84 await ctx.send(embed=embed)8586@client.command()87@commands.has_any_role(GenerateKeysRole) 88async def keys(ctx):89 if ctx.channel.id == GeneratorKeysChannel:90 await Devin.Log(client, LogChannel, f"{ctx.author.mention} **Fetched Keys!**", f"{Name} Logs")91 Keys = Devin.GetActiveLicenses()92 if len(Keys) > 0:93 embed = discord.Embed(color=SuccessColor)94 embed.set_author(name='Successful!')95 embed.add_field(name=f'Successfully Fetched Licenses', value=f'â', inline=False)96 for k in range(len(Keys)):97 try:98 embed.add_field(name=f'â', value=Keys[k], inline=False)99 except:100 break101 await ctx.send(embed=embed)102 else:103 embed = discord.Embed(color=SuccessColor)104 embed.set_author(name='Successful!')105 embed.add_field(name=f'Successfully Fetched Licenses', value=f'â', inline=False)106 embed.add_field(name=f'â', value=f'**No Active Licenses!**', inline=False)107 await ctx.send(embed=embed)108 else:109 embed = discord.Embed(color=ErrorColor)110 embed.set_author(name='Error!')111 embed.add_field(name=f'â', value=f'**Please Execute This Command In A Different Channel!**', inline=False)112 await ctx.send(embed=embed)113114@client.command()115@commands.has_any_role(GenerateKeysRole) 116async def deleteallkeys(ctx):117 if ctx.channel.id == GeneratorKeysChannel:118 await Devin.Log(client, LogChannel, f"{ctx.author.mention} **Deleted All Keys!**", f"{Name} Logs")119 if Devin.DeleteAllLicenses():120 embed = discord.Embed(color=SuccessColor)121 embed.set_author(name='Successful!')122 embed.add_field(name=f'Successfully Deleted All Licenses', value=f'â', inline=False)123 await ctx.send(embed=embed)124 else:125 embed = discord.Embed(color=ErrorColor)126 embed.set_author(name='Error!')127 embed.add_field(name=f'Error Deleting All Licenses', value=f'â', inline=False)128 await ctx.send(embed=embed)129 else:130 embed = discord.Embed(color=ErrorColor)131 embed.set_author(name='Error!')132 embed.add_field(name=f'Information', value=f'**Please Execute This Command In A Different Channel!**', inline=False)133 await ctx.send(embed=embed)134135@client.command()136@commands.has_any_role(GenerateKeysRole) 137async def deletekey(ctx, key):138 if ctx.channel.id == GeneratorKeysChannel:139 await Devin.Log(client, LogChannel, f"{ctx.author.mention} **Deleted A Key -> `{key}`**", f"{Name} Logs")140 if Devin.DeleteLicense(key):141 embed = discord.Embed(color=SuccessColor)142 embed.set_author(name='Successful!')143 embed.add_field(name=f'Successfully Deleted Key!', value=f'â', inline=False)144 await ctx.send(embed=embed)145 else:146 embed = discord.Embed(color=ErrorColor)147 embed.set_author(name='Error!')148 embed.add_field(name=f'Error Deleting Key!', value=f'â', inline=False)149 await ctx.send(embed=embed)150 else:151 embed = discord.Embed(color=ErrorColor)152 embed.set_author(name='Error!')153 embed.add_field(name=f'Information', value=f'**Please Execute This Command In A Different Channel!**', inline=False)154 await ctx.send(embed=embed)155156@client.command()157async def redeem(ctx,key = None):158 if key == None:159 embed = discord.Embed(color=ErrorColor)160 embed.set_author(name='Error!')161 embed.add_field(name=f'Missing License!', value=f'â', inline=False)162 await ctx.send(embed=embed)163 else:164 if Devin.AddSubscription(ctx.author.id, key):165 await Devin.Log(client, LogChannel, f"{ctx.author.mention} **Redeemed A Key -> `{key}`**", f"{Name} Logs")166 embed = discord.Embed(color=SuccessColor)167 embed.set_author(name='Successfully Redeemed!')168 embed.add_field(name=f'â', value=f'{ctx.author.mention} **You Have Redeemed A License!**', inline=False)169 await ctx.send(embed=embed)170 elif Devin.AddSubscription(ctx.author.id, key) == None:171 embed = discord.Embed(color=ErrorColor)172 embed.set_author(name='Error!')173 embed.add_field(name=f'You Already Have An Active Subscription!', value='â', inline=False)174 await ctx.send(embed=embed)175 else:176 embed = discord.Embed(color=ErrorColor)177 embed.set_author(name='Error')178 embed.add_field(name=f'You Have Redeemed An Invalid License!', value=f'â', inline=False)179 await ctx.send(embed=embed)180181@client.command()182async def auth(ctx):183 if Devin.VerifyUser(ctx.author.id):184 embed = discord.Embed(color=SuccessColor)185 embed.set_author(name='Successfully Authenticated User!')186 await ctx.send(embed=embed)187 else:188 embeda = discord.Embed(color=ErrorColor)189 embeda.set_author(name='Error!')190 embeda.add_field(name=f"You Don't Have An Active Subscription To Use This! ", value=f'â', inline=False)191 await ctx.send(embed=embeda)192193@client.command()194async def info(ctx):195 if Devin.VerifyUser(ctx.author.id):196 embed = discord.Embed(color=SuccessColor)197 embed.set_author(name='Plan Info!')198 embed.add_field(name=f'â', value=f'{Devin.GetExpiry(ctx.author.id)}', inline=False)199 await ctx.send(embed=embed)200 else:201 embeda = discord.Embed(color=ErrorColor)202 embeda.set_author(name='Error!')203 embeda.add_field(name=f"You Don't Have An Active Subscription To Use This! ", value=f'â', inline=False)204 await ctx.send(embed=embeda)205206@client.command()207async def help(ctx):208 embed = discord.Embed(color=SuccessColor)209 embed.set_author(name=Name + ' Commands')210 embed.add_field(name=f'â', value=f'** ----- Admin Commands ----- **\n\n **`{Prefix}GenKey [Days] [Amount]`**\n\n **`{Prefix}DeleteUser [UserID]`** \n\n **`{Prefix}DeleteKey [Key]`** \n\n **`{Prefix}Extend [UserID] [Days]`**\n\n **`{Prefix}Keys`**\n\n **`{Prefix}DeleteAllKeys`**\n\n** ----- Commands ----- **\n\n **`{Prefix}Redeem [Key]`**\n\n**`{Prefix}Info`**\n\n**`{Prefix}Auth`**', inline=False)211 await ctx.send(embed=embed)212213@client.command(pass_context=True)214@commands.has_permissions(administrator=True)215async def clean(ctx, limit: int):216 await ctx.channel.purge(limit=limit + 1)217218@client.event219async def on_ready():220 Update.start()221 await Devin.Log(client, LogChannel, f"**Message -> `Bot Ready!`**", f"{Name} Logs")222 print(f'{client.user} Online')223
...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!