Exemplo n.º 1
0
def unfreeze(user_id,victim_id):
    """This function allows the innkeeper to unfreeze frozen victims.
    The function assumes both players are participants, of which the casting user is an innkeeper. Make sure to have filtered this out already.
    The other user does not need to be frozen.
    The function returns a Mailbox.

    Keyword arguments:
    user_id -> the innkeeper who unfrozes a player
    victim_id -> the frozen player who is about to be unfrozen"""

    uses = int(db_get(user_id,'uses'))
    if uses < 1:
        return Mailbox().respond("I am sorry! You currently don't have the ability to unfreeze anyone!",True)

    user_channel = int(db_get(user_id,'channel'))
    user_undead = int(db_get(user_id,'undead'))

    victim_frozen = int(db_get(victim_id,'frozen'))
    victim_abducted = int(db_get(victim_id,'abducted'))

    if user_undead == 1:
        return Mailbox().msg("I'm sorry! You are undead, meaning that you can no longer unfreeze people!",user_channel,True)
    if victim_abducted == 1:
        return Mailbox().msg("You wanted to warm up <@{}>... but you weren't able to find them! That is strange...",user_channel,True)
    if victim_frozen == 0:
        return Mailbox().msg("This player isn't frozen! Please choose another target.",user_channel,True)

    db_set(user_id,'uses',uses - 1)
    db_set(victim_id,'frozen',0)

    answer = Mailbox().msg("You have successfully unfrozen <@{}>!".format(victim_id),user_channel)
    answer.unfreeze(victim_id)

    answer.dm("Great news, <@{}>! You have been unfrozen by an **Innkeeper**! You can now take part with the town again!".format(victim_id),victim_id)
    return answer.log("The **Innkeeper** <@{}> has unfrozen <@{}>.".format(user_id,victim_id))
Exemplo n.º 2
0
def ignite(user_id):
    """This function ignites all powdered players that aren't pyromancer.
    The function assumes the player is a participant and has the correct role, so make sure to have filtered this out already.
    The function returns a Mailbox.

    user_id -> the player who ignites all powdered players"""

    uses = int(db_get(user_id,'uses'))
    if uses < 1:
        return Mailbox().respond("I am sorry! You currently cannot ignite anyone!",True)
    db_set(user_id,'uses',uses - 1)

    user_role = db_get(user_id,'role')
    user_channel = db_get(user_id,'channel')
    user_undead = int(db_get(user_id,'undead'))

    if user_undead == 1:
        answer = Mailbox().log("<@{}>, an undead **{}**, has pretended to ignite all powdered players.".format(user_id,user_role))
        answer.dm("Hey, you are undead, so your power won\'t work. But at least this won\'t blow your cover!",user_id)
        return answer.msg("Okay! All powdered players will die tomorrow.",user_channel)

    # Ignite all living players.
    for user in db.player_list(True,True):
        if db.isParticipant(user) and db_get(user,'role') != 'Pyromancer':
            db.add_kill(int(user),'Pyromancer',user_id)

    answer = Mailbox().log("The **{}** <@{}> has ignited all powdered players!".format(user_role,user_id))
    return answer.msg("Okay! All powdered players will die tomorrow.",user_channel)
Exemplo n.º 3
0
def freeze_all(user_id):
    """This function allows the ice king to potentially freeze all their guessed players.
    The function assumes the ice king is a participant, so make sure to have filtered this out already.
    The function returns a Mailbox.

    Keyword arguments:
    user_id -> the ice king's id"""

    uses = int(db_get(user_id,'uses'))
    if uses < 1:
        return Mailbox().respond("I am sorry! You currently don't have the ability to submit a freezing list!",True)
    db_set(user_id,'uses',uses - 1)

    user_channel = int(db_get(user_id,'channel'))
    user_undead = int(db_get(user_id,'undead'))
    correct = 0
    incorrect = 0

    for frozone in db.get_freezers(user_id):
        if not db.isParticipant(frozone[0]) or int(db_get(frozone[0],'abducted')) == 1:
            db.delete_freezer(user_id,frozone[0])
        elif frozone[1] != db_get(frozone[0],'role'):
            incorrect += 1
        else:
            correct += 1

    if user_undead == 1:
        answer = Mailbox().msg("You have submitted a list that contains {} players. The result was **unsuccessful**. ".format(correct+incorrect),user_channel)
        answer.msg_add("This means that at least one role was incorrect!")
        answer.log("The **Undead** <@{}> has pretended to submit a freeze list.".format(user_id))
        answer.dm("Hey, you're **Undead**, so this list would've failed anyway - but this helps a little to keep up your cover! 😉",user_id)
        return answer

    if incorrect > 0:
        answer = Mailbox().msg("You have submitted a list that contains {} players. The result was **unsuccessful**. ".format(correct+incorrect),user_channel)
        answer.msg_add("This means that at least one role was incorrect!")
        answer.log("The **Ice King** <@{}> has submitted an **unsuccessful** freeze list. ".format(user_id))
        answer.log_add("The list contained {} guesses, of which {} were correct.".format(incorrect+correct,correct))
        return answer

    # This will execute if all users on the list are correct.
    answer = Mailbox().msg("You have submitted a list that contains {} players. The result was **successful**!\n".format(correct),user_channel)
    if correct > 4:
        answer.msg_add("Congratulations! You guessed them all correctly! ").msg_react('🎉')
    answer.msg_add("Your guessed users will now be frozen.")


    for supersuit in db.get_freezers(user_id):
        db_set(supersuit[0],'frozen',1)
        db.delete_freezer(user_id,supersuit[0])

        for channel_id in db.freeze(user_id):
            answer.edit_cc(channel_id,supersuit[0],2)

    # TODO: Give players access to frozen realm.

    return answer
