mirror of
https://github.com/shiroyashik/doggy-watch.git
synced 2025-12-06 12:31:13 +03:00
This commit is contained in:
parent
3132ebd036
commit
655e195c91
2 changed files with 2 additions and 2 deletions
|
|
@ -29,7 +29,7 @@ pub async fn inline(bot: Bot, q: CallbackQuery, state: Arc<AppState>, uid: Strin
|
||||||
if let Some(data) = q.clone().data {
|
if let Some(data) = q.clone().data {
|
||||||
let text= if &data == "yes" {
|
let text= if &data == "yes" {
|
||||||
if let Ok(uid) = uid.parse::<u64>() {
|
if let Ok(uid) = uid.parse::<u64>() {
|
||||||
if Entity::delete_by_id(uid as i32).exec(&state.db).await?.rows_affected != 0 {
|
if Entity::delete_by_id(uid as i64).exec(&state.db).await?.rows_affected != 0 {
|
||||||
"Модератор удалён!"
|
"Модератор удалён!"
|
||||||
} else {
|
} else {
|
||||||
"Произошла ошибка!\nПо всей видимости такого модератора не существует."
|
"Произошла ошибка!\nПо всей видимости такого модератора не существует."
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ use crate::AppState;
|
||||||
|
|
||||||
/// Invert notify status for moderator
|
/// Invert notify status for moderator
|
||||||
pub async fn command(bot: Bot, msg: Message, uid: UserId, state: Arc<AppState>) -> anyhow::Result<()> {
|
pub async fn command(bot: Bot, msg: Message, uid: UserId, state: Arc<AppState>) -> anyhow::Result<()> {
|
||||||
let text = if let Some(moder) = moderators::Entity::find_by_id(uid.0 as i32).one(&state.db).await? {
|
let text = if let Some(moder) = moderators::Entity::find_by_id(uid.0 as i64).one(&state.db).await? {
|
||||||
let moder = match moder.notify {
|
let moder = match moder.notify {
|
||||||
true => {
|
true => {
|
||||||
let mut moder = moder.into_active_model();
|
let mut moder = moder.into_active_model();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue