3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-12 21:05:02 +00:00

Reformat all files with Prettier

This commit is contained in:
Dragory 2021-09-11 19:06:51 +03:00
parent 0cde0d46d2
commit ac79eb09f5
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
206 changed files with 727 additions and 888 deletions

View file

@ -4,7 +4,7 @@ import { AutomodPluginType } from "../types";
export function clearOldRecentActions(pluginData: GuildPluginData<AutomodPluginType>) {
const now = Date.now();
pluginData.state.recentActions = pluginData.state.recentActions.filter(info => {
pluginData.state.recentActions = pluginData.state.recentActions.filter((info) => {
return info.context.timestamp + RECENT_ACTION_EXPIRY_TIME > now;
});
}

View file

@ -4,7 +4,7 @@ import { AutomodPluginType } from "../types";
export function clearOldRecentSpam(pluginData: GuildPluginData<AutomodPluginType>) {
const now = Date.now();
pluginData.state.recentSpam = pluginData.state.recentSpam.filter(spam => {
pluginData.state.recentSpam = pluginData.state.recentSpam.filter((spam) => {
return spam.timestamp + RECENT_SPAM_EXPIRY_TIME > now;
});
}

View file

@ -6,7 +6,7 @@ export function clearRecentActionsForMessage(pluginData: GuildPluginData<Automod
const globalIdentifier = message.user_id;
const perChannelIdentifier = `${message.channel_id}-${message.user_id}`;
pluginData.state.recentActions = pluginData.state.recentActions.filter(act => {
pluginData.state.recentActions = pluginData.state.recentActions.filter((act) => {
return act.identifier !== globalIdentifier && act.identifier !== perChannelIdentifier;
});
}

View file

@ -60,7 +60,7 @@ export function createMessageSpamTrigger(spamType: RecentActionType, prettyName:
if (matchedSpam) {
const messages = matchedSpam.recentActions
.map(action => action.context.message)
.map((action) => action.context.message)
.filter(Boolean)
.sort(sorter("posted_at")) as SavedMessage[];
@ -75,8 +75,8 @@ export function createMessageSpamTrigger(spamType: RecentActionType, prettyName:
return {
extraContexts: matchedSpam.recentActions
.map(action => action.context)
.filter(_context => _context !== context),
.map((action) => action.context)
.filter((_context) => _context !== context),
extra: {
archiveId,

View file

@ -7,7 +7,7 @@ export function findRecentSpam(
type: RecentActionType,
identifier?: string,
) {
return pluginData.state.recentSpam.find(spam => {
return pluginData.state.recentSpam.find((spam) => {
return spam.type === type && (!identifier || spam.identifiers.includes(identifier));
});
}

View file

@ -11,7 +11,7 @@ export function getMatchingRecentActions(
) {
to = to || Date.now();
return pluginData.state.recentActions.filter(action => {
return pluginData.state.recentActions.filter((action) => {
return (
action.type === type &&
(!identifier || action.identifier === identifier) &&

View file

@ -29,6 +29,6 @@ export function getTextMatchPartialSummary(
const visibleName = context.member?.nickname || context.user!.username;
return `visible name: ${visibleName}`;
} else if (type === "customstatus") {
return `custom status: ${context.member!.presence?.activities.find(a => a.type === "CUSTOM")?.name}`;
return `custom status: ${context.member!.presence?.activities.find((a) => a.type === "CUSTOM")?.name}`;
}
}