Hierarchy

  • RolesService

Constructors

Properties

httpRequest: BaseHttpRequest

Methods

  • Create a role By default, a role will be created with the lowest priority on a server. You can update its priority using the role update route

    Throws

    ApiError

    Parameters

    • options: {
          requestBody: {
              colors?: number[];
              isDisplayedSeparately?: boolean;
              isMentionable?: boolean;
              isSelfAssignable?: boolean;
              name: string;
              permissions: string[];
          };
          serverId: string;
      }
      • requestBody: {
            colors?: number[];
            isDisplayedSeparately?: boolean;
            isMentionable?: boolean;
            isSelfAssignable?: boolean;
            name: string;
            permissions: string[];
        }
        • Optional colors?: number[]

          An array of integer values corresponding to the decimal RGB representation for a color. The first color is solid, and a second color indicates a gradient

        • Optional isDisplayedSeparately?: boolean

          If set, the role will be displayed separately in the channel member list

        • Optional isMentionable?: boolean

          If set, this role can be mentioned

        • Optional isSelfAssignable?: boolean

          If set, this roll will be self assigned

        • name: string

          The role's name

        • permissions: string[]

          Permissions must be a collection of valid permissions as defined in the Enums/Permissions section

      • serverId: string

    Returns CancelablePromise<{
        role: RolePayload;
    }>

    any Success

  • Update a role permission

    Throws

    ApiError

    Parameters

    • options: {
          requestBody: {
              permissions: Record<string, any>;
          };
          roleId: number;
          serverId: string;
      }
      • requestBody: {
            permissions: Record<string, any>;
        }
        • permissions: Record<string, any>

          A JSON object of Enums/Permissions with true or false values.

      • roleId: number
      • serverId: string

    Returns CancelablePromise<{
        role: RolePayload;
    }>

    any Success

  • Update a role Note that when a priority is updated, there will still only be a socket event for the role that was touched directly and not for other roles that were shifted

    Throws

    ApiError

    Parameters

    • options: {
          requestBody: {
              colors?: number[];
              isDisplayedSeparately?: boolean;
              isMentionable?: boolean;
              isSelfAssignable?: boolean;
              name?: string;
              permissions?: string[];
              priority?: number;
          };
          roleId: number;
          serverId: string;
      }
      • requestBody: {
            colors?: number[];
            isDisplayedSeparately?: boolean;
            isMentionable?: boolean;
            isSelfAssignable?: boolean;
            name?: string;
            permissions?: string[];
            priority?: number;
        }
        • Optional colors?: number[]

          An array of integer values corresponding to the decimal RGB representation for a color. The first color is solid, and a second color indicates a gradient

        • Optional isDisplayedSeparately?: boolean

          If set, the role will be displayed separately in the channel member list

        • Optional isMentionable?: boolean

          If set, this role can be mentioned

        • Optional isSelfAssignable?: boolean

          If set, this roll will be self assigned

        • Optional name?: string

          The role's name

        • Optional permissions?: string[]

          Permissions must be a collection of valid permissions as defined in the Enums/Permissions section

        • Optional priority?: number

          The priority the role will be in relation to other roles in the server. The higher the value, the more precedence the role has over lower priority roles, and the higher up it will be displayed in the UI. Values can be zero or negative!

      • roleId: number
      • serverId: string

    Returns CancelablePromise<{
        role: RolePayload;
    }>

    any Success

  • Read a server member's permissions If the user has all of the permissions passed, the HTTP status code will be 200; if user is missing one or more permissions passed, the HTTP status code will be 418 with a meta property containing missingPermissions of the permissions the user does not have (this is a 418 to differentiate from a 403 if the bot did not have permissions to perform the request, not the user). Tip: Use the HEAD HTTP method for this route if you only care about if the user has permissions and not the response body containing what's missing.

    Throws

    ApiError

    Parameters

    • options: {
          categoryId?: number;
          channelId?: string;
          ids?: ("CanCreateTopics" | "CanCreateTopicReplies" | "CanDeleteTopics" | "CanStickyTopics" | "CanLockTopics" | "CanManageEmotes" | "CanViewFormResponses" | "CanUpdateListItems" | "CanManageServerXp" | "CanCreateThreads" | "CanCreateThreadMessages" | "CanManageThreads" | "CanCreateAnnouncements" | "CanUpdateServer" | "CanManageRoles" | "CanInviteMembers" | "CanKickMembers" | "CanManageGroups" | "CanManageChannels" | "CanManageWebhooks" | "CanMentionEveryone" | "CanModerateChannels" | "CanBypassSlowMode" | "CanReadApplications" | "CanApproveApplications" | "CanEditApplicationForm" | "CanIndicateLfmInterest" | "CanModifyLfmStatus" | "CanReadAnnouncements" | "CanManageAnnouncements" | "CanReadChats" | "CanCreateChats" | "CanUploadChatMedia" | "CanCreatePrivateMessages" | "CanManageChats" | "CanReadEvents" | "CanCreateEvents" | "CanEditEvents" | "CanDeleteEvents" | "CanEditEventRsvps" | "CanReadForums" | "CanReadDocs" | "CanCreateDocs" | "CanEditDocs" | "CanDeleteDocs" | "CanReadMedia" | "CanAddMedia" | "CanEditMedia" | "CanDeleteMedia" | "CanListenVoice" | "CanAddVoice" | "CanManageVoiceGroups" | "CanAssignVoiceGroup" | "CanBroadcastVoice" | "CanDirectVoice" | "CanPrioritizeVoice" | "CanUseVoiceActivity" | "CanMuteMembers" | "CanDeafenMembers" | "CanSendVoiceMessages" | "CanCreateScrims" | "CanManageTournaments" | "CanRegisterForTournaments" | "CanChangeNickname" | "CanManageNicknames" | "CanViewPollResponses" | "CanReadListItems" | "CanCreateListItems" | "CanDeleteListItems" | "CanCompleteListItems" | "CanReorderListItems" | "CanViewBracket" | "CanReportScores" | "CanReadSchedules" | "CanCreateSchedule" | "CanDeleteSchedule" | "CanManageBots" | "CanReadStreams" | "CanJoinStreamVoice" | "CanCreateStreams" | "CanSendStreamMessages" | "CanAddStreamVoice" | "CanUseVoiceActivityInStream" | "CanReceiveAllSocketEvents")[];
          serverId: string;
          userId: string;
      }
      • Optional categoryId?: number
      • Optional channelId?: string
      • Optional ids?: ("CanCreateTopics" | "CanCreateTopicReplies" | "CanDeleteTopics" | "CanStickyTopics" | "CanLockTopics" | "CanManageEmotes" | "CanViewFormResponses" | "CanUpdateListItems" | "CanManageServerXp" | "CanCreateThreads" | "CanCreateThreadMessages" | "CanManageThreads" | "CanCreateAnnouncements" | "CanUpdateServer" | "CanManageRoles" | "CanInviteMembers" | "CanKickMembers" | "CanManageGroups" | "CanManageChannels" | "CanManageWebhooks" | "CanMentionEveryone" | "CanModerateChannels" | "CanBypassSlowMode" | "CanReadApplications" | "CanApproveApplications" | "CanEditApplicationForm" | "CanIndicateLfmInterest" | "CanModifyLfmStatus" | "CanReadAnnouncements" | "CanManageAnnouncements" | "CanReadChats" | "CanCreateChats" | "CanUploadChatMedia" | "CanCreatePrivateMessages" | "CanManageChats" | "CanReadEvents" | "CanCreateEvents" | "CanEditEvents" | "CanDeleteEvents" | "CanEditEventRsvps" | "CanReadForums" | "CanReadDocs" | "CanCreateDocs" | "CanEditDocs" | "CanDeleteDocs" | "CanReadMedia" | "CanAddMedia" | "CanEditMedia" | "CanDeleteMedia" | "CanListenVoice" | "CanAddVoice" | "CanManageVoiceGroups" | "CanAssignVoiceGroup" | "CanBroadcastVoice" | "CanDirectVoice" | "CanPrioritizeVoice" | "CanUseVoiceActivity" | "CanMuteMembers" | "CanDeafenMembers" | "CanSendVoiceMessages" | "CanCreateScrims" | "CanManageTournaments" | "CanRegisterForTournaments" | "CanChangeNickname" | "CanManageNicknames" | "CanViewPollResponses" | "CanReadListItems" | "CanCreateListItems" | "CanDeleteListItems" | "CanCompleteListItems" | "CanReorderListItems" | "CanViewBracket" | "CanReportScores" | "CanReadSchedules" | "CanCreateSchedule" | "CanDeleteSchedule" | "CanManageBots" | "CanReadStreams" | "CanJoinStreamVoice" | "CanCreateStreams" | "CanSendStreamMessages" | "CanAddStreamVoice" | "CanUseVoiceActivityInStream" | "CanReceiveAllSocketEvents")[]

        A queryString array of ids[] representing Enums/Permissions

      • serverId: string
      • userId: string

    Returns CancelablePromise<{
        permissions: string[];
    }>

    any Success

Generated using TypeDoc