Central Forums Helpbot
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Pages: [1]   Go Down
Print
Topic: bot joining a external channel.  (Read 1442 times)
« on: January 05, 2011, 03:04:36 PM »
IRAID DEV
Freshman

View Profile WWW
*

Epeen: 0
Posts: 32


Hi,


Working on a project where i want my bot to join a private channel.


As far as i can tell bot have currently no event trigger when invited to a private channel?
And looking inside the source i am pretty sure i need to add this event to "Events.cs" correct?


So would i be able to do this without having to make a custom build?



All input appreciated Smiley
Logged
« Reply #1 on: January 16, 2011, 12:18:10 AM »
Apprentice coder
VhaBot Developers
Novice

View Profile
***

Epeen: 4
Posts: 446


There is no provision in the AoChat library for handling the packets concerning a bot joining a private channel.

This has been implemented in the new Vha.Net libraries .. but there is no way to backport these to Vhabot currently.

Patching an event to 'Events.cs' is only the start of the coding.... !
Logged
« Reply #2 on: August 09, 2011, 11:50:51 AM »
IRAID DEV
Freshman

View Profile WWW
*

Epeen: 0
Posts: 32


I know this is a old topic, but yea i managed to get vhabot to enter a private channel.



Heres a snippet i use in "Chat.cs":



Code:
        protected virtual void OnPrivateGroupRequestEvent(PrivateChannelRequestEventArgs e)
        {
            Console.WriteLine("Invited to group " + this.GetUserName(e.PrivateGroupID));

            string user = this.GetUserName(e.PrivateGroupID);
            //int pos = user.IndexOf("Iraid");

            if (user.IndexOf("Iraid") != -1)
            {
                Console.WriteLine("Invited by a bot in the iraidnetwork accepting invite ");
                SimpleIdPacket packet = new SimpleIdPacket(Packet.Type.PRIVGRP_JOIN, e.PrivateGroupID);
                this.SendPacket(packet);
            }

            if (this.PrivateChannelRequestEvent != null)
            {
                Console.WriteLine("accept invite");
                this.PrivateChannelRequestEvent(this, e);
            }
        }

With this bot can be much more modular, 1 bot host the channel while another then handles all commands, this enables me to run updates on the bot in "real time" or pretty close to it.
Logged
Pages: [1]   Go Up
Print
Jump to: