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

"roxbot.cogs.twitch", "roxbot.cogs.twitch",
"roxbot.cogs.util", "roxbot.cogs.util",
"roxbot.cogs.voice", "roxbot.cogs.voice",
#"roxbot.cogs.gss"
#"roxbot.cogs.ags"
] ]

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

""" """




import typing
import datetime import datetime


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


import roxbot 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 is_not_nsfw_disabled():
def predicate(ctx): 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) return commands.check(predicate)




return await roxbot.http.api_request(url, headers={"Authorization": roxbot.tat_token}) return await roxbot.http.api_request(url, headers={"Authorization": roxbot.tat_token})




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


async def on_member_join(self, member): 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") 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() @commands.command()
async def agree(self, ctx): async def agree(self, ctx):
role = discord.utils.get(ctx.author.guild.roles, id=450042170112475136)
role = ctx.guild.get_role(newbie)
try: try:
return await ctx.author.remove_roles(role, reason="User has agreed the rules and has been given access to the server.") return await ctx.author.remove_roles(role, reason="User has agreed the rules and has been given access to the server.")
except discord.HTTPException: except discord.HTTPException:
return False return False
settings = roxbot.guild_settings.get(ctx.guild) settings = roxbot.guild_settings.get(ctx.guild)
member = ctx.author 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) data = await tatsumaki_api_call(member, ctx.guild)
if data is None: if data is None:
return await ctx.send("Tatsumaki API call returned nothing. Maybe the API is down?") return await ctx.send("Tatsumaki API call returned nothing. Maybe the API is down?")
"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)
) )


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


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


@commands.command() @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.""" """Custom Cog for the GaySoundsShitposts Discord Server."""
selection = selection.lower() selection = selection.lower()
settings = roxbot.guild_settings.get(ctx.guild) settings = roxbot.guild_settings.get(ctx.guild)
gss = settings["gss"]
ags = settings["ags"]


if selection == "loggingchannel": if selection == "loggingchannel":
if ctx.message.channel_mentions:
if not channel:
channel = ctx.channel
elif ctx.message.channel_mentions:
channel = ctx.channel_mentions[0] channel = ctx.channel_mentions[0]
else: 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)) await ctx.send("Logging Channel set to '{}'".format(channel.name))
elif selection == "requireddays": 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": 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: else:
return await ctx.send("No valid option given.") return await ctx.send("No valid option given.")
return settings.update(gss, "gss")
return settings.update(ags, "ags")




def setup(bot_client): 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

["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 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 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’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 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 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"], ["Roxbot can get annoyed when people ask her to do too much at once.", "Summer"],

Loading…
Cancel
Save