1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
//! Twitch messages that can be parsed from `IrcMessage`, or subscribed to from the `Dispatcher`
//!
//!
//! # Converting from an `IrcMessage` to a specific message
//!
//! ```
//! let input = ":user!user@user PRIVMSG #test_channel :this is some data\r\n";
//! let irc_msg = twitchchat::irc::parse(input).next().unwrap().unwrap();
//!
//! // this is implemented for all of the types in this module
//! use twitchchat::FromIrcMessage;
//! use twitchchat::messages::Privmsg;
//! // this will produce an error if its not this type of message
//! let pm = Privmsg::from_irc(irc_msg).unwrap();
//! assert_eq!(pm.data(), "this is some data");
//! ```
//!
//! # Converting an `IrcMessage` to an enum of all possible messages
//!
//! ```
//! let input = ":user!user@user PRIVMSG #test_channel :this is some data\r\n";
//! let irc_msg = twitchchat::irc::parse(input).next().unwrap().unwrap();
//!
//! // this is implemented for all of the tyupes in this module
//! use twitchchat::FromIrcMessage;
//! use twitchchat::messages::Commands;
//!
//! let all = Commands::from_irc(irc_msg).unwrap();
//! assert!(matches!(all, Commands::Privmsg{..}));
//! ```
//!
pub use Commands;
pub use IrcReady;
pub use Ready;
pub use ;
pub use ClearChat;
pub use ClearMsg;
pub use GlobalUserState;
pub use ;
pub use Join;
pub use ;
pub use Part;
pub use Ping;
pub use Pong;
pub use Privmsg;
pub use Reconnect;
pub use ;
pub use ;
pub use UserState;
pub use Whisper;
pub use crate IrcMessage;