mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-05-24 01:00:49 +00:00
Move to SQLite (#13)
This commit is contained in:
parent
750ddb7762
commit
1799b70bc1
50 changed files with 2122 additions and 394 deletions
|
@ -388,7 +388,7 @@ mod reaction_watcher {
|
|||
.flat_map(|(&guild, rs)| {
|
||||
rs.reaction_messages
|
||||
.iter()
|
||||
.map(move |(m, r)| (guild, m.clone(), r.clone()))
|
||||
.map(move |(m, r)| (guild, *m, r.clone()))
|
||||
})
|
||||
.collect();
|
||||
Ok(Self {
|
||||
|
@ -554,11 +554,11 @@ mod reaction_watcher {
|
|||
let role = Roles::open(&*data)
|
||||
.borrow()?
|
||||
.get(&guild)
|
||||
.ok_or(Error::msg("guild no longer has role list"))?
|
||||
.ok_or_else(|| Error::msg("guild no longer has role list"))?
|
||||
.reaction_messages
|
||||
.get(&message)
|
||||
.map(|msg| &msg.roles[..])
|
||||
.ok_or(Error::msg("message is no longer a role list handler"))?
|
||||
.ok_or_else(|| Error::msg("message is no longer a role list handler"))?
|
||||
.iter()
|
||||
.find_map(|(role, role_reaction)| {
|
||||
if &reaction.as_inner_ref().emoji == role_reaction {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue