mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-06-17 02:29:10 +00:00
add tests; resync files, forgot where i was.
This commit is contained in:
parent
6b36b1d5f2
commit
1a794e2d7e
30 changed files with 3654 additions and 534 deletions
17
services/discord/botFetcher.js
Normal file
17
services/discord/botFetcher.js
Normal 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)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue