config.setFloodRate( TS3Query.FloodRate.DEFAULT );
final TS3Query query = new TS3Query( config );
query.connect();
final TS3Api api = query.getApi();
api.selectVirtualServerById( 1 );
api.setNickname( "PutPutBot" );
System.out.println( "send now!" );
if( api.getChannels() == null )
System.err.println( "null" );
api.registerAllEvents();
api.addTS3Listeners( new TS3Listener()
{
@Override
public void onTextMessage( TextMessageEvent e )
{
System.out.println( e.getMessage() );
}
@Override
public void onClientJoin( ClientJoinEvent e )
{
}
@Override
public void onClientLeave( ClientLeaveEvent e )
{
}
@Override
public void onServerEdit( ServerEditedEvent e )
{
}
@Override
public void onChannelEdit( ChannelEditedEvent e )
{
}
@Override
public void onChannelDescriptionChanged( ChannelDescriptionEditedEvent e )
{
}
@Override
public void onClientMoved( ClientMovedEvent e )
{
}
} );
System.out.println( api.moveClient( searchForChannel( "Lernen", api.getChannels() ).getId() ) );
api.sendChannelMessage( "PutPutBot is online!" );
}