message: cache users on member creation
diff: @@ -14,15 +14,22 @@ import { RequestManager } from "../module/requestManager.ts";
  import { botID } from "../module/client.ts";
  import { Guild } from "./guild.ts";
  import { cache } from "../utils/cache.ts";
  +import { createUser } from "./user.ts";
  -export const createMember = (data: MemberCreatePayload, guild: Guild) => ({
  +export const createMember = (data: MemberCreatePayload, guild: Guild) => {
  + // Add the user to cache as well
  + cache.users.set(data.user.id, createUser(data.user))
  +
  + return {
  ...data,
  /** The complete raw data from the member create payload */
  raw: data,
  /** When the user joined the guild */
  joinedAt: Date.parse(data.joined_at),
  /** When the user used their nitro boost on the server. */
  - premiumSince: data.premium_since ? Date.parse(data.premium_since) : undefined,
  + premiumSince: data.premium_since
  + ? Date.parse(data.premium_since)
  + : undefined,
  /** The full username#discriminator */
  tag: `${data.user.username}#${data.user.discriminator}`,
  /** The user mention with nickname if possible */
  @@ -147,6 +154,7 @@ export const createMember = (data: MemberCreatePayload, guild: Guild) => ({
  permissions,
  );
  },
  -});
  + };
  +};
  export interface Member extends ReturnType<typeof createMember> {}
  