public static void main( String[] args ) throws IOException
{
HashMap<String, String> configMap = ConfigLoader.getConfigLoader().configMap;
int i = 0;
TS3Config config1 = new TS3Config();
config1.setHost( configMap.get( "host" ) );
config1.setDebugLevel( Level.OFF );
config1.setDebugToFile( true );
config1.setLoginCredentials( configMap.get( "loginnname" ), configMap.get( "loginpassword" ) );
config1.setFloodRate( TS3Query.FloodRate.DEFAULT );
TS3Query query = new TS3Query( config1 );
query.connect();
TS3Api api = query.getApi();
api.selectVirtualServerById( 1 );
api.setNickname( "test" );
// api.sendChannelMessage( "test" );
api.registerAllEvents();
api.addTS3Listeners( new TS3ListenerAdapter()
{
@Override
public void onTextMessage( TextMessageEvent e )
{
System.err.println( "hey!" );
}
} );
System.err.println( "test" );
List<Channel> l = api.getChannels();
query.exit();
HashMap<String, CallableFunction> map = new HashMap<>();
map.put( "!echo", new EchoBotFunction() );
map.put( "!fun", new FunBotFunction() );
map.put( "!move", new MoveFunction() );
CommandHandler handler = new CommandHandler( 1, map );
handler.run();
BotConfiguration conf = new BotConfiguration( "config\\config.cfg" );
TS3Config config2 = new TS3Config();
config2.setHost( configMap.get( "host" ) );
config2.setDebugLevel( Level.ALL );
config2.setDebugToFile( true );
config2.setLoginCredentials(conf.getLoginName(), conf.getLoginPassword() );
config2.setFloodRate( TS3Query.FloodRate.DEFAULT );
TS3Query query1 = new TS3Query( config2 );
TS3BotChannelListener bot1 = new TS3BotChannelListener( query1, true, handler, 26 );