Package com.github.theholywaffle.teamspeak3.api.wrapper

Examples of com.github.theholywaffle.teamspeak3.api.wrapper.ChannelGroup


        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() );
View Full Code Here



   @Override
   public void callAction( String[] params, TS3BotChannelListener source, TextMessageEvent eventSource )
   {
      TS3Api api = source.getTS3Api();
      Random random = new Random();
      List<Channel> channelList = ApiUtils.filterPasswordProtectedChannels( api.getChannels() );
      Channel sourceChannel =  ApiUtils.getChannelById( channelList, source.getChannelId() );
      List<Client>  clientList  = ApiUtils.filterClientsFromOtherChannels( api.getClients(), sourceChannel );
      Channel channel = channelList.get( random.nextInt( channelList.size() ) );
      Client  client  = clientList.get( random.nextInt( clientList.size() ) );

      if( params.length > 1 )
         api.moveClient( eventSource.getInvokerId(), channel.getId() );
      else
         api.moveClient( client.getId(), channel.getId() );
   }
View Full Code Here

    public void callAction(String[] params, TS3BotChannelListener source, TextMessageEvent eventSource)
    {
        if( params.length < 3 )
            return;

        TS3Api api = source.getTS3Api();

        switch( params[1] )
        {
            case fMOVE_CHANNEL_CLIENTS:
                Channel channelSrc = ApiUtils.getChannelById( api.getChannels(), source.getChannelId() );
                moveChannelClients( api, channelSrc, params[2] );
                break;
            default:
                printUsage( api );
                break;
View Full Code Here

    config.setLoginCredentials("serveradmin", "serveradminpassword");
   
    final TS3Query query = new TS3Query(config);
    query.connect();
   
    final TS3Api api = query.getApi();
    api.selectVirtualServerById(1);
    api.setNickname("PutPutBot");
    api.sendChannelMessage("PutPutBot is online!");
   
    HashMap<ChannelProperty,String> properties = new HashMap<>();
    properties.put(ChannelProperty.CHANNEL_FLAG_PERMANENT, "1"); //Make channel permanent
    properties.put(ChannelProperty.CPID, "3"); //Make it a subchannel of channel 3
   
    api.createChannel("New Channel", properties); //Create the channel with our properties :)
  }
View Full Code Here

    config.setLoginCredentials("serveradmin", "serveradminpassword");
   
    final TS3Query query = new TS3Query(config);
    query.connect();
   
    final TS3Api api = query.getApi();
    api.selectVirtualServerById(1);
    api.setNickname("PutPutBot");
    api.sendChannelMessage("PutPutBot is online!");

    api.registerAllEvents();
    api.addTS3Listeners(new TS3Listener() {

      public void onTextMessage(TextMessageEvent e) {
        System.out.println("Text message received in "
            + e.getTargetMode());
      }
View Full Code Here

    config.setLoginCredentials("serveradmin", "serveradminpassword");
   
    final TS3Query query = new TS3Query(config);
    query.connect();
   
    final TS3Api api = query.getApi();
    api.selectVirtualServerById(1);
    api.setNickname("PutPutBot");
    api.sendChannelMessage("PutPutBot is online!");
   
    api.registerAllEvents();
    api.addTS3Listeners(new TS3Listener() {
     
      public void onTextMessage(TextMessageEvent e) {
        if(e.getTargetMode()== TextMessageTargetMode.CHANNEL){//Only react to channel messages
          if(e.getMessage().equals("!ping")){
            api.sendChannelMessage("pong");
          }
          if(e.getMessage().toLowerCase().contains("hello")){
            api.sendChannelMessage("Hello "+e.getInvokerName());
          }
        }
      }
     
      public void onServerEdit(ServerEditedEvent e) {
View Full Code Here

    config.setLoginCredentials("serveradmin", "serveradminpassword");
   
    final TS3Query query = new TS3Query(config);
    query.connect();
   
    final TS3Api api = query.getApi();
    api.selectVirtualServerById(1);
    api.setNickname("PutPutBot");
    api.sendChannelMessage("PutPutBot is online!");

    for (Client c : api.getClients()) {
      System.out.println(c.getNickname() + " in channel: "
          + api.getChannelInfo(c.getChannelId()).getName());
    }
  }
View Full Code Here


    // initially connects to the ts3-server so the ts3-objects which are needed to manage the ts3 server stuff
    private void initialConnect()
    {
        TS3Config config = getServerConfig();
        mQuery = new TS3Query( config );
        mQuery.connect();
        mApi   = mQuery.getApi();
        mApi.selectVirtualServerById( 1 );
        sfLogger.log( Level.INFO, "Connected to the TS3-server \"" + mBotConfiguration.getHostName() + "\" using " +
View Full Code Here


    // returns a TS3Config, configurated to connect to the server given by the BotConfiguration
    private TS3Config getServerConfig()
    {
        TS3Config config = new TS3Config();
        config.setHost( mBotConfiguration.getHostName() );
        config.setLoginCredentials( mBotConfiguration.getLoginName(), mBotConfiguration.getLoginPassword() );

        return config;
    }
View Full Code Here

    }


    public TS3Config getConfig()
    {
        TS3Config cfg = new TS3Config();
        cfg.setHost( this.mConfig.getHostName() );
        cfg.setLoginCredentials( this.mConfig.getLoginName(), this.mConfig.getLoginPassword() );
        cfg.setDebugLevel( Level.ALL );

        return cfg;
    }
View Full Code Here

TOP

Related Classes of com.github.theholywaffle.teamspeak3.api.wrapper.ChannelGroup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.