Exemplo n.º 4
0
def powder(user_id, victim_id):
    """This function powders a player if they are alive and not a pyromancer.
    The function assumes the player is a participant and has the correct role, so make sure to have filtered this out already.
    The function returns a Mailbox.

    user_id -> the player who powders the victim
    victim_id -> the player who is powdered"""

    uses = int(db_get(user_id, 'uses'))
    if uses < 1:
        return Mailbox().respond(
            "I am sorry! You currently cannot powder anyone!", True)

    user_role = db_get(user_id, 'role')
    user_channel = db_get(user_id, 'channel')
    user_undead = int(db_get(user_id, 'undead'))

    victim_role = db_get(victim_id, 'role')
    victim_powdered = int(db_get(victim_id, 'powdered'))
    victim_frozen = int(db_get(victim_id, 'frozen'))
    victim_abducted = int(db_get(victim_id, 'abducted'))

    if victim_id == user_id:
        return Mailbox().respond("I'm sorry, bud, you can't powder yourself.")
    if victim_abducted == 1:
        return Mailbox().msg(
            "You have attempted to powder <@{}>... but you cannot find them! Have they left the town?"
            .format(victim_id), user_channel, True)
    if victim_frozen == 1:
        return Mailbox().msg(
            "You tried to powder <@{}>... but it's not so easy to powder an ice cube! Let's try someone else."
            .format(victim_id), user_channel, True)
    if victim_role == 'Pyromancer':
        return Mailbox().msg(
            "I am sorry, <@{}>, but you cannot powder a pyromancer!".format(
                user_id), user_channel, True)
    if victim_powdered == 1:
        return Mailbox().msg(
            "I am terribly sorry, but <@{}> has already been powdered! Please choose another victim."
            .format(victim_id), user_channel, True)

    db_set(user_id, 'uses', uses - 1)

    # Powder the player
    answer = Mailbox().msg(
        "You have successfully powdered <@{}>!".format(victim_id),
        user_channel)
    if user_undead == 1:
        answer.log("<@{}>, an undead, has pretended to powder <@{}>.".format(
            user_id, victim_id))
        return answer.dm(
            "Hey, you are undead, so your powers no longer work... but here\'s a little help to keep up your cover!",
            user_id)

    db_set(victim_id, 'powdered', 1)
    return answer.log("The **{}** <@{}> has powdered the **{}** <@{}>!".format(
        user_role, user_id, victim_role, victim_id))
Exemplo n.º 5
0
def cupid_kiss(user_id,victim_id,voluntarily = True):
    """This function makes the cupid fall in love with a partner.
    The function assumes the player is a cupid and has the correct role, so make sure to have filtered this out already.
    The function returns a Mailbox.

    user_id -> the cupid who casts the spell
    victim_id -> the player who's falling in love with the cupid"""

    uses = int(db_get(user_id,'uses'))
    if uses < 1:
        return Mailbox().respond("I am sorry! You currently cannot choose someone to fall in love with!",True)

    user_channel = int(db_get(user_id,'channel'))

    victim_role = db_get(victim_id,'role')
    victim_frozen = int(db_get(victim_id,'frozen'))
    victim_abducted = int(db_get(victim_id,'abducted'))
    victim_undead = int(db_get(victim_id,'undead'))

    # If involuntary, make the cupid choose again.
    if voluntarily == False and (victim_id == user_id or victim_abducted == 1 or victim_frozen == 1):
        return False 

    if victim_id == user_id:
        return Mailbox().respond("So you wanna fall in love with yourself, huh? Too bad, your partner really has to be someone ELSE.")
    if victim_abducted == 1:
        return Mailbox().msg("You wanted to throw an arrow at your target... but you cannot find them! It's almost as if they had disappeared from this town!",user_channel,True)
    if victim_frozen == 1:
        return Mailbox().msg("Your love arrows just do not seem to be able to reach your chosen lover! They are frozen! Please try someone else.",user_channel,True)

    db_set(user_id,'uses',uses - 1)

    answer = Mailbox().edit_cc(user_channel,victim_id,1).msg("Welcome, <@{}>!".format(victim_id),user_channel)
    answer.log("The **Cupid** <@{}> has chosen to fall in love with <@{}>.".format(user_id,victim_id))
    answer.dm("Hello there, <@{}>! The **Cupid** <@{}> has chosen to fall in love with you!\n".format(victim_id,user_id),victim_id)
    answer.dm_add("For the rest of the game, you two will remain partners. Be open and honest, as you cannot win if the other dies!\n")
    answer.dm_add("Good luck!")

    if victim_undead == 1:
        answer.msg_add("<@{}>, while pretending to be a **{}**, is secretly an **Undead**!".format(victim_id,victim_role))
    else:
        answer.msg_add("<@{}>, the town's favourite **{}**, has decided to trust <@{}>.".format(victim_id,victim_role,user_id))

    return answer.msg_add("\nTogether, they will survive this town!")
