mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-16 22:21:51 +00:00
Slowmode: support native slowmode up to 6h
This commit is contained in:
parent
50f5792bc5
commit
d77105c831
1 changed files with 3 additions and 1 deletions
|
@ -7,6 +7,8 @@ import { ZeppelinPlugin } from "./ZeppelinPlugin";
|
||||||
import { SavedMessage } from "../data/entities/SavedMessage";
|
import { SavedMessage } from "../data/entities/SavedMessage";
|
||||||
import { GuildSavedMessages } from "../data/GuildSavedMessages";
|
import { GuildSavedMessages } from "../data/GuildSavedMessages";
|
||||||
|
|
||||||
|
const NATIVE_SLOWMODE_LIMIT = 6 * 60 * 60 * 1000; // 6 hours
|
||||||
|
|
||||||
interface ISlowmodePluginConfig {
|
interface ISlowmodePluginConfig {
|
||||||
use_native_slowmode: boolean;
|
use_native_slowmode: boolean;
|
||||||
|
|
||||||
|
@ -233,7 +235,7 @@ export class SlowmodePlugin extends ZeppelinPlugin<ISlowmodePluginConfig> {
|
||||||
}
|
}
|
||||||
|
|
||||||
const seconds = Math.ceil(convertDelayStringToMS(args.time) / 1000);
|
const seconds = Math.ceil(convertDelayStringToMS(args.time) / 1000);
|
||||||
const useNativeSlowmode = this.getConfigForChannel(channel).use_native_slowmode && seconds <= 120;
|
const useNativeSlowmode = this.getConfigForChannel(channel).use_native_slowmode && seconds <= NATIVE_SLOWMODE_LIMIT;
|
||||||
|
|
||||||
if (useNativeSlowmode) {
|
if (useNativeSlowmode) {
|
||||||
// Native slowmode
|
// Native slowmode
|
||||||
|
|
Loading…
Add table
Reference in a new issue