|
@@ -4,6 +4,8 @@ import { getRepository } from "typeorm";
|
|
|
import { RandomMessageReaction } from "@shared/db/entity/RandomMesssageReaction";
|
|
|
import { client } from "src/client";
|
|
|
|
|
|
+const timeout = (ms: number) => new Promise(r => setTimeout(r, ms));
|
|
|
+
|
|
|
@CommandSet
|
|
|
export class RandomReact {
|
|
|
@Action(ActionType.MESSAGE)
|
|
@@ -23,8 +25,10 @@ export class RandomReact {
|
|
|
if(!emote)
|
|
|
return false;
|
|
|
|
|
|
- if(Math.random() < reactInfo.reactProbability)
|
|
|
+ if(Math.random() < reactInfo.reactProbability) {
|
|
|
+ await timeout(Math.random() * 10000);
|
|
|
await msg.react(emote);
|
|
|
+ }
|
|
|
|
|
|
return false;
|
|
|
}
|