add tests; resync files, forgot where i was.

This commit is contained in:
41666 2019-03-29 13:59:57 -05:00
parent 6b36b1d5f2
commit 1a794e2d7e
No known key found for this signature in database
GPG key ID: BC51D07640DC10AF
30 changed files with 3654 additions and 534 deletions

View file

@ -0,0 +1,17 @@
// @flow
import type { IFetcher } from './types'
import type DiscordSvc from '../discord'
import type ErisClient from 'eris'
export default class BotFetcher implements IFetcher {
ctx: DiscordSvc
client: ErisClient
constructor (ctx: DiscordSvc) {
this.ctx = ctx
this.client = ctx.client
}
getUser = async (id: string) => this.client.users.get(id)
getMember = async (server: string, user: string) => this.client.guilds.get(server)?.members.get(user)
getGuild = async (server: string) => this.client.guilds.get(server)
}