# Is it a command? if it's not a command, ignore. Otherwise, proceed.
content=message.content.lower()
ifcontent.startswith('!'):
'''
Check if channel is server's auth channel. If so, allow auth commands.
'''
try:
maybe_auth=is_auth(message.channel,auth_channel)#''' This will break the program later. message.channel can be a DM channel. find a way to make it so that that wont break the channel'''
except:
print('could not find auth channel')
return
print('got auth channel: '+str(maybe_auth))
ifmaybe_auth:
# Get the user to do auth stuff with
auth_user=None
foruserinusers:
ifuser._member.id==message.author.id:
auth_user=user
break
ifauth_user==None:
print("Failed to find user: "+message.author.name+". Making new one")
send_text='The clubs in '+message.channel.guild.name+' are: \n\t'
forclubinclubs:
send_text+=club.name[2:]+'\n\t'
awaitmessage.channel.send(send_text)
elifcontent.startswith('!examples'):
commands=['!clublist\n\t\t - lists all clubs in '+message.channel.guild.name,
'!joinclub ECHackers\n\t\t - Joins the ECHackers Club',
'!leaveclub ECHackers\n\t\t - Leaves the ECHackers Club',
'!makeclub JelloLicking\n\t\t - Makes the JelloLicking club',
'!admin\n\t\t - (does nothing now) Opens a channel with you and admins',
'!report person reason\n\t\t - (does nothing now) Sends a report on a person to an admin or club convener.',
'!addtextchannel Problems-with-admin Friend-Houses\n\t\t - Adds the Friend-Houses text channel to Problems-with-admin',
'!removetextchannel Problems-with-admin Friend-Houses\n\t\t - Removes the Friend-Houses text channel from Problems-with-admin (if you made it)',
'!addvoicechannel Problems-with-admin Friend-Houses\n\t\t - Adds the Friend-Houses voice channel to Problems-with-admin',
'!removevoicechannel Problems-with-admin Friend-Houses\n\t\t - Removes the Friend-Houses voice channel from Problems-with-admin (if you made it)',]
send_text='Examples of commands '+message.channel.guild.name+' are (In order):\n\t'
forcommandincommands:
send_text+=command+'\n\t'
awaitmessage.channel.send(send_text)
return
elifcontent.startswith('!help'):
commands=['!clublist\n\t\t - Lists all clubs in '+message.channel.guild.name,'!joinclub Clubname\n\t\t - Joins the club Clubname','!leaveclub\n\t\t - Leaves a server\'s club',
'!makeclub Clubname\n\t\t - Makes a club with the clubname Clubname','!admin\n\t\t - Opens a channel with you and admins','!report person reason\n\t\t - Sends a report on a person to an admin or club convener.',
'!addtextchannel The-name-of-the-public-category The-new-channel\'s-name\n\t\t - Adds a new public text channel in a category',
'!removetextchannel The-name-of-the-public-category The-new-channel\'s-name\n\t\t - Removes the public text channel YOU MADE from the category. Doesn\'t work for other people\'s channels',
'!addvoicechannel The-name-of-the-public-category The-new-channel\'s-name\n\t\t - Adds a new public voice channel in a category',
'!removevoicechannel The-name-of-the-public-category The-new-channel\'s-name\n\t\t - Removes the public voice channel YOU MADE from the category. Doesn\'t work for other people\'s channels',]
send_text='Commands in '+message.channel.guild.name+' are:\n\t'
return['!describe description - Registers your club description. You can put spaces in description.',
'!pin channel-to-pin-to-in-club message-to-pin - Pins message-to-pin to channel-to-pin-to-in-club',
'!unpin channel-to-unpin-from-in-club copypaste-message-to-unpin - unpins the message copy pasted from pinned messages from channel-to-unpin-from-in-club',
'!requestbot What you want your bot to do - Ask the Manager Bot Developers to make your club a bot! (They will get back to you with questions)',
'!kick member - Removes a member',
'!addvoicechannel name - Adds a voice channel',
'!addtextchannel name - Adds a text channel',
'!addconvener member - Makes member a convener',
'!ban member - Unimplemented','!unban member - Unimplemented',
'!closeclub - Closes your club',
'!removevoicechannel name - Remove voice channel',
'!removetextchannel name - Remove text channel',
'!convenerhelp - Displays this message']
defget_club_command_examples():
return# not implemented
defget_help_message(channel):
commands=ClubSuite.get_club_commands()
send_text='Convener Commands in '+channel.name+' are:\n\t'
forcommandincommands:
send_text+=command+'\n\t'
returnsend_text
asyncdefprocesses_inc_command(message):
content=message.content.lower()
try:
maybe_club=ClubSuite.is_cli(ClubSuite.get_all_clubs(message.channel.guild),message.channel)#''' This will break the program later. message.channel can be a DM channel. find a way to make it so that that wont break the channel'''
await(awaitmessage.channel.send('DESCRIPTION SET TO: '+content[len('!describe '):])).pin()
returnTrue
elifcontent.startswith('!pin'):
terms=content.split(' ')
iflen(terms)<3:
awaitmessage.channel.send('!pin requires 3 things! Here\'s an example: !pin MyClubTextChannel what I want to pin and you can include spaces here',delete_after=10)
awaitmessage.channel.send('!pin requires 3 things! Here\'s an example: !pin MyClubTextChannel what I want to pin and you can include spaces here',delete_after=10)
awaitmessage.channel.send('!unpin requires 3 things! Here\'s an example: !pin TheClubChannelYourPinisin And what text copy pasted is in that pinned message',delete_after=10)
elifcontent.startswith('!requestbot'):
awaitmessage.channel.send('We will get back to you soon with questions and information about your bot!')