mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25:02 +00:00
Reformat all files with Prettier
This commit is contained in:
parent
0cde0d46d2
commit
ac79eb09f5
206 changed files with 727 additions and 888 deletions
|
@ -55,7 +55,7 @@ const defaultOptions: PluginOptions<CountersPluginType> = {
|
|||
],
|
||||
};
|
||||
|
||||
const configPreprocessor: ConfigPreprocessorFn<CountersPluginType> = options => {
|
||||
const configPreprocessor: ConfigPreprocessorFn<CountersPluginType> = (options) => {
|
||||
for (const [counterName, counter] of Object.entries(options.config?.counters || {})) {
|
||||
counter.name = counterName;
|
||||
counter.per_user = counter.per_user ?? false;
|
||||
|
|
|
@ -13,13 +13,13 @@ export const CountersListCmd = typedGuildCommand<CountersPluginType>()({
|
|||
async run({ pluginData, message, args }) {
|
||||
const config = await pluginData.config.getForMessage(message);
|
||||
|
||||
const countersToShow = Array.from(Object.values(config.counters)).filter(c => c.can_view !== false);
|
||||
const countersToShow = Array.from(Object.values(config.counters)).filter((c) => c.can_view !== false);
|
||||
if (!countersToShow.length) {
|
||||
sendErrorMessage(pluginData, message.channel, "No counters are configured for this server");
|
||||
return;
|
||||
}
|
||||
|
||||
const counterLines = countersToShow.map(counter => {
|
||||
const counterLines = countersToShow.map((counter) => {
|
||||
const title = counter.pretty_name ? `**${counter.pretty_name}** (\`${counter.name}\`)` : `\`${counter.name}\``;
|
||||
|
||||
const types: string[] = [];
|
||||
|
|
|
@ -38,10 +38,10 @@ export async function changeCounterValue(
|
|||
if (triggers) {
|
||||
const triggersArr = Array.from(triggers.values());
|
||||
await Promise.all(
|
||||
triggersArr.map(trigger => checkCounterTrigger(pluginData, counterName, trigger, channelId, userId)),
|
||||
triggersArr.map((trigger) => checkCounterTrigger(pluginData, counterName, trigger, channelId, userId)),
|
||||
);
|
||||
await Promise.all(
|
||||
triggersArr.map(trigger => checkReverseCounterTrigger(pluginData, counterName, trigger, channelId, userId)),
|
||||
triggersArr.map((trigger) => checkReverseCounterTrigger(pluginData, counterName, trigger, channelId, userId)),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -25,8 +25,8 @@ export async function decayCounter(
|
|||
const triggers = pluginData.state.counterTriggersByCounterId.get(counterId);
|
||||
if (triggers) {
|
||||
const triggersArr = Array.from(triggers.values());
|
||||
await Promise.all(triggersArr.map(trigger => checkAllValuesForTrigger(pluginData, counterName, trigger)));
|
||||
await Promise.all(triggersArr.map(trigger => checkAllValuesForReverseTrigger(pluginData, counterName, trigger)));
|
||||
await Promise.all(triggersArr.map((trigger) => checkAllValuesForTrigger(pluginData, counterName, trigger)));
|
||||
await Promise.all(triggersArr.map((trigger) => checkAllValuesForReverseTrigger(pluginData, counterName, trigger)));
|
||||
}
|
||||
|
||||
lock.unlock();
|
||||
|
|
|
@ -35,10 +35,10 @@ export async function setCounterValue(
|
|||
if (triggers) {
|
||||
const triggersArr = Array.from(triggers.values());
|
||||
await Promise.all(
|
||||
triggersArr.map(trigger => checkCounterTrigger(pluginData, counterName, trigger, channelId, userId)),
|
||||
triggersArr.map((trigger) => checkCounterTrigger(pluginData, counterName, trigger, channelId, userId)),
|
||||
);
|
||||
await Promise.all(
|
||||
triggersArr.map(trigger => checkReverseCounterTrigger(pluginData, counterName, trigger, channelId, userId)),
|
||||
triggersArr.map((trigger) => checkReverseCounterTrigger(pluginData, counterName, trigger, channelId, userId)),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue