Browse Source

renamed all mentions of gssp to ags. Improved input on ags, members are now pm'd when they join the server.

tags/v2.0.0
Roxie Gibson 5 years ago
parent
commit
66bac0575f
3 changed files with 39 additions and 33 deletions
  1. +1
    -1
      roxbot/__init__.py
  2. +37
    -31
      roxbot/cogs/ags.py
  3. +1
    -1
      roxbot/roxbotfacts.py

+ 1
- 1
roxbot/__init__.py View File

@@ -69,5 +69,5 @@ cogs = [
"roxbot.cogs.twitch",
"roxbot.cogs.util",
"roxbot.cogs.voice",
#"roxbot.cogs.gss"
#"roxbot.cogs.ags"
]

roxbot/cogs/gss.py → roxbot/cogs/ags.py View File

@@ -25,25 +25,29 @@ SOFTWARE.
"""


import typing
import datetime

import discord
from discord.ext import commands
from discord.ext.commands import bot

import roxbot

gssp_id = 393764974444675073

ags_id = 393764974444675073
nsfw_disabled = 397866388145831937
selfieperms = 394939389823811584
nsfwimageperms = 394941004043649036
newbie = 450042170112475136

def is_gss():
return commands.check(lambda ctx: ctx.guild.id == gssp_id)

def is_ags():
return commands.check(lambda ctx: ctx.guild.id == ags_id)


def is_not_nsfw_disabled():
def predicate(ctx):
role = discord.utils.get(ctx.guild.roles, id=397866388145831937)
return role not in ctx.author.roles
return ctx.guild.get_role(nsfw_disabled) not in ctx.author.roles
return commands.check(predicate)


@@ -53,12 +57,13 @@ async def tatsumaki_api_call(member, guild):
return await roxbot.http.api_request(url, headers={"Authorization": roxbot.tat_token})


class GaySoundsShitposts:
class AsortedGenderSounds:
def __init__(self, bot_client):
self.bot = bot_client
self.acceptable_roles = (394939389823811584, 394941004043649036)
self.acceptable_roles = (nsfwimageperms, selfieperms)
self.settings = {
"gss": {
"limited_to_guild": str(ags_id),
"ags": {
"log_channel": "",
"required_days": "",
"required_score": "",
@@ -66,15 +71,14 @@ class GaySoundsShitposts:
}

async def on_member_join(self, member):
if member.guild.id == gssp_id:
role = discord.utils.get(member.guild.roles, id=450042170112475136)
if member.guild.id == ags_id:
role = member.guild.get_role(newbie)
await member.add_roles(role, reason="Auto-add role on join")
#channel = self.bot.get_channel(450040463794241536)
#await channel.send("Please read our <#396697172139180033> and <#422514427263188993> channels. To gain access to the server, you must agree to the rules.")
await member.send("Please read our <#396697172139180033> and <#422514427263188993> channels. To gain access to the server, you must agree to the rules.")

@commands.command()
async def agree(self, ctx):
role = discord.utils.get(ctx.author.guild.roles, id=450042170112475136)
role = ctx.guild.get_role(newbie)
try:
return await ctx.author.remove_roles(role, reason="User has agreed the rules and has been given access to the server.")
except discord.HTTPException:
@@ -88,8 +92,8 @@ class GaySoundsShitposts:
return False
settings = roxbot.guild_settings.get(ctx.guild)
member = ctx.author
required_score = settings["gss"]["required_score"]
days = int(settings["gss"]["required_days"])
required_score = settings["ags"]["required_score"]
days = int(settings["ags"]["required_days"])
data = await tatsumaki_api_call(member, ctx.guild)
if data is None:
return await ctx.send("Tatsumaki API call returned nothing. Maybe the API is down?")
@@ -108,55 +112,57 @@ class GaySoundsShitposts:
"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)
)

@is_gss()
@is_ags()
@commands.command()
async def selfieperms(self, ctx):
"""Requests the selfie perm role."""
arg = None
for role in ctx.guild.roles:
if role.id == 394939389823811584:
if role.id == selfieperms:
arg = role
if not arg:
return ctx.send("Error, message roxie thanks.")
return await ctx.invoke(self.perms, role=arg)

@is_not_nsfw_disabled()
@is_gss()
@is_ags()
@commands.command()
async def nsfwperms(self, ctx):
"""Requests the NSFW Image Perm role."""
arg = None
for role in ctx.guild.roles:
if role.id == 394941004043649036:
if role.id == nsfwimageperms:
arg = role
if not arg:
return ctx.send("Error, message roxie thanks.")
return await ctx.invoke(self.perms, role=arg)

@commands.command()
async def gss(self, ctx, selection=None, *, changes=None):
async def ags(self, ctx, selection, amount: typing.Optional[int], *, channel: typing.Optional[discord.TextChannel] = None):
"""Custom Cog for the GaySoundsShitposts Discord Server."""
selection = selection.lower()
settings = roxbot.guild_settings.get(ctx.guild)
gss = settings["gss"]
ags = settings["ags"]

if selection == "loggingchannel":
if ctx.message.channel_mentions:
if not channel:
channel = ctx.channel
elif ctx.message.channel_mentions:
channel = ctx.channel_mentions[0]
else:
channel = self.bot.get_channel(changes)
gss["log_channel"] = channel.id
channel = ctx.guild.get_channel(channel)
ags["log_channel"] = channel.id
await ctx.send("Logging Channel set to '{}'".format(channel.name))
elif selection == "requireddays":
gss["required_days"] = int(changes)
await ctx.send("Required days set to '{}'".format(str(changes)))
ags["required_days"] = amount
await ctx.send("Required days set to '{}'".format(str(amount)))
elif selection == "requiredscore":
gss["required_score"] = int(changes)
await ctx.send("Required score set to '{}'".format(str(changes)))
ags["required_score"] = amount
await ctx.send("Required score set to '{}'".format(str(amount)))
else:
return await ctx.send("No valid option given.")
return settings.update(gss, "gss")
return settings.update(ags, "ags")


def setup(bot_client):
bot_client.add_cog(GaySoundsShitposts(bot_client))
bot_client.add_cog(AsortedGenderSounds(bot_client))

+ 1
- 1
roxbot/roxbotfacts.py View File

@@ -69,7 +69,7 @@ facts = [
["Roxbot is frustrated with her inability to defeat all the Mario games. She has 100 percented Super Mario World and Super Mario 3D Land, but she lacks the computing skills to figure out the game franchise's open-world counterparts.", "elise"],
["Roxbot knows the meaning of the world, the universe, and everything.", "roxie"],
["Roxbot’s voice feature is actually quite rudimentary. The current setup is Roxbot puts her Blue Yeti microphone up to her brand new subwoofers. This is the reason it can be so loud sometimes.", "roxie"],
["Roxbot was very apprehensive of her new friend, GSSPE, but she gets along with her nowadays. GSSPE’s “agile development” caught her off-guard at first.", "summer"],
["Roxbot was very apprehensive of her new friend, AGSE, but she gets along with her nowadays. AGSE’s “agile development” caught her off-guard at first.", "summer"],
["Roxbot used to hate surreal memes. “They don’t make any damn sense!” she’d say. After explaining to her that that’s the entire point, she’s kind of gone off the deep end with it. Loves to “deep fry” things now and can be heard laughing from down the hall.", "summer"],
["Roxbot shares her mother’s interest in Vexillology, or the study of flags, their use, and design. Roxbot hopes to make a flag that she thinks is worth showing her mom one day; until then she designs in secret.", "summer"],
["Roxbot can get annoyed when people ask her to do too much at once.", "Summer"],

Loading…
Cancel
Save