I don't know how to get list of users on channel and how to get messages of another users.... I think, messages should be in some queue, but I can't find anyone....Could somebody help?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
if you use ActiveChannelSync then you can use:
Channel chan = irc.GetChannel"#foo");
foreach(ChannelUser cuser in chan.Users) [
Console.WriteLine(cuser.Nick);
}
all messages are handled via events so just stick to the right event and there you go, e.g. (those always work, no channel sync required):
irc.OnChannelMessage += new IrcEventHandler(MyChannelMessages);
don't expect copy/paste working code from me, the problem is simple, chan.Users is a hashtable and you want to loop through the values so it must be chan.Users.Values, that's all.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In fact, Gnosmirc is like SmartIrc4net OpenSource, means the sourcecode is public available. Currently only via subversion though, releases I will do when it hits beta state, too many changes are going on in Gnosmirc.
You can make a SVN checkout if you like:
svn checkout svn://svn.qnetp.net/gnosmirc/Gnosmirc/trunk
It's probably in a not working state because I am doing the core rewrite...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry for stupid question.
I don't know how to get list of users on channel and how to get messages of another users.... I think, messages should be in some queue, but I can't find anyone....Could somebody help?
The example bot should show you how todo that, also read the article at:
http://www.developerland.net/Web/General/245.aspx
if you use ActiveChannelSync then you can use:
Channel chan = irc.GetChannel"#foo");
foreach(ChannelUser cuser in chan.Users) [
Console.WriteLine(cuser.Nick);
}
all messages are handled via events so just stick to the right event and there you go, e.g. (those always work, no channel sync required):
irc.OnChannelMessage += new IrcEventHandler(MyChannelMessages);
void MyChannelMessages(object sender, IrcEventArgs e) {
Console.WriteLine(e.Data.Nick+" said: "+e.Data.Message);
}
Hi Mirco,
When I try you code i've an exception in the foreach:
'System.InvalidCastException': Specified cast is not valid.
Merry Chrismas :)
John
don't expect copy/paste working code from me, the problem is simple, chan.Users is a hashtable and you want to loop through the values so it must be chan.Users.Values, that's all.
Marvelous that works like a charm.
You rocks man ! :-)
Best Regards
John
PS: Will you post in future the source code of Gnosmirc ? It looks great :-)
In fact, Gnosmirc is like SmartIrc4net OpenSource, means the sourcecode is public available. Currently only via subversion though, releases I will do when it hits beta state, too many changes are going on in Gnosmirc.
You can make a SVN checkout if you like:
svn checkout svn://svn.qnetp.net/gnosmirc/Gnosmirc/trunk
It's probably in a not working state because I am doing the core rewrite...