@@ -119,6 +119,7 @@ class Admin: | |||
;slowmode [time/"off"] | |||
seconds = number of seconds for the cooldown between messages a user has. | |||
off = turns off slowmode for this channel""" | |||
# TODO: Edit this when api is avalible for discord's new slowmode feature. | |||
if seconds == "off" and self.slow_mode: # Turn Slow Mode off | |||
self.slow_mode = False | |||
self.slow_mode_channels.pop(ctx.channel.id) | |||
@@ -138,6 +139,7 @@ class Admin: | |||
else: | |||
pass | |||
@commands.guild_only() | |||
@commands.has_permissions(manage_messages=True) | |||
@commands.bot_has_permissions(manage_messages=True, read_message_history=True) | |||
@commands.cooldown(1, 5) |
@@ -70,7 +70,7 @@ class JoinLeave(): | |||
colour=roxbot.EmbedColours.pink) | |||
em.set_thumbnail(url=member.avatar_url) | |||
channel = self.bot.get_channel(settings["greets"]["welcome-channel"]) | |||
channel = member.guild.get_channel(settings["greets"]["welcome-channel"]) | |||
return await channel.send(embed=em) | |||
async def on_member_remove(self, member): | |||
@@ -82,10 +82,11 @@ class JoinLeave(): | |||
if not settings["goodbyes"]["enabled"]: | |||
return | |||
else: | |||
channel = self.bot.get_channel(channel) | |||
channel = member.guild.get_channel(channel) | |||
return await channel.send(embed=discord.Embed( | |||
description="{}#{} has left or been beaned.".format(member.name, member.discriminator), colour=roxbot.EmbedColours.pink)) | |||
@commands.guild_only() | |||
@commands.has_permissions(manage_messages=True) | |||
@commands.command() | |||
async def greets(self, ctx, setting, channel: typing.Optional[discord.TextChannel] = None, *, text: str): | |||
@@ -116,7 +117,7 @@ class JoinLeave(): | |||
return await ctx.send("No valid option given.") | |||
return settings.update(greets, "greets") | |||
@commands.guild_only() | |||
@commands.has_permissions(manage_messages=True) | |||
@commands.command() | |||
async def goodbyes(self, ctx, setting, *, channel: typing.Optional[discord.TextChannel] = None): |
@@ -120,6 +120,7 @@ class NFSW(): | |||
post_url = "https://simg3.gelbooru.com/images/" | |||
return await ctx.invoke(self.gelbooru_clone, base_url=base_url, post_url=post_url, tags=tags) | |||
@commands.guild_only() | |||
@commands.has_permissions(manage_channels=True) | |||
@commands.command() | |||
async def nsfw(self, ctx, setting, *, changes=None): |
@@ -175,7 +175,7 @@ class Reddit: | |||
if ctx.invoked_with == "subreddit" and isinstance(ctx.channel, discord.TextChannel): | |||
# Only log the command when it is this command being used. Not the inbuilt commands. | |||
logging = guild_settings.get(ctx.guild)["logging"] | |||
log_channel = self.bot.get_channel(logging["channel"]) | |||
log_channel = ctx.guild.get_channel(logging["channel"]) | |||
await roxbot.log( | |||
ctx.guild, | |||
log_channel, |
@@ -50,8 +50,8 @@ class SelfAssign(): | |||
sa["roles"].remove(role.id) | |||
return settings.update(sa, "self_assign") | |||
@commands.has_permissions(manage_roles=True) | |||
@commands.guild_only() | |||
@commands.has_permissions(manage_roles=True) | |||
@commands.command(aliases=["sa"]) | |||
async def selfassign(self, ctx, setting, *, role: discord.Role): | |||
"""Edits settings for self assign cog. Requires Manage Roles permission. |
@@ -61,6 +61,7 @@ class Twitch(): | |||
return await channel.send(":video_game:** {} is live!** :video_game:\n{}\n{}".format( | |||
member_a.name, member_a.game.name, member_a.game.url)) | |||
@commands.guild_only() | |||
@commands.group(aliases=["wl"]) | |||
@commands.has_permissions(manage_channels=True) | |||
async def whitelist(self, ctx): | |||
@@ -116,6 +117,7 @@ class Twitch(): | |||
elif option == 'list': | |||
return await ctx.send(settings["twitch"]["whitelist"]["list"]) | |||
@commands.guild_only() | |||
@commands.has_permissions(manage_channels=True) | |||
@commands.command() | |||
async def twitch(self, ctx, setting, *, channel: discord.TextChannel = None): |
@@ -112,7 +112,7 @@ class NowPlayingEmbed(discord.Embed): | |||
Duration: {1} | |||
Queued by: {0.queued_by}""".format(now_playing, duration) | |||
image = np.thumbnail_url | |||
footer_text="{}/{} | Volume: {}%".format(time_played, duration, int(now_playing.volume * 100)) | |||
footer_text = "{}/{} | Volume: {}%".format(time_played, duration, int(now_playing.volume * 100)) | |||
return cls( | |||
title=title, | |||
url=np.webpage_url, | |||
@@ -497,6 +497,7 @@ class Voice: | |||
except AttributeError: | |||
raise commands.CommandError("I'm not playing anything.") | |||
@commands.guild_only() | |||
@commands.has_permissions(manage_channels=True) | |||
@commands.command() | |||
async def voice(self, ctx, setting=None, change=None): |