mirror of
https://codeberg.org/JasterV/gofish_bot.git
synced 2026-04-26 18:10:09 +00:00
bug solucionao
This commit is contained in:
parent
b3254deef9
commit
f79582c3fc
1 changed files with 10 additions and 3 deletions
13
src/main.rs
13
src/main.rs
|
|
@ -68,9 +68,8 @@ async fn execute(cx: Cx, command: Command) -> Result<()> {
|
|||
}
|
||||
}
|
||||
_ => {
|
||||
let entry = SENDERS.get(&chat_id);
|
||||
if let Some(entry) = entry {
|
||||
let sender = entry.value();
|
||||
let sender = get_sender(chat_id);
|
||||
if let Some(sender) = sender {
|
||||
let _ = sender
|
||||
.send(GameActorMsg::Message(Message(cx, command.into())))
|
||||
.await;
|
||||
|
|
@ -87,3 +86,11 @@ async fn execute(cx: Cx, command: Command) -> Result<()> {
|
|||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn get_sender(chat_id: i64) -> Option<Sender<GameActorMsg>> {
|
||||
let entry = SENDERS.get(&chat_id);
|
||||
match entry {
|
||||
Some(entry) => Some(entry.clone()),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue