## Changelog | ## Changelog | ||||
#### v1.3.2 | |||||
###### Bug Fixes | |||||
- Fixed logging for gss cog again... | |||||
#### v1.3.1 | |||||
###### Bug Fixes | |||||
- Fixed logging for gss cog. | |||||
#### v1.3.0 | #### v1.3.0 | ||||
###### New Features | ###### New Features | ||||
- New Admin Cog with warning and slowmode commands. | - New Admin Cog with warning and slowmode commands. | ||||
- NSFW channels can now be added to selectively enable Roxbot's NSFW features. | - NSFW channels can now be added to selectively enable Roxbot's NSFW features. | ||||
- New checks for the suck and spank commands so that they too can be disabled on a channel basis. | - New checks for the suck and spank commands so that they too can be disabled on a channel basis. | ||||
######Bug FIxes | |||||
###### Bug Fixes | |||||
- Fixed bug where Custom Commands would ignore the blacklist. | - Fixed bug where Custom Commands would ignore the blacklist. | ||||
- Fixed issue where custom command outputs were always lowercase | - Fixed issue where custom command outputs were always lowercase | ||||
- Fixed some naughty swears that were placeholders for a more civilised response. | - Fixed some naughty swears that were placeholders for a more civilised response. | ||||
## Licence | ## Licence | ||||
[MIT Licence](https://github.com/RainbowDinoaur/roxbot/blob/master/LICENSE.md) | |||||
[MIT Licence](https://github.com/RainbowRoxxers/roxbot/blob/master/LICENSE) |
elif nsfw["enabled"] and nsfw["channels"]: | elif nsfw["enabled"] and nsfw["channels"]: | ||||
return ctx.message.channel.id in nsfw["channels"] | return ctx.message.channel.id in nsfw["channels"] | ||||
else: | else: | ||||
print("yo") | |||||
return False | return False | ||||
def is_nfsw_enabled(): | def is_nfsw_enabled(): | ||||
return commands.check(lambda ctx: nsfw_predicate(ctx)) | return commands.check(lambda ctx: nsfw_predicate(ctx)) | ||||
def is_anal(): | |||||
return commands.check(lambda ctx: ServerConfig().load_config()[ctx.message.server.id]["is_anal"]["y/n"]) | |||||
def isnt_anal(): | |||||
return commands.check(lambda ctx: ServerConfig().load_config()[ctx.message.server.id]["is_anal"]["y/n"] and nsfw_predicate(ctx) or not ServerConfig().load_config()[ctx.message.server.id]["is_anal"]["y/n"]) | |||||
def not_pm(): | def not_pm(): | ||||
return commands.check(lambda ctx: ctx.message.channel.type != discord.ChannelType.private) | return commands.check(lambda ctx: ctx.message.channel.type != discord.ChannelType.private) |
@warn.command(pass_context=True) | @warn.command(pass_context=True) | ||||
async def list(self, ctx, user: discord.User = None): | |||||
async def list(self, ctx, *, user: discord.User = None): | |||||
await self.bot.send_typing(ctx.message.channel) | await self.bot.send_typing(ctx.message.channel) | ||||
if user == None: | |||||
output = "" | |||||
for user in self.servers[ctx.message.server.id]["warnings"]: | |||||
user_obj = await self.bot.get_user_info(user) | |||||
output += "{}#{}: {} Warning(s)\n".format(user_obj.name, user_obj.discriminator, len(self.servers[ctx.message.server.id]["warnings"][user])) | |||||
return await self.bot.say(output) | |||||
if not user.id in self.servers[ctx.message.server.id]["warnings"]: | if not user.id in self.servers[ctx.message.server.id]["warnings"]: | ||||
return await self.bot.say("This user doesn't have any warning on record.") | return await self.bot.say("This user doesn't have any warning on record.") | ||||
em = discord.Embed(title="Warnings for {}".format(user.name+"#"+user.discriminator), colour=0XDEADBF) | em = discord.Embed(title="Warnings for {}".format(user.name+"#"+user.discriminator), colour=0XDEADBF) |
roll = random.randrange(step, dice + 1, step) | roll = random.randrange(step, dice + 1, step) | ||||
return await self.bot.say("{} rolled a **{}**".format(ctx.message.author.mention, roll)) | return await self.bot.say("{} rolled a **{}**".format(ctx.message.author.mention, roll)) | ||||
@checks.is_anal() | |||||
@checks.isnt_anal() | |||||
@bot.command(pass_context=True) | @bot.command(pass_context=True) | ||||
async def spank(self, ctx, *, user: discord.User = None): | async def spank(self, ctx, *, user: discord.User = None): | ||||
""" | """ | ||||
return await self.bot.say("You didn't mention someone for me to spank") | return await self.bot.say("You didn't mention someone for me to spank") | ||||
return await self.bot.say(":peach: :wave: *{} spanks {}*".format(self.bot.user.name, user.name)) | return await self.bot.say(":peach: :wave: *{} spanks {}*".format(self.bot.user.name, user.name)) | ||||
@checks.is_anal() | |||||
@checks.isnt_anal() | |||||
@bot.command(pass_context=True, aliases=["succ"]) | @bot.command(pass_context=True, aliases=["succ"]) | ||||
async def suck(self, ctx, *, user: discord.User = None): | async def suck(self, ctx, *, user: discord.User = None): | ||||
""" | """ |
if self.selfie_role in member.roles: | if self.selfie_role in member.roles: | ||||
await self.bot.remove_roles(member, self.selfie_role) | await self.bot.remove_roles(member, self.selfie_role) | ||||
if logging: | |||||
await self.bot.send_message(self.bot.get_channel(logging), content="{} has removed the {} role.".format(member.mention, self.nsfw_image_role.name)) | |||||
return await self.bot.say("You already had {}. It has now been removed.".format(self.selfie_role.name)) | return await self.bot.say("You already had {}. It has now been removed.".format(self.selfie_role.name)) | ||||
time = datetime.datetime.now() - ctx.message.author.joined_at | time = datetime.datetime.now() - ctx.message.author.joined_at | ||||
if self.nsfw_image_role in member.roles: | if self.nsfw_image_role in member.roles: | ||||
await self.bot.remove_roles(member, self.nsfw_image_role) | await self.bot.remove_roles(member, self.nsfw_image_role) | ||||
if logging: | |||||
await self.bot.send_message(self.bot.get_channel(logging), content="{} has removed the {} role.".format(member.mention, self.nsfw_image_role.name)) | |||||
return await self.bot.say("You already had {}. It has now been removed.".format(self.nsfw_image_role.name)) | return await self.bot.say("You already had {}. It has now been removed.".format(self.nsfw_image_role.name)) | ||||
time = datetime.datetime.now() - ctx.message.author.joined_at | time = datetime.datetime.now() - ctx.message.author.joined_at | ||||
await self.bot.add_roles(member, self.nsfw_image_role) | await self.bot.add_roles(member, self.nsfw_image_role) | ||||
await self.bot.say("You have now have the {} role".format(self.nsfw_image_role.name)) | await self.bot.say("You have now have the {} role".format(self.nsfw_image_role.name)) | ||||
if logging: | if logging: | ||||
return await self.bot.send_message(self.bot.get_channel(logging), content="{} has requested the {} role.".format(member.mention, self.nsfw_image_role.name)) | |||||
return await self.bot.send_message(self.bot.get_channel(logging), content="{} has given themselves the {} role.".format(member.mention, self.nsfw_image_role.name)) | |||||
else: | else: | ||||
return await self.bot.say( | return await self.bot.say( | ||||
"You do not meet the requirements for this role. You need at least {} score with <@!172002275412279296> and to have been in the server for {} days.".format(required_score, days) | "You do not meet the requirements for this role. You need at least {} score with <@!172002275412279296> and to have been in the server for {} days.".format(required_score, days) |
for x in range(10): | for x in range(10): | ||||
choice = random.choice(links) | choice = random.choice(links) | ||||
title = "**{}** from /r/{}\n".format(choice["data"]["title"], subreddit) | title = "**{}** from /r/{}\n".format(choice["data"]["title"], subreddit) | ||||
print(checks.is_nfsw_enabled()) | |||||
if choice["data"]["over_18"] and not checks.nsfw_predicate(ctx): | if choice["data"]["over_18"] and not checks.nsfw_predicate(ctx): | ||||
return await self.bot.say("This server/channel doesn't have my NSFW stuff enabled. This extends to posting NFSW content from Reddit.") | return await self.bot.say("This server/channel doesn't have my NSFW stuff enabled. This extends to posting NFSW content from Reddit.") | ||||
url = Scrapper().retriveurl(choice["data"]["url"]) | url = Scrapper().retriveurl(choice["data"]["url"]) |
em.set_author(name="{} settings for {}.".format(self.bot.user.name, ctx.message.server.name), icon_url=self.bot.user.avatar_url) | em.set_author(name="{} settings for {}.".format(self.bot.user.name, ctx.message.server.name), icon_url=self.bot.user.avatar_url) | ||||
for settings in config: | for settings in config: | ||||
print(settings) | |||||
if settings != "custom_commands" and settings != "warnings": | if settings != "custom_commands" and settings != "warnings": | ||||
settingcontent = "" | settingcontent = "" | ||||
for x in config[settings].items(): | for x in config[settings].items(): | ||||
@set.command(pass_context=True, hidden=True) | @set.command(pass_context=True, hidden=True) | ||||
async def loggingchannel(self, ctx, channel: discord.Channel = None): | async def loggingchannel(self, ctx, channel: discord.Channel = None): | ||||
self.servers = self.con.load_config() | self.servers = self.con.load_config() | ||||
self.servers[ctx.message.server.id]["gss"]["logging_channel"] = channel.id | |||||
self.servers[ctx.message.server.id]["gss"]["log_channel"] = channel.id | |||||
self.con.update_config(self.servers) | self.con.update_config(self.servers) | ||||
return await self.bot.say("Logging Channel set to '{}'".format(channel.name)) | return await self.bot.say("Logging Channel set to '{}'".format(channel.name)) | ||||
@bot.command(pass_context=True) | @bot.command(pass_context=True) | ||||
async def serverisanal(self, ctx): | async def serverisanal(self, ctx): | ||||
self.servers = self.con.load_config() | self.servers = self.con.load_config() | ||||
is_anal = self.servers[ctx.message.server.id]["is_anal"] | |||||
if is_anal: | |||||
self.servers[ctx.message.server.id]["is_anal"]["y/n"] = 0 | |||||
is_anal = self.servers[ctx.message.server.id]["is_anal"]["y/n"] | |||||
if is_anal == 0: | |||||
self.servers[ctx.message.server.id]["is_anal"]["y/n"] = 1 | |||||
self.con.update_config(self.servers) | self.con.update_config(self.servers) | ||||
return await self.bot.say("I now know this server is anal") | return await self.bot.say("I now know this server is anal") | ||||
else: | else: | ||||
self.servers[ctx.message.server.id]["is_anal"]["y/n"] = 1 | |||||
self.servers[ctx.message.server.id]["is_anal"]["y/n"] = 0 | |||||
self.con.update_config(self.servers) | self.con.update_config(self.servers) | ||||
return await self.bot.say("I now know this server is NOT anal") | return await self.bot.say("I now know this server is NOT anal") | ||||
"cogs.settings", | "cogs.settings", | ||||
"cogs.twitch", | "cogs.twitch", | ||||
"cogs.util", | "cogs.util", | ||||
"cogs.gss" | |||||
] | ] |
[Github link](https://github.com/RainbowDinoaur/roxbot) | [Github link](https://github.com/RainbowDinoaur/roxbot) | ||||
[Changelog](https://github.com/RainbowDinoaur/roxbot#v100)""" | [Changelog](https://github.com/RainbowDinoaur/roxbot#v100)""" | ||||
__author__ = "Roxanne Gibson" | __author__ = "Roxanne Gibson" | ||||
__version__= "1.3.0" | |||||
__version__= "1.3.2" | |||||
embedcolour = 0xDEADBF | embedcolour = 0xDEADBF |
{"304048071963312130": {"greets": {"enabled": 0, "welcome-channel": "", "member-role": "", "custom-message": "hellow", "default-message": "Be sure to read the rules."}, "goodbyes": {"enabled": 0, "goodbye-channel": ""}, "self_assign": {"enabled": 0, "roles": []}, "twitch": {"enabled": 0, "twitch-channel": "", "whitelist": {"enabled": 0, "list": []}}, "mute": {"role": "", "admin-role": []}, "nsfw": {"enabled": 1, "channels": ["374688008869511168"]}, "admin_role": {"role": ""}, "custom_commands": {"0": {"test": "\"testedit\"", "hello": "<:tingles:346838411639914506>", "benis": "\ud83c\udd71enis", "sophie": "<@136619052994002944>", "myra": "<@342213251372941312>", "roxieee": "<@!142735312626515979>", "customs": "\"\ud83d\udec3\"", "zzz": "\ud83d\udca4", "lewd!": "\ud83d\udea8 lewd! \ud83d\udea8"}, "1": {}}, "perm_roles": {"admin": ["334078005347483648"], "mod": []}, "gss": {"logging_channel": "339201847678074880", "required_days": "5", "required_score": "3000000", "log_channel": ""}, "admin": {"warnings": {}}, "is_anal": {"y/n": 0}, "warnings": {"259869304369971200": [{"warned-by": "142735312626515979", "date": 1518514436.672631, "warning": "Hello"}, {"warned-by": "142735312626515979", "date": 1518514441.1129122, "warning": "Hello"}, {"warned-by": "142735312626515979", "date": 1518514442.534168, "warning": "Hello"}], "104291668810821632": [{"warned-by": "142735312626515979", "date": 1518519612.6708424, "warning": "For being a bad girl"}]}}, "395632940328943616": {"greets": {"enabled": 0, "welcome-channel": "", "member-role": "", "custom-message": "", "default-message": "Be sure to read the rules."}, "goodbyes": {"enabled": 0, "goodbye-channel": ""}, "self_assign": {"enabled": 0, "roles": []}, "twitch": {"enabled": 0, "twitch-channel": "", "whitelist": {"enabled": 0, "list": []}}, "nsfw": {"enabled": 0, "channels": []}, "perm_roles": {"admin": [], "mod": []}, "custom_commands": {"0": {}, "1": {}}, "gss": {"log_channel": "", "required_days": "", "required_score": ""}, "warnings": {}, "is_anal": {"y/n": 0}}} | |||||
{"304048071963312130": {"greets": {"enabled": 0, "welcome-channel": "", "member-role": "", "custom-message": "hellow", "default-message": "Be sure to read the rules."}, "goodbyes": {"enabled": 0, "goodbye-channel": ""}, "self_assign": {"enabled": 0, "roles": []}, "twitch": {"enabled": 0, "twitch-channel": "", "whitelist": {"enabled": 0, "list": []}}, "mute": {"role": "", "admin-role": []}, "nsfw": {"enabled": 1, "channels": ["374688008869511168"]}, "admin_role": {"role": ""}, "custom_commands": {"0": {"test": "\"testedit\"", "hello": "<:tingles:346838411639914506>", "benis": "\ud83c\udd71enis", "sophie": "<@136619052994002944>", "myra": "<@342213251372941312>", "roxieee": "<@!142735312626515979>", "customs": "\"\ud83d\udec3\"", "zzz": "\ud83d\udca4", "lewd!": "\ud83d\udea8 lewd! \ud83d\udea8"}, "1": {}}, "perm_roles": {"admin": ["334078005347483648"], "mod": []}, "gss": {"logging_channel": "339201847678074880", "required_days": "5", "required_score": "3000000", "log_channel": ""}, "admin": {"warnings": {}}, "is_anal": {"y/n": 1}, "warnings": {"259869304369971200": [{"warned-by": "142735312626515979", "date": 1518514436.672631, "warning": "Hello"}, {"warned-by": "142735312626515979", "date": 1518514441.1129122, "warning": "Hello"}, {"warned-by": "142735312626515979", "date": 1518514442.534168, "warning": "Hello"}], "104291668810821632": [{"warned-by": "142735312626515979", "date": 1518519612.6708424, "warning": "For being a bad girl"}]}}, "395632940328943616": {"greets": {"enabled": 0, "welcome-channel": "", "member-role": "", "custom-message": "", "default-message": "Be sure to read the rules."}, "goodbyes": {"enabled": 0, "goodbye-channel": ""}, "self_assign": {"enabled": 0, "roles": []}, "twitch": {"enabled": 0, "twitch-channel": "", "whitelist": {"enabled": 0, "list": []}}, "nsfw": {"enabled": 0, "channels": []}, "perm_roles": {"admin": [], "mod": []}, "custom_commands": {"0": {}, "1": {}}, "gss": {"log_channel": "", "required_days": "", "required_score": ""}, "warnings": {}, "is_anal": {"y/n": 0}}} |