Browse Source

Merge branch 'master' into rewrite

tags/v1.4.0
roxie 6 years ago
parent
commit
c108d2eb82
10 changed files with 36 additions and 19 deletions
  1. +10
    -2
      README.md
  2. +2
    -3
      checks.py
  3. +9
    -1
      cogs/admin.py
  4. +2
    -2
      cogs/fun.py
  5. +5
    -1
      cogs/gss.py
  6. +0
    -1
      cogs/reddit.py
  7. +5
    -6
      cogs/settings.py
  8. +1
    -1
      config/cogs.py
  9. +1
    -1
      config/meta.py
  10. +1
    -1
      config/servers.json

+ 10
- 2
README.md View File

@@ -11,6 +11,14 @@ A simple Discord Bot used by me personally, written for fun.

## 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
###### New Features
- New Admin Cog with warning and slowmode commands.
@@ -21,7 +29,7 @@ A simple Discord Bot used by me personally, written for fun.
- 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.

######Bug FIxes
###### Bug Fixes
- Fixed bug where Custom Commands would ignore the blacklist.
- Fixed issue where custom command outputs were always lowercase
- Fixed some naughty swears that were placeholders for a more civilised response.
@@ -77,4 +85,4 @@ Probs more but I forgot honestly


## Licence
[MIT Licence](https://github.com/RainbowDinoaur/roxbot/blob/master/LICENSE.md)
[MIT Licence](https://github.com/RainbowRoxxers/roxbot/blob/master/LICENSE)

+ 2
- 3
checks.py View File

@@ -37,14 +37,13 @@ def nsfw_predicate(ctx):
elif nsfw["enabled"] and nsfw["channels"]:
return ctx.message.channel.id in nsfw["channels"]
else:
print("yo")
return False

def is_nfsw_enabled():
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():
return commands.check(lambda ctx: ctx.message.channel.type != discord.ChannelType.private)

+ 9
- 1
cogs/admin.py View File

@@ -201,8 +201,16 @@ class Admin():


@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)
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"]:
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)

+ 2
- 2
cogs/fun.py View File

@@ -51,7 +51,7 @@ class Fun():
roll = random.randrange(step, dice + 1, step)
return await self.bot.say("{} rolled a **{}**".format(ctx.message.author.mention, roll))

@checks.is_anal()
@checks.isnt_anal()
@bot.command(pass_context=True)
async def spank(self, ctx, *, user: discord.User = None):
"""
@@ -64,7 +64,7 @@ class Fun():
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))

@checks.is_anal()
@checks.isnt_anal()
@bot.command(pass_context=True, aliases=["succ"])
async def suck(self, ctx, *, user: discord.User = None):
"""

+ 5
- 1
cogs/gss.py View File

@@ -43,6 +43,8 @@ class GaySoundsShitposting():

if self.selfie_role in member.roles:
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))

time = datetime.datetime.now() - ctx.message.author.joined_at
@@ -70,6 +72,8 @@ class GaySoundsShitposting():

if self.nsfw_image_role in member.roles:
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))

time = datetime.datetime.now() - ctx.message.author.joined_at
@@ -78,7 +82,7 @@ class GaySoundsShitposting():
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))
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:
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)

+ 0
- 1
cogs/reddit.py View File

@@ -181,7 +181,6 @@ class Reddit():
for x in range(10):
choice = random.choice(links)
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):
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"])

+ 5
- 6
cogs/settings.py View File

@@ -167,7 +167,6 @@ class Settings():
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:
print(settings)
if settings != "custom_commands" and settings != "warnings":
settingcontent = ""
for x in config[settings].items():
@@ -257,7 +256,7 @@ class Settings():
@set.command(pass_context=True, hidden=True)
async def loggingchannel(self, ctx, channel: discord.Channel = None):
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)
return await self.bot.say("Logging Channel set to '{}'".format(channel.name))

@@ -353,13 +352,13 @@ class Settings():
@bot.command(pass_context=True)
async def serverisanal(self, ctx):
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)
return await self.bot.say("I now know this server is anal")
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)
return await self.bot.say("I now know this server is NOT anal")


+ 1
- 1
config/cogs.py View File

@@ -11,5 +11,5 @@ cogs = [
"cogs.settings",
"cogs.twitch",
"cogs.util",
"cogs.gss"
]

+ 1
- 1
config/meta.py View File

@@ -3,5 +3,5 @@ __description__ = """RoxBot, A Discord Bot made by a filthy Mercy Main. Built wi
[Github link](https://github.com/RainbowDinoaur/roxbot)
[Changelog](https://github.com/RainbowDinoaur/roxbot#v100)"""
__author__ = "Roxanne Gibson"
__version__= "1.3.0"
__version__= "1.3.2"
embedcolour = 0xDEADBF

+ 1
- 1
config/servers.json View File

@@ -1 +1 @@
{"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}}}

Loading…
Cancel
Save