
def setchatname(bot, event, *args):
    """Set a chat name. If no parameters given, remove chat name"""

    truncatelength = 32 # What should the maximum length of the chatroom be?
    chatname = ' '.join(args).strip()
    chatname = chatname[0:truncatelength]

    bot.initialise_memory(event.conv_id, "conv_data")

    bot.memory.set_by_path(["conv_data", event.conv_id, "chatname"], chatname)

    bot.memory.save()

    if(chatname == ''):
        bot.send_message_parsed(event.conv, "Removing chatname")
    else:
        bot.send_message_parsed(
            event.conv,
            "Setting chatname to '{}'".format(chatname))


def setchatname(bot, event, *args):
    """Set a chat name. If no parameters given, remove chat name"""

    truncatelength = 32 # What should the maximum length of the chatroom be?
    chatname = ' '.join(args).strip()
    chatname = chatname[0:truncatelength]

    bot.initialise_memory(event.conv_id, "conv_data")

    bot.memory.set_by_path(["conv_data", event.conv_id, "chatname"], chatname)

    bot.memory.save()

    if(chatname == ''):
        bot.send_message_parsed(event.conv, "Removing chatname")
    else:
        bot.send_message_parsed(
            event.conv,
            "Setting chatname to '{}'".format(chatname))

    """Rename Hangout"""
    yield from bot._client.setchatname(event.conv_id, ' '.join(args))

Make hangout rename itself after setchatname is called
Make hangout rename itself after setchatname is called

  
  def setchatname(bot, event, *args):
      """Set a chat name. If no parameters given, remove chat name"""
  
      truncatelength = 32 # What should the maximum length of the chatroom be?
      chatname = ' '.join(args).strip()
      chatname = chatname[0:truncatelength]
  
      bot.initialise_memory(event.conv_id, "conv_data")
  
      bot.memory.set_by_path(["conv_data", event.conv_id, "chatname"], chatname)
  
      bot.memory.save()
  
      if(chatname == ''):
          bot.send_message_parsed(event.conv, "Removing chatname")
      else:
          bot.send_message_parsed(
              event.conv,
              "Setting chatname to '{}'".format(chatname))
  
+     """Rename Hangout"""
+     yield from bot._client.setchatname(event.conv_id, ' '.join(args))
+ 
Make hangout rename itself after setchatname is called
## Code Before:

def setchatname(bot, event, *args):
    """Set a chat name. If no parameters given, remove chat name"""

    truncatelength = 32 # What should the maximum length of the chatroom be?
    chatname = ' '.join(args).strip()
    chatname = chatname[0:truncatelength]

    bot.initialise_memory(event.conv_id, "conv_data")

    bot.memory.set_by_path(["conv_data", event.conv_id, "chatname"], chatname)

    bot.memory.save()

    if(chatname == ''):
        bot.send_message_parsed(event.conv, "Removing chatname")
    else:
        bot.send_message_parsed(
            event.conv,
            "Setting chatname to '{}'".format(chatname))

## Instruction:
Make hangout rename itself after setchatname is called
## Code After:

def setchatname(bot, event, *args):
    """Set a chat name. If no parameters given, remove chat name"""

    truncatelength = 32 # What should the maximum length of the chatroom be?
    chatname = ' '.join(args).strip()
    chatname = chatname[0:truncatelength]

    bot.initialise_memory(event.conv_id, "conv_data")

    bot.memory.set_by_path(["conv_data", event.conv_id, "chatname"], chatname)

    bot.memory.save()

    if(chatname == ''):
        bot.send_message_parsed(event.conv, "Removing chatname")
    else:
        bot.send_message_parsed(
            event.conv,
            "Setting chatname to '{}'".format(chatname))

    """Rename Hangout"""
    yield from bot._client.setchatname(event.conv_id, ' '.join(args))