Exemplo n.º 6
0
def enchant(user_id,victim_id):
    """This function allows the flute player to enchant targets.
    The function assumes both players are participants, of which the casting user is a flute player. Make sure to have filtered this out already.
    The function returns a Mailbox.

    Keyword arguments:
    user_id -> the flute player who enchants the player
    victim_id -> the player who's enchanted"""

    uses = int(db_get(user_id,'uses'))
    if uses < 1:
        return Mailbox().respond("I am sorry! You currently don't have the ability to enchant anyone!",True)

    user_channel = int(db_get(user_id,'channel'))
    user_undead = int(db_get(user_id,'undead'))

    victim_frozen = int(db_get(victim_id,'frozen'))
    victim_abducted = int(db_get(victim_id,'abducted'))
    victim_enchanted = int(db_get(victim_id,'enchanted'))

    if db_get(victim_id,'role') == 'Flute Player':
        return Mailbox().msg("You cannot enchant a flute player, sorry.",user_channel,True)
    if victim_abducted == 1:
        return Mailbox().msg("You wanted to warm up <@{}>... but you weren't able to find them! That is strange...",user_channel,True)
    if victim_frozen == 1:
        return Mailbox().msg("You failed to enchant your target, as they were frozen to the bone!.",user_channel,True)
    if victim_enchanted == 1:
        return Mailbox().msg("I am terribly sorry, but you cannot enchant a player who already *IS* enchanted!",user_channel,True)

    answer = Mailbox().msg("You have successfully enchanted <@{}>!".format(victim_id),user_channel)
    db_set(user_id,'uses',uses - 1)

    if user_undead == 1:
        answer.dm("You're an Undead, so you can't actually enchant anyone... but this will help you keep up your cover!",user_id)
        answer.log("The **Undead** <@{}> has pretended to enchant <@{}>.".format(user_id,victim_id))
    else:
        for channel_id in db.get_secret_channels('Flute_Victims'):
            answer.edit_cc(channel_id,victim_id,1)
            answer.msg("<@{}> has been enchanted! Please welcome them to the circle of the enchanted ones.".format(victim_id),channel_id)
        answer.log("The **Flute Player** <@{}> has enchanted <@{}>.".format(user_id,victim_id))
        db_set(victim_id,'enchanted',1)

    return answer
Exemplo n.º 7
0
def purify(user_id,victim_id):
    """This function allows the priestess to purify targets.
    The function assumes both players are participants, and that the casting user is a priestess. Make sure to have filtered this out beforehand.
    The function returns a Mailbox."""

    uses = int(db_get(user_id,'uses'))
    if uses < 1:
        return Mailbox().respond("I am sorry! You currently don't have the ability to purify anyone!",True)

    user_channel = int(db_get(user_id,'channel'))
    user_undead = int(db_get(user_id,'undead'))

    victim_role = db_get(victim_id,'role')
    victim_frozen = int(db_get(victim_id,'frozen'))
    victim_abducted = int(db_get(victim_id,'abducted'))

    if user_undead == 1:
        return Mailbox().msg("I am sorry! You cannot purify anyone while you're **Undead**!",user_channel,True)
    if victim_abducted == 1:
        return Mailbox().msg("You have attempted to purify <@{}>... but your powers cannot locate them! Strange...".format(victim_id),user_channel,True)
    if victim_frozen == 1:
        return Mailbox().msg("You wanted to purify <@{}>, but you were unable to reach them through the thick layer of ice surrounding them".format(victim_id),user_channel,True)

    answer = Mailbox()
    db_set(user_id,'uses',uses - 1)

    if victim_role in ['Cursed Civilian','Sacred Wolf']:
        answer.msg("Your powers' results were **positive**. They are no longer cursed civilians or sacred wolves!",user_channel)
        answer.log("The **Priestess** <@{}> has purified the **{}** <@{}>.".format(user_id,victim_role,victim_id))
        if victim_role == 'Cursed Civilian':
            db_set(victim_id,'role','Innocent')
            answer.dm(rolestory.to_innocent(victim_id,'Cursed Civilian'),victim_id)
        if victim_role == 'Sacred Wolf':
            db_set(victim_id,'role','Werewolf')
            answer.dm("This message yet needs to be written!",victim_id) # TODO
    elif victim_role in ['Innocent','Werewolf']:
        answer.msg("Your powers' results were **neutral**. They were already innocent or a werewolf!",user_channel)
        answer.log("The **Priestess** <@{}> has attempted to purify the **{}** <@{}>.".format(user_id,victim_role,victim_id))
    else:
        answer.msg("Your powers' results were **negative**. They weren't cursed civilians or sacred wolves, so they couldn't be purified!",user_channel)
        answer.log("The **Priestess** <@{}> has ineffectively attempted to purify the **{}** <@{}>.".format(user_id,victim_role,victim_id))

    return answer
