Compare commits

...

2 commits

Author SHA1 Message Date
c3f297deaa
flake.lock: update 2024-07-17 21:38:39 -04:00
79754392bc
add broadcaster check 2024-07-17 21:38:14 -04:00
2 changed files with 25 additions and 24 deletions

View file

@ -6,11 +6,11 @@
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1717223092,
"narHash": "sha256-ih8NPk3Jn5EAILOGQZ+KS5NLmu6QmwohJX+36MaTAQE=",
"lastModified": 1719815435,
"narHash": "sha256-K2xFp142onP35jcx7li10xUxNVEVRWjAdY8DSuR7Naw=",
"owner": "nix-community",
"repo": "fenix",
"rev": "9a025daf6799e3af80b677f0af57ef76432c3fcf",
"rev": "ebfe2c639111d7e82972a12711206afaeeda2450",
"type": "github"
},
"original": {
@ -59,11 +59,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1716948383,
"narHash": "sha256-SzDKxseEcHR5KzPXLwsemyTR/kaM9whxeiJohbL04rs=",
"lastModified": 1719506693,
"narHash": "sha256-C8e9S7RzshSdHB7L+v9I51af1gDM5unhJ2xO1ywxNH8=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "ad57eef4ef0659193044870c731987a6df5cf56b",
"rev": "b2852eb9365c6de48ffb0dc2c9562591f652242a",
"type": "github"
},
"original": {
@ -75,27 +75,27 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1718811006,
"narHash": "sha256-0Y8IrGhRmBmT7HHXlxxepg2t8j1X90++qRN3lukGaIk=",
"lastModified": 1720386169,
"narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "03d771e513ce90147b65fe922d87d3a0356fc125",
"rev": "194846768975b7ad2c4988bdb82572c00222c0d7",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.11",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1719379843,
"narHash": "sha256-u+D+IOAMMl70+CJ9NKB+RMrASjInuIWMHzjLWQjPZ6c=",
"lastModified": 1721116560,
"narHash": "sha256-++TYlGMAJM1Q+0nMVaWBSEvEUjRs7ZGiNQOpqbQApCU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b3f3c1b13fb08f3828442ee86630362e81136bbc",
"rev": "9355fa86e6f27422963132c2c9aeedb0fb963d93",
"type": "github"
},
"original": {
@ -129,11 +129,11 @@
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1719259945,
"narHash": "sha256-F1h+XIsGKT9TkGO3omxDLEb/9jOOsI6NnzsXFsZhry4=",
"lastModified": 1721042469,
"narHash": "sha256-6FPUl7HVtvRHCCBQne7Ylp4p+dpP3P/OYuzjztZ4s70=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "0ff4381bbb8f7a52ca4a851660fc7a437a4c6e07",
"rev": "f451c19376071a90d8c58ab1a953c6e9840527fd",
"type": "github"
},
"original": {
@ -153,11 +153,11 @@
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1717169693,
"narHash": "sha256-qBruki5NHrSqIw5ulxtwFmVsb6W/aOKOMjsCJjfalA4=",
"lastModified": 1719760370,
"narHash": "sha256-fsxAuW6RxKZYjAP3biUC6C4vaYFhDfWv8lp1Tmx3ZCY=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "d6d735e6f20ef78b16a79886fe28bd69cf059504",
"rev": "ea7fdada6a0940b239ddbde2048a4d7dac1efe1e",
"type": "github"
},
"original": {

View file

@ -39,6 +39,7 @@ pub async fn main() {
match message {
ServerMessage::Privmsg(m) => {
let is_moderator = m.badges.iter().any(|badge| badge.name == "moderator");
let is_broadcaster = m.badges.iter().any(|badge| badge.name == "broadcaster");
let channel = m.channel_login.clone();
let sender = m.sender.name.clone();
let contents = m.message_text.clone();
@ -53,7 +54,7 @@ pub async fn main() {
match command {
"ping" => {
if is_moderator {
if is_moderator || is_broadcaster {
ping_command(&m, &client).await.unwrap_or_default();
} else {
sleep(Duration::from_secs(1));
@ -61,7 +62,7 @@ pub async fn main() {
}
}
"song" => {
if is_moderator {
if is_moderator || is_broadcaster {
lastfm_command(&m, &client).await.unwrap_or_default();
} else {
sleep(Duration::from_secs(1));
@ -69,7 +70,7 @@ pub async fn main() {
}
}
"user" => {
if is_moderator {
if is_moderator || is_broadcaster {
get_user_command(&m, &client, &arguments)
.await
.unwrap_or_default();
@ -81,7 +82,7 @@ pub async fn main() {
}
}
"logs" => {
if is_moderator {
if is_moderator || is_broadcaster {
logs_command(&m, &client, &arguments)
.await
.unwrap_or_default();
@ -93,7 +94,7 @@ pub async fn main() {
}
}
"massping" => {
if is_moderator {
if is_moderator || is_broadcaster {
massping_command(&m, &client).await.unwrap_or_default();
} else {
sleep(Duration::from_secs(1));