chore: setup "deno lint" (#331)

* chore: setup "deno lint"

* ci(lint): add --unstable flat to lint script

* lint

* lint

* refactor: destructure assignment for Message#guildID

* chore: remove TODO comment

* refactor: remove redundant async

* chore: switch to Deno stable vscode ext

* chore: remove ignore comments

* chore: remove ignore comments

* chore: remove @ts-ignore comment

* fixes

* fixes

* chore: remove deno-lint-ignore comment

* chore: add index signature
This commit is contained in:
Ayyan
2021-01-03 20:12:42 +04:00
committed by GitHub
parent 55f68a242d
commit e5a8f3b358
33 changed files with 127 additions and 90 deletions
+4
View File
@@ -399,9 +399,13 @@ export async function editChannel(
const payload = {
...options,
// deno-lint-ignore camelcase
rate_limit_per_user: options.slowmode,
// deno-lint-ignore camelcase
parent_id: options.parentID,
// deno-lint-ignore camelcase
user_limit: options.userLimit,
// deno-lint-ignore camelcase
permission_overwrites: options.overwrites?.map(
(overwrite) => {
return {
+2 -2
View File
@@ -429,8 +429,8 @@ export function fetchMembers(guild: Guild, options?: FetchMembersOptions) {
options.limit = options.userIDs.length;
}
return new Promise(async (resolve) => {
await requestAllMembers(guild, resolve, options);
return new Promise((resolve) => {
requestAllMembers(guild, resolve, options);
}) as Promise<Collection<string, Member>>;
}
+4 -1
View File
@@ -1,6 +1,7 @@
import { botID } from "../../bot.ts";
import { RequestManager } from "../../rest/mod.ts";
import {
ChannelCreatePayload,
DMChannelCreatePayload,
EditMemberOptions,
Errors,
@@ -128,7 +129,9 @@ export async function sendDirectMessage(
) as DMChannelCreatePayload;
// Channel create event will have added this channel to the cache
await cacheHandlers.delete("channels", dmChannelData.id);
const channel = await structures.createChannel(dmChannelData);
const channel = await structures.createChannel(
dmChannelData as unknown as ChannelCreatePayload,
);
// Recreate the channel and add it undert he users id
await cacheHandlers.set("channels", memberID, channel);
dmChannel = channel;