File tree 2 files changed +46
-0
lines changed
2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ inputs = {
3
+ nixpkgs . url = "github:NixOS/nixpkgs/23.11" ;
4
+ utils . url = "github:numtide/flake-utils" ;
5
+ } ;
6
+
7
+ outputs = {
8
+ self ,
9
+ nixpkgs ,
10
+ utils ,
11
+ } :
12
+ utils . lib . eachDefaultSystem ( system : let
13
+ pkgs = import nixpkgs {
14
+ inherit system ;
15
+ } ;
16
+ in {
17
+
18
+ # -7QJRXB1-nshZe7V-ub1Z4SVHn_tNwJW
19
+ devShell = with pkgs ;
20
+ mkShell rec {
21
+ buildInputs = [
22
+ nodejs_20
23
+ corepack_20
24
+ docker-compose
25
+ redis
26
+ ] ;
27
+
28
+ # https://github.com/nodejs/corepack#utility-commands
29
+ shellHook = ''
30
+ '' ;
31
+ } ;
32
+
33
+ formatter = nixpkgs . legacyPackages . x86_64-linux . alejandra ;
34
+ } ) ;
35
+ }
Original file line number Diff line number Diff line change @@ -68,6 +68,17 @@ export const reactOnEndWithQuoiUpdated = async (
68
68
newMessage : Message | PartialMessage ,
69
69
) => {
70
70
if ( ! ( newMessage instanceof Message ) ) return ;
71
+
72
+ // Both E and U are in feur and coubeh, that should be sufficient to detect if the bot has already reacted
73
+ const feurCoubeh = new Set < string > ( [ EMOJI . E , EMOJI . U ] ) ;
74
+
75
+ // Check if the old message already has a reaction
76
+ const selfReactions = newMessage . reactions . cache . some ( ( reaction ) => {
77
+ return reaction . me && reaction . emoji . name && feurCoubeh . has ( reaction . emoji . name ) ;
78
+ } ) ;
79
+
80
+ if ( selfReactions ) return ;
81
+
71
82
await reactOnEndWithQuoi ( newMessage ) ;
72
83
} ;
73
84
You can’t perform that action at this time.
0 commit comments