Function handleWSEvent

  • Handle a Websocket event.

    Parameters

    • client: Client

      The client the Websocket belongs to.

    • event: keyof WSEvents

      The name of the event.

    • data: {
          createdBy: string;
          server: APIServer;
      } | {
          deletedBy: string;
          server: APIServer;
      } | {
          message: APIMessage;
          serverId: string;
      } | {
          message: APIMessage;
          serverId: string;
      } | {
          message: APIMessageSummary;
          serverId: string;
      } | {
          member: APIServerMember;
          serverId: string;
      } | {
          isBan?: boolean;
          isKick?: boolean;
          serverId: string;
          userId: string;
      } | {
          serverId: string;
          serverMemberBan: APIServerBan;
      } | {
          serverId: string;
          serverMemberBan: APIServerBan;
      } | {
          serverId: string;
          userInfo: {
              id: string;
              nickname?: string;
          };
      } | {
          memberRoleIds: {
              roleIds: number[];
              userId: string;
          }[];
          serverId: string;
      } | {
          channel: APIChannel;
          serverId: string;
      } | {
          channel: APIChannel;
          serverId: string;
      } | {
          channel: APIChannel;
          serverId: string;
      } | {
          serverId: string;
          webhook: APIWebhook;
      } | {
          serverId: string;
          webhook: APIWebhook;
      } | {
          doc: APIDoc;
          serverId: string;
      } | {
          doc: APIDoc;
          serverId: string;
      } | {
          doc: APIDoc;
          serverId: string;
      } | {
          calendarEvent: APICalendarEvent;
          serverId: string;
      } | {
          calendarEvent: APICalendarEvent;
          serverId: string;
      } | {
          calendarEvent: APICalendarEvent;
          serverId: string;
      } | {
          forumTopic: APIForumTopic;
          serverId: string;
      } | {
          forumTopic: APIForumTopic;
          serverId: string;
      } | {
          forumTopic: APIForumTopic;
          serverId: string;
      } | {
          forumTopic: APIForumTopic;
          serverId: string;
      } | {
          forumTopic: APIForumTopic;
          serverId: string;
      } | {
          forumTopic: APIForumTopic;
          serverId: string;
      } | {
          forumTopic: APIForumTopic;
          serverId: string;
      } | {
          calendarEventRsvp: APICalendarEventRsvp;
          serverId: string;
      } | {
          calendarEventRsvps: APICalendarEventRsvp[];
          serverId: string;
      } | {
          calendarEventRsvp: APICalendarEventRsvp;
          serverId: string;
      } | {
          listItem: APIListItem;
          serverId: string;
      } | {
          listItem: APIListItem;
          serverId: string;
      } | {
          listItem: APIListItem;
          serverId: string;
      } | {
          listItem: APIListItem;
          serverId: string;
      } | {
          listItem: APIListItem;
          serverId: string;
      } | {
          reaction: APIMessageReaction;
          serverId?: string;
      } | {
          reaction: APIMessageReaction;
          serverId?: string;
      }

      The data of the event.

    Returns void | Promise<void>