File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ use std::num::ParseIntError;
69
69
use std:: str:: FromStr ;
70
70
use std:: time:: { Duration , UNIX_EPOCH } ;
71
71
72
- use anyhow:: { ensure, Result } ;
72
+ use anyhow:: { ensure, Context as _ , Result } ;
73
73
use async_channel:: Receiver ;
74
74
use serde:: { Deserialize , Serialize } ;
75
75
use tokio:: time:: timeout;
@@ -176,15 +176,12 @@ impl ChatId {
176
176
pub async fn get_ephemeral_timer ( self , context : & Context ) -> Result < Timer > {
177
177
let timer = context
178
178
. sql
179
- . query_row (
179
+ . query_get_value (
180
180
"SELECT IFNULL(ephemeral_timer, 0) FROM chats WHERE id=?" ,
181
181
( self , ) ,
182
- |row| {
183
- let timer: Timer = row. get ( 0 ) ?;
184
- Ok ( timer)
185
- } ,
186
182
)
187
- . await ?;
183
+ . await ?
184
+ . with_context ( || format ! ( "Chat {self} not found" ) ) ?;
188
185
Ok ( timer)
189
186
}
190
187
You can’t perform that action at this time.
0 commit comments