Exemplo n.º 8
0
def start_game():
    """This function is triggered at the start of the game. If successful, the function returns a Mailbox.
    If unsuccessful, the function still returns a Mailbox, but will also confirm the error in the console."""

    # Make sure there isn't already a game going on!
    if dy.get_stage() != "NA":
        print("ERROR: According to " + dy.dynamic_config +
              ", there's already a game going on!")
        return Mailbox().respond(
            "I'm sorry! A game cannot be started while there's another one going on already!"
        )

    # Choose the roles out of the given role-pool
    role_pool = []
    for choice in view_roles():
        for i in range(choice.amount):
            role_pool.append(choice.role)

    if len(db.player_list()) > len(role_pool):
        print(
            "The game cannot be started while there are less roles available than that there are participants signed up."
        )
        return Mailbox().respond("Not enough roles to distribute available!",
                                 True)

    # If there are enough roles available, make a selection, evaluate the selection, and, if accepted, distribute the roles.
    if not pos.valid_distribution(role_pool, True):
        return Mailbox().respond(
            "I am sorry, but I cannot use an invalid distribution to start the game!",
            True)

    answer = Mailbox(True)

    attempts = 0
    while attempts < 1000:
        attempts += 1
        chosen_roles = random.sample(role_pool, len(db.player_list()))

        if pos.valid_distribution(chosen_roles, True) == True:

            answer.create_cc("Graveyard", 0, [], [], True)
            answer.create_cc("Market", 0, [], [], True)
            answer.create_cc("Reporter", 0, [], [], True)

            # Assign the roles to all users.
            user_list = db.player_list()

            for i in range(len(user_list)):
                user_id = user_list[i]
                user_role = chosen_roles[i]

                db_set(user_id, 'role', user_role)
                db_set(user_id, 'fakerole', user_role)
                db_set(user_id, 'channel', config.game_log)

                answer.log(
                    "{} - <@{}> has received the role of the `{}`!".format(
                        db_get(user_id, 'emoji'), user_id, user_role))
                answer.dm(
                    "This message is giving you your role for season `{}` of the *Werewolves* game.\n\n"
                    .format(config.season), user_id)
                answer.dm_add('Your role is `{}`.\n\n'.format(user_role))
                answer.dm_add(
                    "**You are not allowed to share a screenshot of this message!** "
                )
                answer.dm_add(
                    "You can claim whatever you want about your role, but you may under **NO** "
                )
                answer.dm_add(
                    "circumstances show this message in any way to any other participants.\n"
                )
                answer.dm_add(
                    "We hope you are happy with the role you gained, and we hope you'll enjoy the game as much as we do.\n\n"
                )
                answer.dm_add("Good luck... 🌕")

                if user_role in pos.personal_secrets:
                    answer.create_sc(user_id, user_role)
                if user_role in pos.shared_secrets:
                    answer.add_to_sc(user_id, user_role)

                if user_role == "Cult Member":
                    answer.add_to_sc(user_id, "Cult Leader")
                if user_role in pos.wolf_pack:
                    answer.add_to_sc(user_id, "Werewolf")
                if user_role == "Bloody Butcher":
                    answer.add_to_sc(user_id, "Butcher")
                if user_role == "Devil":
                    answer.add_to_sc(user_id, "Demon")
                if user_role == "Vampire":
                    answer.add_to_sc(user_id, "Undead")
                if user_role == "Witch":
                    db_set(user_id, 'uses', 3)

            answer.story(
                'The current distribution is {}'.format(chosen_roles))  # TODO
            answer.story(
                'I know, I know. That looks ugly as hell. We\'re trying to make it look good!'
            )

            if "Flute Player" in chosen_roles:
                answer.create_cc("Flute_Victims", 0, [], [], True)

            # If the four horsemen are part of the game, assign numbers to all players.
            if "Horseman" in chosen_roles:
                nothorse_table = [
                    user_id for user_id in db.player_list()
                    if db_get(user_id, 'role') != 'Horseman'
                ]
                horse_table = [
                    user_id for user_id in db.player_list()
                    if db_get(user_id, 'role') == 'Horseman'
                ]

                nothorse_table.shuffle()
                horse_table.shuffle()

                for i in range(4):
                    db_set(horse_table[i], 'horseman', i + 1)

                for i in range(16):
                    db_set(nothorse_table[i], 'horseman', (i % 4) + 1)

            # Reset the day timer
            dy.reset_day()
            dy.set_stage('Night')

            return answer.respond(
                "Very well! The game will start tomorrow morning.")

    answer.respond("Timeout reached! Your distribution is too crazy!", True)
    return answer
