diff --git a/cogs/api_cmd.py b/cogs/api_cmd.py index cafe9d0..893f3ca 100644 --- a/cogs/api_cmd.py +++ b/cogs/api_cmd.py @@ -2,7 +2,7 @@ from discord.ext import commands import io from logging import error -from discord.commands.commands import Option, slash_command +from discord import Option, slash_command from discord.ext import commands import aiohttp import requests @@ -115,7 +115,7 @@ async def pandafact(self, ctx): # YearFact @slash_command() - async def yearfact (self, ctx): + async def yearfact(self, ctx): """๐Ÿ“… Sends a random Year fact""" await ctx.defer() async with aiohttp.ClientSession() as cs: diff --git a/cogs/fun.py b/cogs/fun.py index 1f55cc4..a0d2869 100644 --- a/cogs/fun.py +++ b/cogs/fun.py @@ -1,5 +1,5 @@ import discord -from discord.commands.commands import Option, slash_command +from discord import Option, slash_command from discord.errors import Forbidden from discord.ext import commands import random @@ -14,7 +14,7 @@ def __init__(self, bot): # 8ball - @slash_command(name="8ball", guild_ids=[830504002905964586, 828550575023980554, 820621306797359124]) + @slash_command(name="8ball") async def _8ball(self, ctx, *, question: Option(str, "Write Your Question", required=True)): """The Ultimate 8-ball game is now on Discord ๐ŸŽฑ""" responses = ['It is certain.', @@ -44,16 +44,11 @@ async def _8ball(self, ctx, *, question: Option(str, "Write Your Question", requ value=f"**My Magic Foretells me:\n `{random.choice(responses)}`**",) await ctx.respond(embed=e) - @_8ball.error - async def _8ball_error(self, ctx, error): - if isinstance(error, commands.MissingRequiredArgument): - await ctx.respond('Please ask a Question!') - # Lovemeter @slash_command() async def lovemeter(self, ctx, name1: Option(str, "Enter the name of 1st lovebird", required=True), name2: Option(str, "Enter the name of 2nd lovebird", required=True)): - """How Much DO You Love Me~ Senpai? ๐Ÿ’–""" + """How Much Do You Love Me~ Senpai? ๐Ÿ’–""" percentage = random.randint(0, 100) if 0 <= percentage <= 10: @@ -370,8 +365,12 @@ def reaction_check(m): try: await msg.add_reaction("๐Ÿป") await self.bot.wait_for('raw_reaction_add', timeout=10.0, check=reaction_check) - await msg.edit(content=f"**{user.mention}** and **{ctx.author.mention}** Are enjoying a lovely ๐Ÿป coz\n\n `{reason}`") - await msg.clear_reactions() + if reason == None: + await msg.edit(content=f"**{user.mention}** and **{ctx.author.mention}** Are enjoying a lovely ๐Ÿป") + await msg.clear_reactions() + else: + await msg.edit(content=f"**{user.mention}** and **{ctx.author.mention}** Are enjoying a lovely ๐Ÿป coz\n\n `{reason}`") + await msg.clear_reactions() except asyncio.TimeoutError: await msg.delete() await ctx.send(f"Well, it seems **{user.name}** didn't wanted to say 'cheers' with **`{ctx.author.name}`** ;-;") @@ -472,7 +471,7 @@ async def kill(self, ctx, user: Option(discord.Member, "Choose The User", requir 'dressing up as a cookie and cookie monster ate them.', 'trying to re-act Indiana Jones, died from a snake bite.', 'tried to short circuit me, not that easy retard', - 'tried to fight a bear with there hands', + 'tried to fight a bear with their hands', 'getting Billy Heartied in the ball sacks' ] await ctx.respond(embed=discord.Embed( @@ -562,6 +561,7 @@ async def snap(self, ctx, member: Option(discord.Member, "Choose the Member", re # setup COMMAND + def setup(bot): bot.add_cog(Fun(bot)) print("Fun Cog is Loaded\n------") diff --git a/cogs/help.py b/cogs/help.py index eb82142..dd88a6f 100644 --- a/cogs/help.py +++ b/cogs/help.py @@ -1,6 +1,6 @@ import discord -from discord.commands.commands import slash_command from discord.ext import commands +from discord import slash_command from disputils import BotEmbedPaginator color = 0x1ABC9C @@ -26,7 +26,7 @@ async def help(self, ctx): embed1.add_field( name="๐Ÿ›ก๏ธ Moderation", value=f'`nick` `purge` `purgeuser` `mute` `unmute` `kick` `ban` `nuke` `role` `slowmode` `lock` `unlock` `name_role`', inline=False) embed1.add_field( - name="โšฝ Fun & Games", value=f'`8ball` `lovemeter` `rps` `sad/happy/angry` `hello` `lenny` `flip` `f` `calculator` `diceroll` `meme` `joke` `password` `slots` `cheers` `simp` `iq` `roast` `kill`', inline=False) + name="โšฝ Fun & Games", value=f'`8ball` `activity` `lovemeter` `rps` `sad/happy/angry` `hello` `lenny` `flip` `f` `calculator` `diceroll` `meme` `joke` `password` `slots` `cheers` `simp` `iq` `roast` `kill`', inline=False) embed1.add_field( name="๐Ÿ–ผ๏ธ Images", value=f'`cat` `dog` `panda` `koala` `clyde` `facepalm` `wink` `headpat` `triggered` `hug` `snap`', inline=False) embed1.add_field( @@ -34,9 +34,9 @@ async def help(self, ctx): embed1.add_field( name="๐Ÿ’ญ Facts & Advices", value=f'`dogfact` `catfact` `pandafact` `numberfact` `yearfact` `advice`', inline=False) embed1.add_field( - name="๐Ÿค– SPIKE", value=f'`about` `ping` `invite` `support` `help` `uptime`', inline=False) + name="๐Ÿค– Olympus", value=f'`about` `ping` `invite` `support` `help` `uptime`', inline=False) embed1.add_field( - name=f"๐Ÿ‘‘ Owner Only", value=f'`stats` `serverlist` `createinvite`', inline=False) + name=f"๐Ÿ‘‘ Owner Only", value=f'`stats` `serverlist` `createinvite` `leave`', inline=False) embed1.set_footer( text=f"Olympus is made with โค๏ธ | _TheKauchikG_#5300", icon_url=f'{ctx.author.avatar.url}') diff --git a/cogs/mod.py b/cogs/mod.py index ccceda5..f3a013f 100644 --- a/cogs/mod.py +++ b/cogs/mod.py @@ -1,5 +1,5 @@ import discord -from discord.commands.commands import Option +from discord import Option from discord.commands.errors import ApplicationCommandInvokeError from discord.errors import NotFound from discord.ext import commands @@ -44,7 +44,7 @@ async def nick_error(self, ctx, error): @slash_command() @commands.has_permissions(manage_messages=True) - async def purge(self, ctx, amount: Option(int, "Enter the number of messages to be purged", required=False)): + async def purge(self, ctx, amount: Option(int, "Enter the number of messages to be purged(Default = 3)", required=False)): """๐Ÿงน Clears a certain amount of messages from the channel""" if amount == None: amount = 3 @@ -67,7 +67,7 @@ async def purge_error(self, ctx, error): @slash_command() @commands.has_permissions(manage_messages=True) - async def purgeuser(self, ctx, member: Option(discord.Member, "Select the Member", required=True), amount: Option(int, "Enter the number of messages to be purged", required=False)): + async def purgeuser(self, ctx, member: Option(discord.Member, "Select the Member", required=True), amount: Option(int, "Enter the number of messages to be purged(Default = 5)", required=False)): """๐Ÿงน Clears a certain amount of messages by a specific user""" if amount == None: amount = 5 diff --git a/cogs/olympus.py b/cogs/olympus.py index 4a05bdf..8b9cb97 100644 --- a/cogs/olympus.py +++ b/cogs/olympus.py @@ -1,5 +1,5 @@ import discord, datetime, time -from discord.commands.commands import slash_command +from discord import slash_command from discord.ext import commands import datetime import platform @@ -17,7 +17,7 @@ def __init__(self,bot): @slash_command() async def ping(self, ctx): """๐Ÿ“ Displays the Latency of the Bot""" - msg = await ctx.respond("Pinging bot\'s latency...") + await ctx.respond("Pinging bot\'s latency...") times = [] counter=0 embed = discord.Embed(title="More information:", description="Pinged 3 times and calculated the average.", color = ctx.author.color) @@ -82,11 +82,11 @@ async def about(self, ctx): pythonVersion = platform.python_version() pycVersion = discord.__version__ uptime = str(datetime.timedelta(seconds=int(round(time.time()-startTime)))) - embed=discord.Embed(title="About SPIKE", description=f"**Olympus** is an advanced discord bot, written in `Python` using the library named, `py-cord`.\n\n <:slash:910783011035963452> This bot is totally based on **Application Commands** AKA `/Slash commands` supporting other new discord features with it.\n\n <:badge:910783553694994453> The major features of the bot are `Moderation`, `Fun`, `Utility`, `Games`, etc. -based commands.\n\n <:users:910783496937668638> The bot is `user-friendly` too, to make it comfortable for everyone to get familiar with discord bots and stuff.", color=0x5de5c9) + embed=discord.Embed(title="About Olympus", description=f"**Olympus** is an advanced discord bot, written in `Python` using the library named, `py-cord`.\n\n <:slash:910783011035963452> This bot is totally based on **Application Commands** AKA `/Slash commands` supporting other new discord features with it.\n\n <:badge:910783553694994453> The major features of the bot are `Moderation`, `Fun`, `Utility`, `Games`, etc. -based commands.\n\n <:users:910783496937668638> The bot is `user-friendly` too, to make it comfortable for everyone to get familiar with discord bots and stuff.", color=0x5de5c9) embed.set_thumbnail(url=f'{ctx.me.avatar.url}') embed.add_field(name=f"__General Details__", value=f"**โฏ Bot:** Olympus#5983 (902555662964359228)\n **โฏ Created On:** 3rd November 2020, 1:41:38 PM IST\n **โฏ Uptime:** `{uptime}`\n **โฏ Developer:** `_TheKauchikG_#5300` (<@737903565313409095>)", inline=False) embed.add_field(name=f"__Front-end Stats__", value=f"**โฏ Servers:** {len(self.bot.guilds)}\n **โฏ Channels:** {len(set(self.bot.get_all_channels()))}\n **โฏ Users:** {len(set(self.bot.get_all_members()))}", inline=True) - embed.add_field(name=f"__Back-end Stats__", value=f"**โฏ Version:** [v1](https://github.com/TheKaushikGoswami/Olympus)\n **โฏ Python version:** [v{pythonVersion}](https://python.org)\n **โฏ py-cord version:** [v{pycVersion}](https://pycord.dev/)\n **โฏ Modules:** Total 15 modules", inline=False) + embed.add_field(name=f"__Back-end Stats__", value=f"**โฏ Version:** [v2.0](https://github.com/TheKaushikGoswami/Olympus/releases)\n **โฏ Python version:** [v{pythonVersion}](https://python.org)\n **โฏ py-cord version:** [v{pycVersion}](https://pycord.dev/)\n **โฏ Modules:** Total 15 modules", inline=False) embed.add_field(name="__Check Out:__", value=f'[Invite](https://discord.com/api/oauth2/authorize?client_id=902555662964359228&permissions=8&scope=bot%20applications.commands) โ€ข [Support](https://discord.gg/VYDq5AheEU) โ€ข [Github(Bot)](https://github.com/TheKaushikGoswami/Olympus) โ€ข [Github(Me)](https://github.com/TheKaushikGoswami)') embed.set_image(url=f"https://i.imgur.com/yPCP0qr.png") embed.set_footer(icon_url=f'{ctx.me.avatar.url}', text=f"Olympus is made with โค๏ธ | _TheKauchikG_#5300") diff --git a/cogs/owner.py b/cogs/owner.py index 86b239b..925e13e 100644 --- a/cogs/owner.py +++ b/cogs/owner.py @@ -104,6 +104,36 @@ async def leave_error(self, ctx, error): if isinstance(error, NotOwner): await ctx.respond(f"**<:Cross:902943066724388926> Hey! You lack permission to use this command as you don't own me!**") +# Rules + + @slash_command(guild_ids=[931474769797316638]) + @commands.is_owner() + async def rules(self, ctx): + """The Rules command for my Private Server""" + color = 0xa100f2 + embed = discord.Embed(color=color) + + embed.add_field(name='<:badge:910783553694994453> Rules! <:badge:910783553694994453>', value='**1.** Do not be racist, homophobic, or sexist, it can be overlooked if the other party is fine with it.\n\n' + '**2.** You are allowed to curse on someone as long as they do not mind. There are no barred curse words. If there are complaints on one\'s behavior then it may result in certain actions taken from the moderators.\n\n' + '**3.** You should not offend or antagonize other parties. You never know who the other party may be.\n\n' + '**4.** Spamming of texts, emojis, images, etc is strictly prohibited, if found out it may result in a permanent ban from the server.\n\n' + '**5.** The server does allow anything under the [Discord ToS](https://discord.com/terms) but it doesn\'t means that we won\'t take actions if the situation is necessary.\n\n', inline=False) + embed.add_field(name='โ€Žโ€Žโ€Žโ€โ€โ€Ž โ€Ž', value='**6.** Posts related to the information of another party, private messages, or pictures without their permission will be removed. This is a rigorous policy, may result in a permanent ban.\n\n' + '**7.** Moderators have final judgment on everything, if they ask you to stop doing something then stop. Do not complain if you have been kicked or banned from the server.\n\n' + '**8.** You are free to debate about anything, just don\'t force your beliefs on others.\n\n' + '**9.** There shouldn\'t be any bullying or bad behavior to new members.\n\n' + '**10.** There should not be any sharing of graphical or image posts related to violence, gore, and things that are against Discord ToS \n\n' + '**11.** All NSFW content under ToS are allowed, as long as they are NOT in Non-NSFW channels. This includes gifs, profile pictures, status,etc.\n\n' + '**12.** Self-advertising on main channels won\'t be tolerated, asking for roles, permissions, custom commands will result in warns from the moderators.', inline=False) + embed.set_footer(icon_url=ctx.author.avatar.url, text="React with Tick below If You read everything!") + await ctx.respond(embed=embed) + + @rules.error + async def rule_error(self, ctx, error): + print(type(error), "--- Rule Command") + if isinstance(error, NotOwner): + await ctx.respond(f"**<:Cross:902943066724388926> Hey! You lack permission to use this command as you don't own me!**", ephemeral=True) + def setup(bot): bot.add_cog(Owner(bot)) print("Owner cog is Loaded\n------") \ No newline at end of file diff --git a/cogs/utility.py b/cogs/utility.py index 7f487da..5983b2d 100644 --- a/cogs/utility.py +++ b/cogs/utility.py @@ -2,7 +2,7 @@ from discord.ext import commands from discord.commands import slash_command from discord.ext.commands.errors import MissingPermissions -from discord.commands.commands import slash_command, Option +from discord import slash_command, Option from ago import human import collections import discord.utils @@ -109,6 +109,7 @@ async def serverinfo(self, ctx): time = ctx.guild.created_at.strftime("%a, %#d %B %Y, %I:%M %p ") voice = str(len(guild.voice_channels)) text = str(len(guild.text_channels)) + verification_level = str(guild.verification_level).capitalize() statuses = collections.Counter( [member.status for member in guild.members]) @@ -125,10 +126,9 @@ async def serverinfo(self, ctx): embed.set_thumbnail(url=f"{self.me.avatar.url}") embed.set_author(name=f"Information for {ctx.guild.name}") embed.add_field(name="__General information__\n", value=f'**Server name : ** `{guild.name}`\n' - f'**Server region : ** `{guild.region}`\n' f'**Server ID : ** `{guild.id}`\n' f'**Created at : ** `{time}`\n' - f'**Verification level : ** `{guild.verification_level}`\n' + f'**Verification level : ** `{verification_level}`\n' f'**Server owner : ** <@{ctx.guild.owner_id}> \n', inline=False) embed.add_field(name="\n\n\n__Statistics__", value=f'**Member count : ** {ctx.guild.member_count}\n'