Check-in [093ae6c75b]
Logged in as anonymous
Overview
Comment:simplify a little
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 093ae6c75bcab21ea91c23a6516d12f6824268a324650dbc4a820f233cdb7f47
User & Date: arcade on 2022-02-15 14:56:35.512
Other Links: manifest | tags
Context
2022-03-12
13:25
bump, update config check-in: 28da2e2a00 user: arcade tags: trunk
2022-02-15
14:56
simplify a little check-in: 093ae6c75b user: arcade tags: trunk
2022-02-13
19:57
rework time, rework autofetch, clippy lint check-in: 26339860ce user: arcade tags: trunk
Changes
84
85
86
87
88
89
90
91
92
93


94
95
96
97
98
99
100
84
85
86
87
88
89
90



91
92
93
94
95
96
97
98
99







-
-
-
+
+







					let _url_rex = ReplaceCommand::new(thing).context("Regexp parsing error:")?;
					Some(thing)
				}
			}
		},
		None => None,
	};
	let s_channel = &channel.to_string();
	let channel_id = i64::from(core.tg.send(telegram_bot::GetChat::new(telegram_bot::types::ChatRef::ChannelUsername(s_channel.into()))).await?.id());
	let chan_adm = core.tg.send(telegram_bot::GetChatAdministrators::new(telegram_bot::types::ChatRef::ChannelUsername(s_channel.into()))).await
	let channel_id = i64::from(core.tg.send(telegram_bot::GetChat::new(telegram_bot::ChatRef::ChannelUsername(channel.to_string()))).await?.id());
	let chan_adm = core.tg.send(telegram_bot::GetChatAdministrators::new(telegram_bot::ChatRef::ChannelUsername(channel.to_string()))).await
		.context("Sorry, I have no access to that chat.")?;
	let (mut me, mut user) = (false, false);
	for admin in chan_adm {
		if admin.user.id == core.my.id {
			me = true;
		};
		if admin.user.id == sender {
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
62
63
64
65
66
67
68


69
70
71
72
73
74
75







-
-








	pub fn stream(&self) -> telegram_bot::UpdatesStream {
		self.tg.stream()
	}

	pub async fn send<'a, S>(&self, msg: S, target: Option<telegram_bot::UserId>, mode: Option<telegram_bot::types::ParseMode>) -> Result<()>
	where S: Into<Cow<'a, str>> {
		let msg = msg.into();

		let mode = mode.unwrap_or(telegram_bot::types::ParseMode::Html);
		let target = target.unwrap_or(self.owner_chat);
		self.tg.send(telegram_bot::SendMessage::new(target, msg).parse_mode(mode)).await?;
		Ok(())
	}

	pub async fn check<S>(&self, id: &i32, owner: S, real: bool) -> Result<Cow<'_, str>>