Check-in [b543dce9f7]
Logged in as anonymous
Overview
Comment:fix command processing
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: b543dce9f743061ab1bb4ecd15dbbe1f3107699fc486cac1f1c04574cfd3bba5
User & Date: arcade on 2024-08-03 06:22:25.618
Other Links: manifest | tags
Context
2024-08-28
08:30
change backend library fork, fix error handling and throttling check-in: 1c444d34ff user: arcade tags: trunk, v0.2.23
2024-08-03
06:22
fix command processing check-in: b543dce9f7 user: arcade tags: trunk
2024-08-02
07:56
add throtling, bump libraries, utilize http2 check-in: 79c91a5357 user: arcade tags: trunk, v0.2.22
Changes
31
32
33
34
35
36
37
38
39

40
41
42
43
44
45
46
47
48
			};
		}
	})
}

async fn handle(update: telegram_bot::Update, core: &core::Core, mut _reply_to: &Option<telegram_bot::UserId>) -> Result<()> {
	if let telegram_bot::UpdateKind::Message(message) = update.kind {
		if let telegram_bot::MessageKind::Text { ref data, .. } = message.kind {
			if let Some(from) = message.from {

				let sender = from.id;
				let words: Vec<&str> = data.split_whitespace().collect();
				if let Err(err) = match words[0] {
					"/check" | "/clean" | "/enable" | "/delete" | "/disable" => command::command(core, sender, words).await,
					"/start" => command::start(core, sender).await,
					"/list" => command::list(core, sender).await,
					"/add" | "/update" => command::update(core, sender, words).await,
					_ => Ok(()),
				} {







<
|
>

|







31
32
33
34
35
36
37

38
39
40
41
42
43
44
45
46
47
48
			};
		}
	})
}

async fn handle(update: telegram_bot::Update, core: &core::Core, mut _reply_to: &Option<telegram_bot::UserId>) -> Result<()> {
	if let telegram_bot::UpdateKind::Message(message) = update.kind {

		if let Some(from) = message.from {
			if let telegram_bot::MessageKind::BotCommand { ref cmd_str, .. } = message.kind {
				let sender = from.id;
				let words: Vec<&str> = cmd_str.split_whitespace().collect();
				if let Err(err) = match words[0] {
					"/check" | "/clean" | "/enable" | "/delete" | "/disable" => command::command(core, sender, words).await,
					"/start" => command::start(core, sender).await,
					"/list" => command::list(core, sender).await,
					"/add" | "/update" => command::update(core, sender, words).await,
					_ => Ok(()),
				} {