Exemplo n.º 9
0
def process(message, isGameMaster = False):

    user_id = message.author.id
    message_channel = message.channel.id
    user_role = db_get(user_id,'role')

    '''testcc'''
    # This function is merely a temporary one, to test if the cc creation command is working properly.
    if is_command(message,['cc','testcc','test_cc']):
        members = check.users(message)
        if len(message.content.split(' ')) == 1 or members == False:
            msg = "**Incorrect syntax:** `" + prefix + "cc <name> <user> <user> <user> ...`\n\nExample: `" + prefix + "cc the_cool_ones @Randium#6521`"
            msg += "\n\nThe bot understands both mentions and emojis linked to players."
            return [Mailbox().respond(msg,True)]
        name = message.content.split(' ')[1]
        return [Mailbox().create_cc(name,user_id,members)]
    if is_command(message,['cc','testcc','test_cc'],True):
        msg = "**Usage:** `" + prefix + "cc <name> <user> <user> <user> ...`\n\nExample: `" + prefix + "cc the_cool_ones @Randium#6521`"
        msg += "\n\nThe bot understands both mentions and emojis linked to players."
        return [Mailbox().respond(msg,True)]

    # =============================================================
    #
    #                         GAME MASTERS
    #
    # =============================================================
    if isGameMaster == True:

        '''addrole'''
        # Before the game starts, a list of roles is kept track of.
        # That list is the list of roles that will be dealt among the participants.
        # If the list is greater than the amount of participants, some random roles will be left out.
        # The game cannot start as long as this list is incomplete.
        if is_command(message,['addrole']):
            # TODO
            return todo()
        if is_command(message,['addrole'],True):
            # TODO
            return todo()

        '''assign'''
        # This command is used at the start of the game to assign all roles.
        # This will actually set their "fakerole" value, which will be transferred to their actual role once the game starts.
        if is_command(message,['assign']):
            role = check.roles(message,1)[0]
            user = check.users(message,1)[0]

            if role == False:
                return [Mailbox().respond("No role provided! Please provide us with a role!")]
            if user == False:
                return [Mailbox().respond("No user found! Please provide us with a user!")]

            db_set(user,'role',role)
            return [Mailbox().spam("You have successfully given <@{}> the role of the `{}`!".format(user,role))]

        if is_command(message,['assign'],True):
            msg = "**Usage:** `" + prefix + "assign <user> <role>`\n\nExample: `" + prefix
            msg += "assign @Randium#6521 Innocent`\nGame Master only command"
            return [Mailbox().spam(msg)]

        '''day'''
        # This command is used to initialize the day.
        if is_command(message,['day']):
            # TODO
            return todo()
        if is_command(message,['day'],True):
            # TODO
            return todo()

        '''open_signup'''
        # This command is started when a new game can be started.
        # Make sure the bot has reset itself beforehand.
        if is_command(message,['open_signup']):
            # TODO
            return todo()
        if is_command(message,['open_signup'],True):
            # TODO
            return todo()

        '''whois'''
        # This command reveals the role of a player.
        # To prevent spoilers, the response isn't made in the message's channel, but rather in the bot spam channel.
        if is_command(message,['whois']):
            user_table = check.users(message)
            identities = Mailbox()

            if user_table == False:
                return [Mailbox().respond("**ERROR:** No user provided!")]

            for user in user_table:
                emoji = db_get(user,'emoji')
                role = db_get(user,'role')
                if emoji == None or role == None:
                    identities.spam("**ERROR:** Could not find user <@{}> in database.".format(user))
                else:
                    msg = "{} - <@{}> has the role of the `{}`!".format(emoji,user,role)
                    identities.spam(msg)

            return [identities]

        if is_command(message,['whois'],True):
            msg = "**Usage:** `" + prefix + "whois <user1> <user2> ...`\n\n"
            msg += "Example: `" + prefix + "whois @Randium#6521`\nGame Master only command"
            return [Mailbox().respond(msg,True)]

    # =============================================================
    #
    #                         PARTICIPANTS
    #
    # =============================================================

    if isParticipant(user_id):

        '''add'''
        # This command allows users to add users to a conspiracy.
        # This command will not trigger if the user doesn't own the conspiracy channel.
        if is_command(message,['add']):
            members_to_add = check.users(message)
            if members_to_add == False:
                return [Mailbox().respond("I am sorry! I couldn't find the user you were looking for!",True)]
            if is_owner(user_id,message.channel.id) == False:
                return [Mailbox().respond("I\'m sorry, you can only use this in conspiracy channels where you are the owner!")]
            command = Mailbox()
            for x in members_to_add:
                command.edit_cc(x,channel_id,1)
            return [command.respond("Insert Randium's comment here")]

        if is_command(message,['add'],True):
            # TODO
            return todo()

        '''cc'''
        # This command allows users to create a conspiracy channel.
        if is_command(message, ['cc']):
            if len(message.content.split(' ')) < 2:
                    return [Mailbox().respond("**Invalid syntax:**\n\n`" + prefix + "cc <name> <user1> <user2> <user3> ...`\n\n**Example:** `" + prefix + "cc the_cool_guys @Randium#6521`")]

            channel_members = check.users(message)
            if channel_members == False:
                channel_members = []
            if user_id not in channel_members:
                channel_members.append(user_id)

            num_cc_owned = int(db_get(user_id,'ccs'))

            if num_cc_owned >= max_cc_per_user:
                answer = Mailbox().dm("You have reached the amount of conspiracy channels one may own!", user_id)
                return answer.dm("If you want more conspiracy channels, please request permission from one of the Game Masters.", user_id)

            db_set(user_id,'ccs',number_cc_owned + 1)
            return Mailbox.create_cc(message.content.split(' ')[1], user_id, channel_members)

        if is_command(message,['cc'],True):
            # TODO
            return todo()

        '''info'''
        # This command allows users to view information about a conspiracy channel.
        # Says the user must be in a cc if they're not.
        if is_command(message,['info']):
            guild = message.channel.guild
            try:
                owner_id = channel_get(message.channel.id,'owner')
            except:
                return[Mailbox().respond('Sorry, but it doesn\'t look like you\'re in a CC! If you are, please alert a Game Master as soon as possible.')]
            if owner_id != None:
                owner_object = guild.get_member(int(owner_id))
            embed = Embed(color=0x00cdcd, title='Conspiracy Channel Info')
            if owner_object != None and owner_id != None:
                embed.add_field(name='Channel Owner', value='<@' + owner_id + '>')
                embed.set_thumbnail(url=owner_object.avatar_url)
            elif owner_id == None:
                return [Mailbox().respond('Sorry, but it doesn\'t look like you\'re in a CC! If you are, please alert a Game Master as soon as possible.')]
            else:
                try:
                    owner_name = db_get(owner_id,'name')
                    if str(owner_name) == 'None':
                        owner_name = 'Sorry, an error was encountered. Please alert a Game Master.'
                except:
                    owner_name == 'Sorry, an error was encountered. Please alert a Game Master.'

                embed.add_field(name='Channel Owner', value=owner_name)

            embed.add_field(name='Channel Name', value=message.channel.name)
            embed.add_field(name='Participants', value='[Bob Roberts], [Dummy], [Randium], [BenTechy66], [Ed588]')
            embed.set_footer(text='Conspiracy Channel Information requested by ' + message.author.nick)
            return [Mailbox().embed(embed, message.channel.id)]
        if is_command(message,['info'],True):
            # TODO
            return todo()

        '''myrole'''
        # This command sends the user's role back to them in a DM.
        if is_command(message,['myrole']):
            return [Mailbox().dm("Your role is **{}**.".format(db_get(message.author.id,'role')), message.author.id,False,[db_get(message.author.id,'emoji')])]
        if is_command(message,['myrole'],True):
            # TODO
            return todo()

        '''remove'''
        # This command removes a given user from a conspiracy channel.
        # A user should not get removed if they're the channel owner.
        if is_command(message,['remove']):
            members_to_remove = check.users(message)
            if is_owner(user_id,channel_id) == False:
                return [Mailbox().respond("I\'m sorry, but you cannot use this command over here!")]
            command = Mailbox()
            for x in members_to_remove:
                if is_owner(x,channel_id) == True:
                    return [Mailbox().respond("The owner of a CC can\'t be removed! Please try again.")]
                command.edit_cc(x,channel_id,0)
            return [command.respond("Insert Randium's comment here")]

        if is_command(message,['remove'],True):
            # TODO
            return todo()

        # =======================================================
        #                ROLE SPECIFIC COMMANDS
        # =======================================================
        if personal_channel(user_id,message_channel) == True:

            '''give_amulet'''
            # This command can be executed by everyone, but only in one channel.
            # That's the amulet channel.
            # To be worked out how exactly.
            if is_command(message,['give_amulet']):
                # TODO
                return todo()
            if is_command(message,['give_amulet'],True):
                # TODO
                return todo()

            '''assassinate'''
            # Assassin's command; kill a victim
            if is_command(message,['assassinate','kill']) and user_role == "Assassin":
                # TODO
                return todo()
            if is_command(message,['assassinate','kill'],True) and user_role == "Assassin":
                # TODO
                return todo()

            '''aura'''
            # The command for aura tellers
            if is_command(message,['aura','tell','vision']) and user_role == "Aura Teller":
                # TODO
                return todo()
            if is_command(message,['aura','tell','vision'],True) and user_role == "Aura Teller":
                # TODO
                return todo()

            '''barber_kill'''
            # Barber kill - to assassinate a victim during the day
            if is_command(message,['assassinate','barber_kill','cut']) and user_role == "Barber":
                # TODO
                return todo()
            if is_command(message,['assassinate','barber_kill','cut'],True) and user_role == "Barber":
                # TODO
                return todo()

            '''seek'''
            # Crowd seeker's power
            if is_command(message,['crowd','seek']) and user_role == "Crowd Seeker":
                # TODO
                return todo()
            if is_command(message,['crowd','seek'],True) and user_role == "Crowd Seeker":
                # TODO
                return todo()

            '''kiss'''
            # Cupid's power to fall in love with someone.
            if is_command(message,['kiss','love','shoot']) and user_role == "Cupid":
                # TODO
                return todo()
            if is_command(message,['kiss','love','shoot'],True) and user_role == "Cupid":
                # TODO
                return todo()

            '''follow'''
            # The command that allows the dog to choose a side.
            if is_command(message,['bark','become','choose','follow']) and user_role == "Dog":
                # TODO
                return todo()
            if is_command(message,['bark','become','choose','follow'],True) and user_role == "Dog":
                # TODO
                return todo()

            '''execute'''
            # This command allows the executioner to choose a replacement target.
            if is_command(message,['choose','execute']) and user_role == "Executioner":
                # TODO
                return todo()
            if is_command(message,['choose','execute'],True) and user_role == "Executioner":
                # TODO
                return todo()

            '''undoom'''
            # The Exorcist's command.
            if is_command(message,['exercise','exorcise','undoom']) and user_role == "Exorcist":
                # TODO
                return todo()
            if is_command(message,['exercise','exorcise','undoom'],True) and user_role == "Exorcist":
                # TODO
                return todo()

            '''inspect'''
            # The fortune teller's command.
            if is_command(message,['forsee','inspect','see','tell']) and user_role == "Fortune Teller":
                # TODO
                return todo()
            if is_command(message,['forsee','inspect','see','tell'],True) and user_role == "Fortune Teller":
                # TODO
                return todo()

            '''silence'''
            # Grandma's command.
            if is_command(message,['knit','knot','silence']) and user_role == "Grandma":
                # TODO
                return todo()
            if is_command(message,['knit','knot','silence'],True) and user_role == "Grandma":
                # TODO
                return todo()

            '''hook'''
            # The hooker's command
            if is_command(message,['f**k','hook','sleep']) and user_role == "Hooker":
                # TODO
                return todo()
            if is_command(message,['f**k','hook','sleep'],True) and user_role == "Hooker":
                # TODO
                return todo()

            '''hunt'''
            # The huntress' command. Used to keep track of whom will be shot.
            if is_command(message,['hunt','shoot']) and user_role == "Huntress":
                # TODO
                return todo()
            if is_command(message,['hunt','shoot'],True) and user_role == "Huntress":
                # TODO
                return todo()

            '''unfreeze'''
            # The innkeeper's command
            if is_command(message,['melt','unfreeze']) and user_role == "Innkeeper":
                # TODO
                return todo()
            if is_command(message,['melt','unfreeze'],True) and user_role == "Innkeeper":
                # TODO
                return todo()

            '''copy'''
            # The Look-Alike's command
            if is_command(message,['copy','imitate','mirror','resemble']) and user_role == "Look-Alike":
                # TODO
                return todo()
            if is_command(message,['copy','imitate','mirror','resemble'],True) and user_role == "Look-Alike":
                # TODO
                return todo()

            '''holify'''
            # The Priest's command
            if is_command(message,['holify','sacrify','water']) and user_role == "Priest":
                # TODO
                return todo()
            if is_command(message,['holify','sacrify','water'],True) and user_role == "Priest":
                # TODO
                return todo()

            '''purify'''
            # The Priestess' command
            if is_command(message,['heal','light','purify','sacrify']) and user_role == "Priestess":
                # TODO
                return todo()
            if is_command(message,['heal','light','purify','sacrify'],True) and user_role == "Priestess":
                # TODO
                return todo()

            '''threaten'''
            # The Raven's command
            if is_command(message,['threaten','raven']) and user_role == "Raven":
                # TODO
                return todo()
            if is_command(message,['threaten','raven'],True) and user_role == "Raven":
                # TODO
                return todo()

            '''reveal'''
            # The Royal Knight's command
            if is_command(message,['end','prevent','reveal','stop']) and user_role == "Royal Knight":
                # TODO
                return todo()
            if is_command(message,['end','prevent','reveal','stop'],True) and user_role == "Royal Knight":
                # TODO
                return todo()

            '''life'''
            # The witch' command to use her life potion
            if is_command(message,['heal','life','save']) and user_role == "Witch":
                # TODO
                return todo()
            if is_command(message,['heal','life','save'],True) and user_role == "Witch":
                # TODO
                return todo()

            '''death'''
            # The witch' command to use her death potion
            if is_command(message,['death','kill','murder','poison']) and user_role == "Witch":
                # TODO
                return todo()
            if is_command(message,['death','kill','murder','poison'],True) and user_role == "Witch":
                # TODO
                return todo()

            '''çurse'''
            # The curse caster's command
            if is_command(message,['cast','corrupt','curse']) and user_role == "Curse Caster":
                # TODO
                return todo()
            if is_command(message,['cast','corrupt','curse'],True) and user_role == "Curse Caster":
                # TODO
                return todo()

            '''infect'''
            # The infected wolf's command
            if is_command(message,['cough','infect','sneeze','turn']) and user_role == "Infected Wolf":
                # TODO
                return todo()
            if is_command(message,['cough','infect','sneeze','turn'],True) and user_role == "Infected Wolf":
                # TODO
                return todo()

            '''devour'''
            # The Lone wolf's command
            if is_command(message,['chew','devour','eat','kill','munch']) and user_role == "Lone Wolf":
                # TODO
                return todo()
            if is_command(message,['chew','devour','eat','kill','munch'],True) and user_role == "Lone Wolf":
                # TODO
                return todo()

            '''disguise'''
            # The tanner's command
            if is_command(message,['change','cloth','disguise','hide']) and user_role == "Tanner":
                # TODO
                return todo()
            if is_command(message,['change','cloth','disguise','hide'],True) and user_role == "Tanner":
                # TODO
                return todo()

            '''inspect'''
            # The Warlock's command
            if is_command(message,['forsee','inspect','see','tell']) and user_role == "Priestess":
                # TODO
                return todo()
            if is_command(message,['forsee','inspect','see','tell'],True) and user_role == "Priestess":
                # TODO
                return todo()

            '''devour'''
            # The white werewolf's command
            if is_command(message,['chew','devour','eat','kill','munch']) and user_role == "White Werewolf":
                # TODO
                return todo()
            if is_command(message,['chew','devour','eat','kill','munch'],True) and user_role == "White Werewolf":
                # TODO
                return todo()

            '''wager'''
            # The devil's command
            if is_command(message,['choose','wager']) and user_role == "Devil":
                # TODO
                return todo()
            if is_command(message,['choose','wager'],True) and user_role == "Devil":
                # TODO
                return todo()

            '''enchant'''
            # The flute player's command
            if is_command(message,['enchant','flute']) and user_role == "Flute Player":
                # TODO
                return todo()
            if is_command(message,['enchant','flute'],True) and user_role == "Flute Player":
                # TODO
                return todo()

            '''unite'''
            # The horseman's command
            if is_command(message,['apocalypse','clean','unite']) and user_role == "Horseman":
                # TODO
                return todo()
            if is_command(message,['apocalypse','clean','unite'],True) and user_role == "Horseman":
                # TODO
                return todo()

            '''guess'''
            # The ice king's command to add a guess about a user to their list.
            # Note that this command could/should be usable at any time, as long as the submit command isn't
            if is_command(message,['add','guess','freeze']) and user_role == "Ice King":
                # TODO
                return todo()
            if is_command(message,['add','guess','freeze'],True) and user_role == "Ice King":
                # TODO
                return todo()

            '''submit'''
            # The ice king's command to submit the list of people of whom they have guessed their roles.
            if is_command(message,['guess_that','freeze_all','submit']) and user_role == "Ice King":
                # TODO
                return todo()
            if is_command(message,['guess_that','freeze_all','submit'],True) and user_role == "Ice King":
                # TODO
                return todo()

            '''powder'''
            # Powder a player
            if is_command(message,['creeper','powder']) and user_role == "Pyromancer":
                # TODO
                return todo()
            if is_command(message,['creeper','powder'],True) and user_role == "Pyromancer":
                # TODO
                return todo()

            '''abduct'''
            # To kidnap players
            if is_command(message,['abduct','add','kidnap','swamp']) and user_role == "The Thing":
                # TODO
                return todo()
            if is_command(message,['abduct','add','kidnap','swamp'],True) and user_role == "The Thing":
                # TODO
                return todo()

            '''create_swamp'''
            # To create a new swamp with all victims
            if is_command(message,['abduct_all','create_swamp','start_cliche_horror_movie']) and user_role == "The Thing":
                # TODO
                return todo()
            if is_command(message,['abduct_all','create_swamp','start_cliche_horror_movie'],True) and user_role == "The Thing":
                # TODO
                return todo()

    # =============================================================
    #
    #                         EVERYONE
    #
    # =============================================================

    '''age'''
    # Allows users to set their age.
    if is_command(message,['age']):
        # TODO
        return todo()
    if is_command(message,['age'],True):
        # TODO
        return todo()

    '''profile'''
    # This command allows one to view their own profile
    # When giving another player's name, view that player's profile
    if is_command(message,['profile']):
        # TODO
        return todo()
    if is_command(message,['profile'],True):
        # TODO
        return todo()

    '''signup'''
    # This command signs up the player with their given emoji, assuming there is no game going on.
    if is_command(message,['signup']):
        emojis = check.emojis(message)
        choice_emoji = ""

        if emojis == False:
            msg = "**Incorrect syntax:** `" + prefix + "signup <emoji>`\n\nExample: `" + prefix + "signup :smirk:`"
            return [Mailbox().respond(msg,True)]

        for emoji in emojis:
            if emoji_to_player(emoji) == None:
                choice_emoji = emoji
                break

        if isParticipant(user_id,True,True):
            if choice_emoji == "":
               return [Mailbox().respond("You are already signed up with the {} emoji! Also, your emoji was occupied.".format(db_get(user_id,'emoji')),True)]
            db_set(user_id,'emoji',choice_emoji)
            reaction = Mailbox().respond("You have successfully changed your emoji to the {} emoji!".format(choice_emoji))
            return [reaction.spam("<@{}> has changed their emoji to the {} emoji.".format(user_id,choice_emoji))]

        if emoji == "":
            if len(choice_emojis) == 1:
                return [Mailbox().respond("I am sorry! Your chosen emoji was already occupied.",True)]
            return [Mailbox().respond("I am sorry, but all of your given emojis were already occupied! Such bad luck.",True)]
        signup(user_id,message.author.name,choice_emoji)
        reaction = Mailbox().respond("You have successfully signed up with the {} emoji!".format(choice_emoji))
        return [reaction.spam("<@{}> has signed up with the {} emoji.".format(user_id,choice_emoji))]
    # Help command
    if is_command(message,['signup'],True):
        msg = "**Usage:** `" + prefix + "signup <emoji>`\n\nExample: `" + prefix + "signup :smirk:`"
        return [Mailbox().respond(msg,True)]

    if message.content.startswith(prefix):
        return [Mailbox().respond("Sorry bud, couldn't find what you were looking for.",True)]

    return []