style: move to deno fmt (#1992)

* Create deno.json

* run format

* run format

* ci: only check formatting

* f

* Update settings.json

* Update settings.json
This commit is contained in:
ITOH
2022-02-04 15:00:04 +01:00
committed by GitHub
parent 637e2c2a90
commit 81f8e0377c
259 changed files with 1731 additions and 1795 deletions
+5 -5
View File
@@ -41,7 +41,7 @@ export function setupCacheEdits<B extends Bot>(bot: BotWithCache<B>) {
bot.handlers.MESSAGE_REACTION_ADD = function (_, data, shardId) {
const payload = data.d as SnakeCasedPropertiesDeep<MessageReactionAdd>;
const messageId = bot.transformers.snowflake(payload.message_id)
const messageId = bot.transformers.snowflake(payload.message_id);
const message = bot.messages.get(messageId);
const emoji = bot.transformers.emoji(bot, payload.emoji);
@@ -71,12 +71,12 @@ export function setupCacheEdits<B extends Bot>(bot: BotWithCache<B>) {
}
MESSAGE_REACTION_ADD(bot, data, shardId);
}
};
bot.handlers.MESSAGE_REACTION_REMOVE = function (_, data, shardId) {
const payload = data.d as SnakeCasedPropertiesDeep<MessageReactionRemove>;
const messageId = bot.transformers.snowflake(payload.message_id)
const messageId = bot.transformers.snowflake(payload.message_id);
const message = bot.messages.get(messageId);
const emoji = bot.transformers.emoji(bot, payload.emoji);
@@ -102,7 +102,7 @@ export function setupCacheEdits<B extends Bot>(bot: BotWithCache<B>) {
}
MESSAGE_REACTION_REMOVE(bot, data, shardId);
}
};
bot.handlers.MESSAGE_REACTION_REMOVE_ALL = function (_, data, shardId) {
const payload = data.d as SnakeCasedPropertiesDeep<MessageReactionRemoveAll>;
@@ -116,5 +116,5 @@ export function setupCacheEdits<B extends Bot>(bot: BotWithCache<B>) {
}
MESSAGE_REACTION_REMOVE_ALL(bot, data, shardId);
}
};
}
+3 -7
View File
@@ -1,5 +1,5 @@
import {
Bot,
Bot,
Channel,
Collection,
GuildBanAddRemove,
@@ -85,18 +85,14 @@ export function setupCacheRemovals<B extends Bot>(bot: BotWithCache<B>) {
bot.events.messageDelete(bot, {
id,
channelId: bot.transformers.snowflake(payload.channel_id),
guildId: payload.guild_id
? bot.transformers.snowflake(payload.guild_id)
: undefined,
guildId: payload.guild_id ? bot.transformers.snowflake(payload.guild_id) : undefined,
}, message);
bot.messages.delete(id);
};
bot.handlers.MESSAGE_DELETE_BULK = function (_, data, shardId) {
const payload = data.d as SnakeCasedPropertiesDeep<MessageDeleteBulk>;
payload.ids.forEach((id) =>
bot.messages.delete(bot.transformers.snowflake(id))
);
payload.ids.forEach((id) => bot.messages.delete(bot.transformers.snowflake(id)));
MESSAGE_DELETE_BULK(bot, data, shardId);
};