forked from viveksantayana/geas-bot
Fully implemented /tcard command.
Bug fixes for member signup Added live update of game header message during pitches Documentation updates
This commit is contained in:
@ -27,14 +27,14 @@ class MemberVerification(commands.Cog, name='Member Verification Cog'):
|
||||
if message.author.bot: return
|
||||
if message.channel.id != conf[guildStr]['channels']['signup']: return
|
||||
if not (message.attachments):
|
||||
await message.channel.send(f'```Error: The message you posted in the `{message.channel.name}` channel of the guild `{message.guild.name}` was invalid. Your post must contain a screensot of your proof of purchase for membership.```')
|
||||
await message.author.send(f'```Error: The message you posted in the `{message.channel.name}` channel of the guild `{message.guild.name}` was invalid. Your post must contain a screensot of your proof of purchase for membership.```')
|
||||
await message.delete()
|
||||
return
|
||||
membership = [discord.utils.get(message.guild.roles, id=x) for x in conf[guildStr]['membership']]
|
||||
membership_options = [create_select_option(label=x.name, value=str(x.id), description='Membership type.') for x in membership]
|
||||
admin_buttons = []
|
||||
if conf[guildStr]['roles'].get('student', None) is not None: admin_buttons.append(create_button(style=ButtonStyle.blurple, label='Student', emoji='📚', custom_id=f'student_{message.id}'))
|
||||
admin_buttons.append(create_button(style=ButtonStyle.grey, label='Alert', emoji='⚠️', custom_id=f'alert_{message.id}'))
|
||||
admin_buttons.append(create_button(style=ButtonStyle.grey, label='Review', emoji='⚠️', custom_id=f'review_{message.id}'))
|
||||
admin_buttons.append(create_button(style=ButtonStyle.red, label='Deny', emoji='✖️', custom_id=f'deny_{message.id}'))
|
||||
admin_buttons.append(create_button(style=ButtonStyle.green, label='Done', emoji='▶️', custom_id=f'done_{message.id}'))
|
||||
o = f'```For Administrators: Please verify the membership request submitted by `{message.author.display_name}`.```'
|
||||
@ -89,36 +89,36 @@ class MemberVerification(commands.Cog, name='Member Verification Cog'):
|
||||
description = f'[Jup to Message]({submission.jump_url})',
|
||||
colour = discord.Colour.red(),
|
||||
)
|
||||
await submission.channel.send(f'```Your membership for guild `{submission.guild.name}` could not be verified. Please make sure your name and the kind of membership that you have bought are visible in the screenshot you upload. Please contact a Committee member if you have any difficulties.```')
|
||||
await submission.author.send(f'```Your membership for guild `{submission.guild.name}` could not be verified. Please make sure your name and the kind of membership that you have bought are visible in the screenshot you upload. Please contact a Committee member if you have any difficulties.```')
|
||||
if conf[guildStr]['channels'].get('mod', None) is not None:
|
||||
await submission.guild.get_channel(conf[guildStr]['channels']['mod']).send(f'```Verifying the membership of {submission.author.display_name} failed.```\n{admins}', embed=embed)
|
||||
await ctx.origin_message.delete()
|
||||
elif ctx.custom_id.startswith('alert_'):
|
||||
await ctx.send(f'```Membership verification alert raised.```', hidden=True)
|
||||
elif ctx.custom_id.startswith('review_'):
|
||||
await ctx.send(f'```Membership review requested.```', hidden=True)
|
||||
embed = discord.Embed(
|
||||
title = submission.author.name,
|
||||
description = f'[Jup to Message]({submission.jump_url})',
|
||||
colour = discord.Colour.orange()
|
||||
)
|
||||
await submission.channel.send(f'```Your membership for guild `{submission.guild.name}` needs to be reviewed by a Committee member.```')
|
||||
await submission.author.send(f'```Your membership for guild `{submission.guild.name}` needs to be reviewed by a Committee member.```')
|
||||
if conf[guildStr]['channels'].get('mod', None) is not None:
|
||||
await submission.guild.get_channel(conf[guildStr]['channels']['mod']).send(f'```There is a problem verifying the membership of {submission.author.display_name}.\nCould someone verify this person\'s membership manually via the EUSA portal?.```\n{admins}', embed=embed)
|
||||
elif ctx.custom_id.startswith('student_'):
|
||||
await ctx.send(f'````Student` role granted.```', hidden=True)
|
||||
student_role = submission.guild.get_role(conf[guildStr]['roles']['student'])
|
||||
await submission.author.add_roles(student_role, reason=f'Membership Verification: Student role assigned by `{ctx.author.display_name}`.')
|
||||
await submission.channel.send(f'```You have additionally been assigned the role `Student` in the guild `{submission.guild.name}`.```')
|
||||
await submission.author.send(f'```You have additionally been assigned the role `Student` in the guild `{submission.guild.name}`.```')
|
||||
elif ctx.custom_id.startswith('membership_'):
|
||||
[selected_membership] = ctx.selected_options
|
||||
selected_role = ctx.guild.get_role(int(selected_membership))
|
||||
if selected_role not in submission.author.roles:
|
||||
await ctx.send(f'```Membership `{selected_role.name}` added to member `{submission.author.display_name}`.```', hidden=True)
|
||||
await submission.author.add_roles(selected_role, reason=f'Membership Verification: Membership verified by `{ctx.author.display_name}`.')
|
||||
await submission.channel.send(f'```Your membership for guild `{submission.guild.name}` has been verified and you have been assigned the role `{selected_role.name}`.```')
|
||||
await submission.author.send(f'```Your membership for guild `{submission.guild.name}` has been verified and you have been assigned the role `{selected_role.name}`.```')
|
||||
else:
|
||||
await ctx.send(f'```Membership `{selected_role.name}` removed from member `{submission.author.display_name}`.```', hidden=True)
|
||||
await submission.author.remove_roles(selected_role, reason=f'Membership Verification: Membership removed by `{ctx.author.display_name}`.')
|
||||
await submission.channel.send(f'```Your role `{selected_role.name}` has been removed in the guild `{submission.guild.name}`.```')
|
||||
await submission.author.send(f'```Your role `{selected_role.name}` has been removed in the guild `{submission.guild.name}`.```')
|
||||
else:
|
||||
pass
|
||||
|
||||
|
Reference in New Issue
Block a user