aboutsummaryrefslogtreecommitdiff
path: root/cogs
diff options
context:
space:
mode:
Diffstat (limited to 'cogs')
-rw-r--r--cogs/admin.py27
-rw-r--r--cogs/general.py2
-rw-r--r--cogs/logs.py4
-rw-r--r--cogs/utils.py17
4 files changed, 36 insertions, 14 deletions
diff --git a/cogs/admin.py b/cogs/admin.py
index d722390..13cb75b 100644
--- a/cogs/admin.py
+++ b/cogs/admin.py
@@ -134,7 +134,7 @@ class Admin(commands.Cog):
members = self.bot.get_user(int(user))
#muted_role = discord.utils.find(ctx.guild.roles, name="Muted")
- muted_role = ctx.guild.get_role(707707894694412371)
+ muted_role = ctx.guild.get_role(self.bot.config[str(ctx.message.guild.id)]["mute_role"])
for member in members:
if self.bot.user == member: # what good is a muted bot?
embed = discord.Embed(title = "You can't mute me, I'm an almighty bot")
@@ -157,7 +157,7 @@ class Admin(commands.Cog):
elif type(members)=="str":
members = self.bot.get_user(int(user))
- muted_role = ctx.guild.get_role(707707894694412371)
+ muted_role = ctx.guild.get_role(self.bot.config[str(ctx.message.guild.id)]["mute_role"])
for i in members:
await i.remove_roles(muted_role)
await ctx.send("{0.mention} has been unmuted by {1.mention}".format(i, ctx.author))
@@ -190,6 +190,29 @@ class Admin(commands.Cog):
json.dump(self.bot.blacklist, f, indent=4)
await ctx.send(f"{i} has been blacklisted.")
+ @commands.check(is_mod)
+ @commands.command()
+ async def activity(self, ctx,*, activity=None):
+ if activity:
+ game = discord.Game(activity)
+ else:
+ activity = "Mining away"
+ game = discord.Game(activity)
+ await self.bot.change_presence(activity=game)
+ await ctx.send(f"Activity changed to {activity}")
+
+ @commands.check(is_mod)
+ @commands.command()
+ async def setvar(self, ctx, key, *, value):
+ with open('config.json', 'w') as f:
+ self.bot.config[str(ctx.message.guild.id)][key] = value
+ json.dump(self.bot.config, f, indent=4)
+
+ @commands.check(is_mod)
+ @commands.command()
+ async def printvar(self, ctx, key):
+ await ctx.send(self.bot.config[str(ctx.message.guild.id)][key])
+
def setup(bot):
bot.add_cog(Admin(bot))
diff --git a/cogs/general.py b/cogs/general.py
index 2e25410..0847cd4 100644
--- a/cogs/general.py
+++ b/cogs/general.py
@@ -50,7 +50,7 @@ class General(commands.Cog):
else:
user = self.bot.get_user(int(user))
- coop_role = ctx.guild.get_role(694261282861219952)
+ coop_role = ctx.guild.get_role(int(self.bot.config[str(ctx.message.guild.id)]["coop_roleID"]))
if coop_role in user.roles:
await user.remove_roles(coop_role)
diff --git a/cogs/logs.py b/cogs/logs.py
index d6889eb..8230ccc 100644
--- a/cogs/logs.py
+++ b/cogs/logs.py
@@ -17,7 +17,7 @@ class Logs(commands.Cog):
color = 16777210
else:
color = message.author.color
- channel = self.bot.get_channel(718187032869994686)
+ channel = self.bot.get_channel(int(self.bot.config[str(message.guild.id)]["logs_channel"]))
embed = discord.Embed(
title='Deleted Message',
color=color,
@@ -34,7 +34,7 @@ class Logs(commands.Cog):
async def on_message_edit(self, before, after):
if after.guild.id != 574267523869179904:
return
- channel = self.bot.get_channel(718187032869994686)
+ channel = self.bot.get_channel(int(self.bot.config[str(before.guild.id)]["logs_channel"]))
if before.author.color.value == 0:
color = 16777210
else:
diff --git a/cogs/utils.py b/cogs/utils.py
index c708e54..1deab42 100644
--- a/cogs/utils.py
+++ b/cogs/utils.py
@@ -25,7 +25,7 @@ def set_viewport_size(driver, width, height):
driver.set_window_size(*window_size)
async def reportStuff(self, ctx, message):
- channel = self.bot.get_channel(715549209998262322)
+ channel = self.bot.get_channel(self.bot.config[str(ctx.message.guild.id)]["report_channel"])
embed = discord.Embed(
title=f"Report from {ctx.message.author}",
@@ -48,7 +48,7 @@ class Utils(commands.Cog):
@commands.cooldown(1, 25, commands.BucketType.guild)
@commands.command()
async def findseed(self, ctx):
- if ctx.message.channel.id != 684787316489060422:
+ if ctx.message.channel.id != int(self.bot.config[str(ctx.message.guild.id)]["bot_channel"]):
await ctx.message.delete()
return
@@ -67,13 +67,12 @@ class Utils(commands.Cog):
randomness = randint(1, 10)
if randomness <= 1:
totalEyes += 1
- discname = ctx.message.author.name.replace("@", "@ ")
- await ctx.send(f"{discname} -> your seed is a {totalEyes} eye")
+ await ctx.send(f"{discord.utils.escape_mentions(ctx.message.author.display_name)} -> your seed is a {totalEyes} eye")
@findseed.error
async def findseed_handler(self,ctx,error):
if isinstance(error, commands.CommandOnCooldown):
- if ctx.message.channel.id != 684787316489060422:
+ if ctx.message.channel.id != int(self.bot.config[str(ctx.message.guild.id)]["bot_channel"]):
await ctx.message.delete()
return
else:
@@ -82,7 +81,7 @@ class Utils(commands.Cog):
@commands.command()
async def findsleep(self, ctx):
- if ctx.message.channel.id != 684787316489060422:
+ if ctx.message.channel.id != int(self.bot.config[str(ctx.message.guild.id)]["bot_channel"]):
await ctx.message.delete()
return
@@ -102,7 +101,7 @@ class Utils(commands.Cog):
]
# Set up initial message
- msg = f"{ctx.message.author.name} -> "
+ msg = f"{discord.utils.escape_mentions(ctx.message.author.display_name)} -> "
# Optional TODO: Create non-normal distribution
sleepHrs = randint(0, 24)
@@ -125,7 +124,7 @@ class Utils(commands.Cog):
@commands.Cog.listener()
async def on_message(self, message):
- if message.channel.id != 589110766578434078:
+ if message.channel.id != int(self.bot.config[str(message.guild.id)]["fair_channel"]):
return
if message.author.bot:
return
@@ -296,7 +295,7 @@ class Utils(commands.Cog):
@commands.command()
async def someone(self, ctx):
blacklist = [536071288859656193]
- if ctx.channel.id != 589110766578434078:
+ if ctx.channel.id != int(self.bot.config[str(ctx.message.guild.id)]["fair_channel"]):
if ctx.author.id == 395872198323077121:
await ctx.send("grape is a bitch")
elif ctx.author.id == 521153476714299402: