Class IrcClient
The NetIRC IRC client
Inheritance
Implements
Inherited Members
Namespace: GravyIrc
Assembly: GravyIrc.dll
Syntax
public class IrcClient : IDisposable
Constructors
| Improve this Doc View SourceIrcClient(User, IConnection)
Initializes a new instance of the IRC client with a User and an IConnection implementation
Declaration
public IrcClient(User user, IConnection connection)
Parameters
Type | Name | Description |
---|---|---|
User | user | User who wishes to connect to the server |
IConnection | connection | IConnection implementation |
IrcClient(User, String, IConnection)
Declaration
public IrcClient(User user, string password, IConnection connection)
Parameters
Type | Name | Description |
---|---|---|
User | user | |
System.String | password | |
IConnection | connection |
Properties
| Improve this Doc View SourceChannels
An observable collection representing the channels we joined
Declaration
public ChannelCollection Channels { get; }
Property Value
Type | Description |
---|---|
ChannelCollection |
EventHub
Provides you a way to handle various IRC events like OnPing and OnPrivMsg
Declaration
public EventHub EventHub { get; }
Property Value
Type | Description |
---|---|
EventHub |
Peers
An observable collection representing all peers (users) the client knows about It can be channel users, or query users (private chat)
Declaration
public UserCollection Peers { get; }
Property Value
Type | Description |
---|---|
UserCollection |
Queries
An observable collection representing all queries (private chat)
Declaration
public QueryCollection Queries { get; }
Property Value
Type | Description |
---|---|
QueryCollection |
User
Represents the user used to connect to the server
Declaration
public User User { get; }
Property Value
Type | Description |
---|---|
User |
Methods
| Improve this Doc View SourceConnectAsync(String, Int32)
Connects to the specified IRC server using the specified port number
Declaration
public Task ConnectAsync(string host, int port = 6667)
Parameters
Type | Name | Description |
---|---|---|
System.String | host | IRC server address |
System.Int32 | port | Port number |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | The task object representing the asynchronous operation |
Dispose()
Disposes the connection
Declaration
public void Dispose()
SendAsync(IClientMessage)
Allows you to send a strong typed client message to the IRC server
Declaration
public Task SendAsync(IClientMessage message)
Parameters
Type | Name | Description |
---|---|---|
IClientMessage | message | An implementation of IClientMessage. Check NetIRC.Messages namespace |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | The task object representing the asynchronous operation |
SendRaw(String)
Allows you to send raw data the the IRC server
Declaration
public Task SendRaw(string rawData)
Parameters
Type | Name | Description |
---|---|---|
System.String | rawData | The raw data to be sent |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | The task object representing the asynchronous operation |
Events
| Improve this Doc View SourceOnDisconnect
Indicates that the connection to the IRC server has been terminated or lost
Declaration
public event EventHandler OnDisconnect
Event Type
Type | Description |
---|---|
System.EventHandler |
OnIrcMessageParsed
Indicates that we have parsed the message and gives you a strong typed representation of it You get the prefix, command, parameters and some other goodies
Declaration
public event ParsedIrcMessageHandler OnIrcMessageParsed
Event Type
Type | Description |
---|---|
ParsedIrcMessageHandler |
OnRawDataReceived
Indicates that we received raw data from the server and gives you access to the data
Declaration
public event IrcRawDataHandler OnRawDataReceived
Event Type
Type | Description |
---|---|
IrcRawDataHandler |