author | unC0Rr |
Tue, 03 Sep 2024 13:56:35 +0200 | |
branch | transitional_engine |
changeset 16058 | 9cbd18220eb7 |
parent 15836 | d9db7b763bd1 |
permissions | -rw-r--r-- |
15811
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
1 |
use lapin::{ |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
2 |
message::Delivery, options::*, types::FieldTable, BasicProperties, Connection, |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
3 |
ConnectionProperties, |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
4 |
}; |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
5 |
use tokio_amqp::*; |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
6 |
|
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
7 |
use futures::prelude::*; |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
8 |
use irc::client::prelude::*; |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
9 |
|
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
10 |
use anyhow::{bail, Result as AHResult}; |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
11 |
|
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
12 |
use url::Url; |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
13 |
|
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
14 |
use rand::distributions::Alphanumeric; |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
15 |
use rand::{thread_rng, Rng}; |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
16 |
|
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
17 |
fn url2irc_config(url: &str) -> AHResult<Config> { |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
18 |
let url = Url::parse(url)?; |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
19 |
|
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
20 |
if url.scheme() != "irc" { |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
21 |
bail!("Expected 'irc' scheme") |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
22 |
} |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
23 |
|
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
24 |
Ok(Config { |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
25 |
nickname: Some(url.username().to_owned()), |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
26 |
nick_password: url.password().map(|s| s.to_owned()), |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
27 |
server: url.host_str().map(|s| s.to_owned()), |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
28 |
port: url.port(), |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
29 |
channels: vec![format!("#{}", &url.path()[1..])], |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
30 |
//use_mock_connection: true, |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
31 |
..Config::default() |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
32 |
}) |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
33 |
} |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
34 |
|
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
35 |
fn random_string(size: usize) -> String { |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
36 |
thread_rng() |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
37 |
.sample_iter(&Alphanumeric) |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
38 |
.take(size) |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
39 |
.map(char::from) |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
40 |
.collect() |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
41 |
} |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
42 |
|
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
43 |
async fn handle_irc(pub_channel: &lapin::Channel, irc_message: &Message) -> AHResult<()> { |
15836 | 44 |
match &irc_message.command { |
45 |
Command::PRIVMSG(msgtarget, message) => { |
|
46 |
let target = irc_message |
|
47 |
.response_target() |
|
48 |
.expect("Really expected PRIVMSG would have a source"); |
|
49 |
let target = if target.starts_with('#') { |
|
50 |
&target[1..] |
|
51 |
} else { |
|
52 |
&target |
|
53 |
}; |
|
15811
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
54 |
|
15836 | 55 |
let who = irc_message.source_nickname().unwrap_or(msgtarget); |
15814 | 56 |
|
15836 | 57 |
if message.starts_with("!") { |
58 |
if let Some((cmd, param)) = message.split_once(' ') { |
|
59 |
pub_channel |
|
60 |
.basic_publish( |
|
61 |
"irc", |
|
62 |
&format!("cmd.{}.{}", &cmd[1..], target), |
|
63 |
BasicPublishOptions::default(), |
|
64 |
format!("{}\n{}", who, param).as_bytes().to_vec(), |
|
65 |
BasicProperties::default(), |
|
66 |
) |
|
67 |
.await?; |
|
68 |
} else { |
|
69 |
pub_channel |
|
70 |
.basic_publish( |
|
71 |
"irc", |
|
72 |
&format!("cmd.{}.{}", &message[1..], target), |
|
73 |
BasicPublishOptions::default(), |
|
74 |
who.as_bytes().to_vec(), |
|
75 |
BasicProperties::default(), |
|
76 |
) |
|
77 |
.await?; |
|
78 |
} |
|
15811
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
79 |
} else { |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
80 |
pub_channel |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
81 |
.basic_publish( |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
82 |
"irc", |
15836 | 83 |
&format!("msg.{}", target), |
15811
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
84 |
BasicPublishOptions::default(), |
15836 | 85 |
format!("{}\n{}", who, message).as_bytes().to_vec(), |
15811
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
86 |
BasicProperties::default(), |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
87 |
) |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
88 |
.await?; |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
89 |
} |
15836 | 90 |
} |
91 |
Command::JOIN(channel, _, _) => { |
|
15811
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
92 |
pub_channel |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
93 |
.basic_publish( |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
94 |
"irc", |
15836 | 95 |
&format!("join.{}", &channel[1..]), |
15811
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
96 |
BasicPublishOptions::default(), |
15836 | 97 |
irc_message |
98 |
.source_nickname() |
|
99 |
.expect("Hey, who joined?") |
|
100 |
.as_bytes() |
|
101 |
.to_vec(), |
|
15811
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
102 |
BasicProperties::default(), |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
103 |
) |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
104 |
.await?; |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
105 |
} |
15836 | 106 |
Command::PART(channel, _) => { |
107 |
pub_channel |
|
108 |
.basic_publish( |
|
109 |
"irc", |
|
110 |
&format!("part.{}", &channel[1..]), |
|
111 |
BasicPublishOptions::default(), |
|
112 |
irc_message |
|
113 |
.source_nickname() |
|
114 |
.expect("Hey, who left?") |
|
115 |
.as_bytes() |
|
116 |
.to_vec(), |
|
117 |
BasicProperties::default(), |
|
118 |
) |
|
119 |
.await?; |
|
120 |
} |
|
121 |
_ => (), |
|
15811
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
122 |
} |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
123 |
|
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
124 |
Ok(()) |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
125 |
} |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
126 |
|
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
127 |
async fn handle_amqp( |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
128 |
irc_client: &mut Client, |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
129 |
irc_channel: &str, |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
130 |
delivery: Delivery, |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
131 |
) -> AHResult<()> { |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
132 |
let message = String::from_utf8(delivery.data)?; |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
133 |
Ok(irc_client.send_privmsg(irc_channel, message)?) |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
134 |
} |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
135 |
|
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
136 |
#[tokio::main] |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
137 |
async fn main() -> AHResult<()> { |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
138 |
let amqp_url = std::env::var("AMQP_URL").expect("expected AMQP_URL env variabe"); |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
139 |
let irc_url = std::env::var("IRC_URL").expect("expected IRC_URL env variabe"); |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
140 |
let conn = Connection::connect(&amqp_url, ConnectionProperties::default().with_tokio()).await?; |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
141 |
|
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
142 |
let pub_channel = conn.create_channel().await?; |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
143 |
let sub_channel = conn.create_channel().await?; |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
144 |
|
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
145 |
let irc_config = url2irc_config(&irc_url)?; |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
146 |
let irc_channel = irc_config.channels[0].to_owned(); |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
147 |
let mut irc_client = Client::from_config(irc_config).await?; |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
148 |
let mut irc_stream = irc_client.stream()?; |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
149 |
irc_client.identify()?; |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
150 |
|
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
151 |
let queue = sub_channel |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
152 |
.queue_declare( |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
153 |
&random_string(32), |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
154 |
QueueDeclareOptions { |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
155 |
exclusive: true, |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
156 |
auto_delete: true, |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
157 |
..QueueDeclareOptions::default() |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
158 |
}, |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
159 |
FieldTable::default(), |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
160 |
) |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
161 |
.await?; |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
162 |
|
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
163 |
sub_channel |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
164 |
.queue_bind( |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
165 |
queue.name().as_str(), |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
166 |
"irc", |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
167 |
&format!("say.{}", &irc_channel[1..]), |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
168 |
QueueBindOptions::default(), |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
169 |
FieldTable::default(), |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
170 |
) |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
171 |
.await?; |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
172 |
|
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
173 |
let mut subscriber = sub_channel |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
174 |
.basic_consume( |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
175 |
queue.name().as_str(), |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
176 |
&random_string(32), |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
177 |
BasicConsumeOptions::default(), |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
178 |
FieldTable::default(), |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
179 |
) |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
180 |
.await?; |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
181 |
|
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
182 |
loop { |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
183 |
tokio::select! { |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
184 |
Some(irc_message) = irc_stream.next() => handle_irc(&pub_channel, &irc_message?).await?, |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
185 |
Some(amqp_message) = subscriber.next() => { |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
186 |
let (_, delivery) = amqp_message.expect("error in consumer"); |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
187 |
delivery |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
188 |
.ack(BasicAckOptions::default()) |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
189 |
.await?; |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
190 |
|
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
191 |
handle_amqp(&mut irc_client, &irc_channel, delivery).await? |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
192 |
} |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
193 |
} |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
194 |
} |
d97ea528ce95
Add main module for irc bot which serves as an irc<>rabbitmq relay
unc0rr
parents:
diff
changeset
|
195 |
} |