mirror of
https://git.asonix.dog/asonix/relay.git
synced 2025-11-27 11:00:35 +00:00
Chunk telegram responses with size 50
This commit is contained in:
parent
699e24d73d
commit
fa4c9b9ec4
|
|
@ -107,17 +107,23 @@ async fn answer(bot: Bot, msg: Message, cmd: Command, db: Db) -> ResponseResult<
|
||||||
}
|
}
|
||||||
Command::ListAllowed => {
|
Command::ListAllowed => {
|
||||||
if let Ok(allowed) = db.allows().await {
|
if let Ok(allowed) = db.allows().await {
|
||||||
bot.send_message(msg.chat.id, allowed.join("\n")).await?;
|
for chunk in allowed.chunks(50) {
|
||||||
|
bot.send_message(msg.chat.id, chunk.join("\n")).await?;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Command::ListBlocks => {
|
Command::ListBlocks => {
|
||||||
if let Ok(blocks) = db.blocks().await {
|
if let Ok(blocks) = db.blocks().await {
|
||||||
bot.send_message(msg.chat.id, blocks.join("\n")).await?;
|
for chunk in blocks.chunks(50) {
|
||||||
|
bot.send_message(msg.chat.id, chunk.join("\n")).await?;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Command::ListConnected => {
|
Command::ListConnected => {
|
||||||
if let Ok(connected) = db.connected_ids().await {
|
if let Ok(connected) = db.connected_ids().await {
|
||||||
bot.send_message(msg.chat.id, connected.join("\n")).await?;
|
for chunk in connected.chunks(50) {
|
||||||
|
bot.send_message(msg.chat.id, chunk.join("\n")).await?;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user