aboutsummaryrefslogtreecommitdiff
path: root/cogs
diff options
context:
space:
mode:
authorAnInternetTroll <lucafulger@gmail.com>2020-06-05 17:47:19 +0000
committerAnInternetTroll <lucafulger@gmail.com>2020-06-05 17:47:19 +0000
commitbfa568af62117bc7b55f13926d4c2802081002a6 (patch)
treef5a7cd98732b459bb74f65ac24fb031a2f12d308 /cogs
parent6580e4104f003bd6f22a0e833677c43ce8d942a0 (diff)
downloadsteve-bot-bfa568af62117bc7b55f13926d4c2802081002a6.tar
steve-bot-bfa568af62117bc7b55f13926d4c2802081002a6.tar.gz
steve-bot-bfa568af62117bc7b55f13926d4c2802081002a6.tar.bz2
steve-bot-bfa568af62117bc7b55f13926d4c2802081002a6.tar.lz
steve-bot-bfa568af62117bc7b55f13926d4c2802081002a6.tar.xz
steve-bot-bfa568af62117bc7b55f13926d4c2802081002a6.tar.zst
steve-bot-bfa568af62117bc7b55f13926d4c2802081002a6.zip
Added blacklist
Diffstat (limited to 'cogs')
-rw-r--r--[-rwxr-xr-x]cogs/admin.py35
-rw-r--r--[-rwxr-xr-x]cogs/general.py0
-rw-r--r--[-rwxr-xr-x]cogs/help.py0
-rw-r--r--[-rwxr-xr-x]cogs/player.py0
-rw-r--r--[-rwxr-xr-x]cogs/src.py0
-rw-r--r--[-rwxr-xr-x]cogs/trans.py0
-rw-r--r--[-rwxr-xr-x]cogs/utils.py40
7 files changed, 51 insertions, 24 deletions
diff --git a/cogs/admin.py b/cogs/admin.py
index 917a8de..3cb7ff8 100755..100644
--- a/cogs/admin.py
+++ b/cogs/admin.py
@@ -38,7 +38,7 @@ class Admin(commands.Cog):
async def setcommand(self, ctx, command, *, message):
self.bot.custom_commands[ctx.prefix + command] = message
with open('custom_commands.json', 'w') as f:
- json.dump(self.bot.custom_commands, f)
+ json.dump(self.bot.custom_commands, f, indent=4)
await ctx.send(f"Set message for command {command}")
@@ -47,7 +47,7 @@ class Admin(commands.Cog):
async def removecommand(self, ctx, command):
del self.bot.custom_commands[ctx.prefix + command]
with open('custom_commands.json', 'w') as f:
- json.dump(self.bot.custom_commands, f)
+ json.dump(self.bot.custom_commands, f, indent=4)
await ctx.send(f"Removed command {command}")
@@ -99,7 +99,7 @@ class Admin(commands.Cog):
await ctx.send(f'The extension {ext} doesn\'t have an entry point (try adding the setup function)')
except commands.ExtensionFailed:
await ctx.send(f'Some unknown error happened while trying to reload extension {ext} (check logs)')
- self.bot.logger.exception(f'Failed to reload extension {ext}:')
+ self.bot.logger.exception(f'Failed to unload extension {ext}:')
"""
@commands.command()
@@ -122,7 +122,7 @@ class Admin(commands.Cog):
@commands.check(is_mod)
@commands.command()
- async def mute(self, ctx, members: commands.Greedy[discord.Member],
+ async def mute(self, ctx, members: commands.Greedy[discord.Member]=False,
mute_minutes: int = 0,
*, reason: str = "absolutely no reason"):
"""Mass mute members with an optional mute_minutes parameter to time it"""
@@ -130,6 +130,8 @@ class Admin(commands.Cog):
if not members:
await ctx.send("You need to name someone to mute")
return
+ elif type(members)=="str":
+ members = self.bot.get_user(int(user))
#muted_role = discord.utils.find(ctx.guild.roles, name="Muted")
muted_role = ctx.guild.get_role(707707894694412371)
@@ -149,6 +151,12 @@ class Admin(commands.Cog):
@commands.check(is_mod)
@commands.command()
async def unmute(self, ctx, members: commands.Greedy[discord.Member]):
+ if not members:
+ await ctx.send("You need to name someone to unmute")
+ return
+ elif type(members)=="str":
+ members = self.bot.get_user(int(user))
+
muted_role = ctx.guild.get_role(707707894694412371)
for i in members:
await i.remove_roles(muted_role)
@@ -162,6 +170,25 @@ class Admin(commands.Cog):
file = discord.File("discord.log")
await ctx.send(file=file)
+ @commands.command(aliases=['ban'], hidden=True)
+ @commands.check(is_mod)
+ async def blacklist(self, ctx, members: commands.Greedy[discord.Member]=None):
+ if not members:
+ await ctx.send("You need to name someone to blacklist")
+ return
+ elif type(members)=="str":
+ members = self.bot.get_user(int(user))
+
+ with open('blacklist.json', 'w') as f:
+ for i in members:
+ if i.id in self.bot.blacklist:
+ self.bot.blacklist.remove(i.id)
+ json.dump(self.bot.blacklist, f, indent=4)
+ await ctx.send(f"{i} has been un-blacklisted.")
+ else:
+ self.bot.blacklist.append(i.id)
+ json.dump(self.bot.blacklist, f, indent=4)
+ await ctx.send(f"{i} has been blacklisted.")
def setup(bot):
diff --git a/cogs/general.py b/cogs/general.py
index ff60bb7..ff60bb7 100755..100644
--- a/cogs/general.py
+++ b/cogs/general.py
diff --git a/cogs/help.py b/cogs/help.py
index 91c9c45..91c9c45 100755..100644
--- a/cogs/help.py
+++ b/cogs/help.py
diff --git a/cogs/player.py b/cogs/player.py
index 5c046a7..5c046a7 100755..100644
--- a/cogs/player.py
+++ b/cogs/player.py
diff --git a/cogs/src.py b/cogs/src.py
index 96bf53c..96bf53c 100755..100644
--- a/cogs/src.py
+++ b/cogs/src.py
diff --git a/cogs/trans.py b/cogs/trans.py
index 2c6ed71..2c6ed71 100755..100644
--- a/cogs/trans.py
+++ b/cogs/trans.py
diff --git a/cogs/utils.py b/cogs/utils.py
index 3e199da..e9943ee 100755..100644
--- a/cogs/utils.py
+++ b/cogs/utils.py
@@ -18,11 +18,11 @@ from PIL import Image
from PIL import ImageFilter
def set_viewport_size(driver, width, height):
- window_size = driver.execute_script("""
- return [window.outerWidth - window.innerWidth + arguments[0],
- window.outerHeight - window.innerHeight + arguments[1]];
- """, width, height)
- driver.set_window_size(*window_size)
+ window_size = driver.execute_script("""
+ return [window.outerWidth - window.innerWidth + arguments[0],
+ window.outerHeight - window.innerHeight + arguments[1]];
+ """, width, height)
+ driver.set_window_size(*window_size)
async def reportStuff(self, ctx, message):
channel = self.bot.get_channel(715549209998262322)
@@ -54,9 +54,9 @@ class Utils(commands.Cog):
# Don't ask
rigged_findseed = {
- 280428276810383370: 12, # Thomas's User ID
- 199070670221475842: -1, # Kai's User ID
- 615658069132836865: -12 # They didn't use a real name. Sad!
+ 280428276810383370: 12, # Thomas's User ID
+ 199070670221475842: -1, # Kai's User ID
+ 615658069132836865: -12 # They didn't use a real name. Sad!
}
if ctx.author.id in rigged_findseed:
@@ -252,18 +252,18 @@ class Utils(commands.Cog):
@commands.command()
async def someone(self, ctx):
- blacklist = [536071288859656193]
- if ctx.channel.id != 589110766578434078:
- if ctx.author.id == 395872198323077121:
- await ctx.send("grape is a bitch")
- elif ctx.author.id == 521153476714299402:
- await ctx.send("ZMG is smooth brain")
- elif ctx.author.id == 199070670221475842:
- await ctx.send("fuck you @kaii#0408")
- elif ctx.author.id in blacklist:
- await ctx.send("not even bothering with a message for you. You're just an edgy sheep")
- else:
- await ctx.send(choice(ctx.guild.members).mention)
+ blacklist = [536071288859656193]
+ if ctx.channel.id != 589110766578434078:
+ if ctx.author.id == 395872198323077121:
+ await ctx.send("grape is a bitch")
+ elif ctx.author.id == 521153476714299402:
+ await ctx.send("ZMG is smooth brain")
+ elif ctx.author.id == 199070670221475842:
+ await ctx.send(f"fuck you {ctx.message.author.mention}")
+ elif ctx.author.id in blacklist:
+ await ctx.send("not even bothering with a message for you. You're just an edgy sheep")
+ else:
+ await ctx.send(choice(ctx.guild.members).mention)
@commands.command()
async def roll(self, ctx, pool):