package main

import (
	"fmt"
	"strconv"
	"strings"
)

func doGetNextAutoTopic() {
	if err := me.chats.ConfigLoad(); err != nil {
		badExit(err)
	}
	max := 0
	for _, chat := range me.chats.GetChats() {
		if strings.HasPrefix(chat.GetChatName(), "Auto ") {
			numStr := strings.TrimPrefix(chat.GetChatName(), "Auto ")
			num, err := strconv.Atoi(numStr)
			if err == nil && num > max {
				max = num
			}
		}
	}
	fmt.Printf("Auto %d", max+1)
}
