Browse Source

Set max wait time via DB

horse 5 years ago
parent
commit
9c2aa1d793

+ 1 - 1
bot/src/commands/random_react.ts

@@ -26,7 +26,7 @@ export class RandomReact {
             return false;
 
         if(Math.random() < reactInfo.reactProbability) {
-            await timeout(Math.random() * 10000);
+            await timeout(Math.random() * reactInfo.maxWaitMs);
             await msg.react(emote);
         }
         

+ 3 - 0
shared/src/db/entity/RandomMesssageReaction.ts

@@ -11,4 +11,7 @@ export class RandomMessageReaction {
 
     @Column({ type: "decimal", default: 0.0 })
     reactProbability: number;
+
+    @Column({ type: "decimal", default: 0.0 })
+    maxWaitMs: number;
 }