Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Commit

Permalink
Implement #22 (#24)
Browse files Browse the repository at this point in the history
* Added nuke_emojis cmd

* Added auto-updater

* Emoji nuke

* Added random full name cmd. Using load dotenv

* Added .env to gitignore

* Create codeql-analysis.yml

* Create codacy-analysis.yml

* Create LICENSE

* Added poetry stuff

* Improved auto update and added owner cog

* Added owner cog

* Update issue templates

* Update feature_request.md

* Added brief and description for all commands

* Fixed last typos
  • Loading branch information
AnonymousDebug authored Feb 22, 2022
1 parent be1e38c commit df1ae00
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 25 deletions.
6 changes: 0 additions & 6 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ async def on_ready():
print(f"----------\nLogged in as {bot.user.name}({bot.user.id})\n----------")


@bot.command()
@commands.is_owner()
async def shutdown(ctx):
print("Shutting down bot...")
await bot.close()

for file in os.listdir("./cogs"):
if file.endswith(".py"):
name = file[:-3]
Expand Down
6 changes: 3 additions & 3 deletions cogs/fun.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class Fun(commands.Cog):
def __init__(self, bot):
self.bot = bot

@commands.command()
async def joke(self, ctx):
@commands.command(brief="Joke Of The Day", description="Joke Of The Day")
async def jotd(self, ctx):
url = 'https://api.jokes.one/jod?category=knock-knock'
api_token = None
headers = {'content-type': 'application/json',
Expand All @@ -28,7 +28,7 @@ async def joke(self, ctx):
""")
await ctx.send(embed=embed)

@commands.command()
@commands.command(brief="Generate random fullname", description="Generate random fullname")
async def randfname(self, ctx, quantity = 1):
headers = {
'accept': '*/*',
Expand Down
6 changes: 3 additions & 3 deletions cogs/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ class Info(commands.Cog):
def __init__(self, bot):
self.bot = bot

@commands.command()
@commands.command(brief="Latency of bot", description="Latency of bot")
async def ping(self, ctx):
await ctx.send(f'Pong! {round (self.bot.latency * 1000)} ms')

@commands.command()
@commands.command(brief="Information about a user", description="Information about a user")
async def userinfo(self, ctx, member: nextcord.Member):
embed = nextcord.Embed(title = f"UserInfo of {member}")
embed.set_author(name = "Pengoon", url=nextcord.Embed.Empty, icon_url=self.bot.user.display_avatar)
Expand Down Expand Up @@ -48,7 +48,7 @@ async def userinfo(self, ctx, member: nextcord.Member):
await ctx.send(embed=embed)


@commands.command()
@commands.command(brief="Say hello and tell the prefix", description="Say hello and tell the prefix")
async def sayhi(self, ctx):
await ctx.send(f"Hello {ctx.author.mention}! My prefix is '-'.")

Expand Down
26 changes: 13 additions & 13 deletions cogs/mod.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Mod(commands.Cog):
def __init__(self, bot):
self.bot = bot

@commands.command(pass_context=True)
@commands.command(brief="Add role to a user", description="Add role to a user")
@commands.has_permissions(manage_roles=True)
async def addrole(self, ctx, member: nextcord.Member, roles: nextcord.Role):
await member.add_roles(roles)
Expand All @@ -28,7 +28,7 @@ async def addrole_error(self, ctx, error):
else:
await ctx.send("Adding role Failed")

@commands.command(pass_context=True)
@commands.command(brief="Remove role from a user", description="Remove role from a user")
@commands.has_permissions(manage_roles=True)
async def rmrole(self, ctx, member: nextcord.Member, roles: nextcord.Role):
await member.remove_roles(roles)
Expand All @@ -47,7 +47,7 @@ async def rmrole_error(self, ctx, error):
else:
await ctx.send("Removing role Failed")

@commands.command(pass_context=True)
@commands.command(brief="Mute a user", description="Mute a user")
@commands.has_permissions(manage_messages=True)
async def mute(self, ctx, member : nextcord.Member,*, reason=None):
guild = ctx.author.guild
Expand Down Expand Up @@ -82,7 +82,7 @@ async def mute_error(self, ctx, error):
else:
await ctx.send(f"Mute failed: {error}")

@commands.command()
@commands.command(brief="Unmute a user", description="Unmute a user")
@commands.has_permissions(manage_messages=True)
async def unmute(self, ctx, user: nextcord.Member, *, reason=None):
await user.remove_roles(nextcord.utils.get(ctx.guild.roles, name="Muted"))
Expand All @@ -95,7 +95,7 @@ async def unmute_error(self, ext, error):
else:
await ctx.send(f"Unmute failed: {error}")

@commands.command(pass_context=True)
@commands.command(brief="Mute a user in voice channel", description="Mute a user in voice channel")
@commands.has_guild_permissions(mute_members=True)
async def vcmute(self, ctx, member : nextcord.Member, *, reason=None):
await member.edit(mute = True)
Expand All @@ -112,7 +112,7 @@ async def vcmute_error(self, ctx, error):
else:
await ctx.send(f"Voice-mute failed: {error}")

@commands.command(pass_context=True)
@commands.command(brief="Unmute a user in voice channel", description="Unmute a user in voice channel")
@commands.has_guild_permissions(mute_members=True)
async def vcunmute(self, ctx, member : nextcord.Member, *, reason=None):
await member.edit(mute = False)
Expand All @@ -129,7 +129,7 @@ async def vcunmute_error(self, ctx, error):
else:
await ctx.send(f"Voice unmute failed: {error}")

@commands.command(pass_context=True)
@commands.command(brief="Kick a user from guild", description="Kick a user from guild")
@commands.has_permissions(kick_members=True)
async def kick(self, ctx, member: nextcord.Member, *, reason=None):
await ctx.guild.kick(user=member, reason=reason)
Expand All @@ -148,7 +148,7 @@ async def kick_error(self, ctx, error):
else:
await ctx.send("Kick Failed")

@commands.command(pass_context=True)
@commands.command(brief="Ban a user from guild", description="Ban a user from guild")
@commands.has_permissions(ban_members=True)
async def ban(self, ctx, member : nextcord.Member, *, reason=None):
await member.ban(reason=reason)
Expand All @@ -167,7 +167,7 @@ async def ban_error(self, ctx, error):
else:
await ctx.send("Ban Failed")

@commands.command(pass_context=True)
@commands.command(brief="Unban a user from guild", description="Unban a user from guild")
@commands.has_permissions(ban_members=True)
async def unban(self, ctx, *, member, reason=None):
banned_users = await ctx.guild.bans()
Expand All @@ -193,7 +193,7 @@ async def unban_error(self, ctx, error):
else:
await ctx.send("Unban Failed")

@commands.command(pass_context=True)
@commands.command(brief="Lock a channel", description="Lock a channel. Noone without special permission can chat in a locked channel")
@commands.has_permissions(manage_messages=True)
async def lock(self, ctx, channel : nextcord.TextChannel = None):
channel = channel or ctx.channel
Expand All @@ -210,7 +210,7 @@ async def lock_error(self, ctx, error):
if isinstance(error, commands.errors.MissingPermissions):
await ctx.send("You are missing Manage Messages permission(s) to run this command.")

@commands.command(pass_context=True)
@commands.command(brief="Unlock a channel", description="Unlock a channel")
@commands.has_permissions(manage_messages=True)
async def unlock(self, ctx, channel : nextcord.TextChannel = None):
channel = channel or ctx.channel
Expand All @@ -228,7 +228,7 @@ async def unlock_error(self, ctx, error):
await ctx.send("You are missing Manage Messages permission(s) to run this command.")


@commands.command()
@commands.command(brief="Delete messages in a channel", description="Delete a certian amount of messages in a channel")
@commands.has_permissions(manage_messages=True)
async def purge(self, ctx, *, limit : int):
try:
Expand All @@ -242,7 +242,7 @@ async def purge_error(self, ctx, error):
if isinstance(error, commands.errors.MissingPermissions):
await ctx.send("You do not have enough permissions (Manage Messages) to do that")

@commands.command()
@commands.command(brief="Change a channel's slowmode setting", description="Use the command without any args to disable slowmode")
@commands.guild_only()
@commands.bot_has_permissions(manage_channels=True)
async def slowmode(self, ctx, interval: int = 0, unit = "s"):
Expand Down

0 comments on commit df1ae00

Please sign in to comment.