aboutsummaryrefslogtreecommitdiff
path: root/cogs
diff options
context:
space:
mode:
authorziro <palembani@gmail.com>2020-08-05 06:09:20 +0000
committerziro <palembani@gmail.com>2020-08-05 06:09:20 +0000
commit8b9eb356e8a81d9b7eba8268a5e3bafbbe355ca0 (patch)
treea296f5f5e47568eba668743714389c70f116ca0e /cogs
parentf7b54808be04d550283de15faf31a53f364e5de6 (diff)
downloadsteve-bot-8b9eb356e8a81d9b7eba8268a5e3bafbbe355ca0.tar
steve-bot-8b9eb356e8a81d9b7eba8268a5e3bafbbe355ca0.tar.gz
steve-bot-8b9eb356e8a81d9b7eba8268a5e3bafbbe355ca0.tar.bz2
steve-bot-8b9eb356e8a81d9b7eba8268a5e3bafbbe355ca0.tar.lz
steve-bot-8b9eb356e8a81d9b7eba8268a5e3bafbbe355ca0.tar.xz
steve-bot-8b9eb356e8a81d9b7eba8268a5e3bafbbe355ca0.tar.zst
steve-bot-8b9eb356e8a81d9b7eba8268a5e3bafbbe355ca0.zip
+ Cleaning Up & Added Warning if bot doesn't have certain perm
Diffstat (limited to 'cogs')
-rw-r--r--cogs/general.py8
-rw-r--r--cogs/moderator.py18
-rw-r--r--cogs/util.py4
-rw-r--r--cogs/welcome.py10
4 files changed, 19 insertions, 21 deletions
diff --git a/cogs/general.py b/cogs/general.py
index 68caf54..45f8e0f 100644
--- a/cogs/general.py
+++ b/cogs/general.py
@@ -6,13 +6,13 @@ class General(commands.Cog):
def __init__(self, bot):
self.bot = bot
- @commands.command(aliases=['add'])
- async def _add(self, ctx):
+ @commands.command()
+ async def add(self, ctx):
oauth_link = "https://discord.com/oauth2/authorize?client_id=740122842988937286&scope=bot"
await ctx.send(f"To add ziBot to your server, click here: \n {oauth_link}")
- @commands.command(aliases=['source'])
- async def sauce(self, ctx):
+ @commands.command()
+ async def source(self, ctx):
git_link = "https://github.com/null2264/ziBot"
await ctx.send(f"ziBot's Source Code: \n {git_link}")
diff --git a/cogs/moderator.py b/cogs/moderator.py
index 15e9d18..b0808a1 100644
--- a/cogs/moderator.py
+++ b/cogs/moderator.py
@@ -8,13 +8,13 @@ class Admin(commands.Cog):
@commands.command(aliases=['quit'], hidden=True)
@commands.has_any_role("Server Moderator","Zi")
- async def force_exit(self, ctx):
+ async def force_close(self, ctx):
await ctx.send("Self Destructing!")
await ctx.bot.close()
- @commands.command(aliases=['unload'], hidden=True)
+ @commands.command(hidden=True)
@commands.has_any_role("Server Moderator","Zi")
- async def _unload(self, ctx, ext):
+ async def unload(self, ctx, ext):
await ctx.send(f"Unloading {ext}...")
try:
self.bot.unload_extension(f'cogs.{ext}')
@@ -26,9 +26,9 @@ class Admin(commands.Cog):
except commands.ExtensionFailed:
await ctx.send(f"{ext} failed to unload!")
- @commands.command(aliases=['reload'], hidden=True)
+ @commands.command(hidden=True)
@commands.has_any_role("Server Moderator","Zi")
- async def _reload(self, ctx, ext):
+ async def reload(self, ctx, ext):
await ctx.send(f"Reloading {ext}...")
try:
self.bot.reload_extension(f'cogs.{ext}')
@@ -40,9 +40,9 @@ class Admin(commands.Cog):
except commands.ExtensionFailed:
await ctx.send(f"{ext} failed to reload!")
- @commands.command(aliases=['load'], hidden=True)
+ @commands.command(hidden=True)
@commands.has_any_role("Server Moderator","Zi")
- async def _load(self, ctx, ext):
+ async def load(self, ctx, ext):
await ctx.send(f"Loading {ext}...")
try:
self.bot.load_extension(f"cogs.{ext}")
@@ -52,9 +52,9 @@ class Admin(commands.Cog):
except commands.ExtensionFailed:
await ctx.send(f"{ext} failed to load!")
- @commands.command(aliases=['clearchat'], hidden=True)
+ @commands.command(aliases=['cc'], hidden=True)
@commands.has_any_role("Server Moderator","Zi")
- async def _clearchat(self, ctx, numb: int=50):
+ async def clearchat(self, ctx, numb: int=50):
deleted_msg = await ctx.message.channel.purge(limit=int(numb)+1, check=None, before=None, after=None, around=None, oldest_first=False, bulk=True)
msg_num = max(len(deleted_msg) - 1, 0)
diff --git a/cogs/util.py b/cogs/util.py
index e0566d0..3b87d0b 100644
--- a/cogs/util.py
+++ b/cogs/util.py
@@ -6,8 +6,8 @@ class Util(commands.Cog):
def __init__(self, bot):
self.bot = bot
- @commands.command(aliases=['ping'])
- async def _ping(self, ctx):
+ @commands.command()
+ async def ping(self, ctx):
await ctx.send(f'Pong! {round(self.bot.latency*1000)}ms')
def setup(bot):
diff --git a/cogs/welcome.py b/cogs/welcome.py
index 6db5a18..4cfa7fd 100644
--- a/cogs/welcome.py
+++ b/cogs/welcome.py
@@ -13,13 +13,11 @@ class Welcome(commands.Cog):
server = member.guild
welcome_channel = self.bot.get_channel(740051039499059271)
member_role = discord.utils.get(member.guild.roles, name="Member")
- await member.add_roles(member_role)
+ try:
+ await member.add_roles(member_role)
+ except discord.Forbidden:
+ print("Add manage roles perm to the bot!")
await welcome_channel.send(f"Welcome {member.mention}, to {server.name}! <:PogChamp:740102448047194152>")
- @commands.command(aliases=['test'])
- async def _test(self, ctx):
- welcome_channel = self.bot.get_channel(740051039499059271)
- await welcome_channel.send("test")
-
def setup(bot):
bot.add_cog(Welcome(bot))