add sex cog

This commit is contained in:
Luna Mendes 2017-12-03 18:41:44 -03:00
parent 5e1fbb2266
commit cd54616325
2 changed files with 60 additions and 1 deletions

58
bot/ext/sex.py Normal file
View file

@ -0,0 +1,58 @@
import logging
import os
import base64
import discord
from discord.ext import commands
from .common import Cog
class Sex(Cog):
@commands.command()
async def me(self, ctx, username: str = None, *, reason: str = None):
"""Request a sexhouse account.
provide an username you want, it has to at least contain your current username.
provide at least a sane reason to join, and that you'll actually use our
resources
Please, *please*, specify your account area in your reason.
Not complying to this will be a denied request.
- "normal" if you want our normal services, like GitLab and access to the main user container
- "sexhouse" if you want access to other services, like Email and others
thanks
"""
chan = self.bot.get_channel(self.bot.config.sexr_chan)
if not chan:
return await ctx.send('sexhouse request channel not found')
if ctx.guild:
await ctx.send('Read your DMs. This command only works in DMs')
await ctx.author.send(f'Read the helptext to this command with `{self.bot.command_prefix}help me`')
return
if not username:
return await ctx.send('Please provide an username')
if not reason:
return await ctx.send('Please provde a reason')
em = discord.Embed(title=f'Sexhouse request',
color=discord.Colour(0xf84a6e))
em.add_field(name='who', value=ctx.author.mention)
em.add_field(name='username', value=username)
em.add_field(name='reason', value=reason)
em.add_field(name='generated password',
value=base64.b64encode(os.urandom(100))[:16].decode())
await chan.send(embed=em)
await ctx.send('done')
def setup(bot):
bot.add_cog(Sex(bot))

View file

@ -8,6 +8,7 @@ db = {
bot_token = 'Mzg2Mjc1MDc3MzY2NDgwODk4.DQNi9A.BnyE5MnKaIaVMBbWiW9rVDwkrSs' bot_token = 'Mzg2Mjc1MDc3MzY2NDgwODk4.DQNi9A.BnyE5MnKaIaVMBbWiW9rVDwkrSs'
owner_id = 162819866682851329 owner_id = 162819866682851329
command_channel = 385653662724259840 command_channel = 386989864014446612
sexr_chan = 386990164896907264
admin_role = 386566510803681280 admin_role = 386566510803681280