You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
discordbot.js/lib/web/schema.graphqls

437 lines
7.4 KiB
GraphQL

enum LogLevel {
SILLY
DEBUG
VERBOSE
INFO
WARN
ERROR
}
type PageInfo {
# the total number of entries on all pages
total: Int
# the number of entries per page
perPage: Int
# the current page
currentPage: Int
# the last page
lastPage: Int
# If there is a next page
hasNextPage: Boolean
}
type MediaEntry {
# the id of the media entry
id: ID!
# the url to the YouTube video
url: String!
# the title of the YouTube video
name: String!
# the url of the YouTube video's thumbnail
thumbnail: String!
}
type MediaEntryEdge {
# the id of the edge
id: ID!
node: MediaEntry
# the position of the entry in the queue
position: Int
}
type MediaEntryConnection {
edges: [MediaEntryEdge]
nodes: [MediaEntry]
# the pagination information
pageInfo: PageInfo
}
type MusicPlayer {
# the content of the music players queue
#
# Arguments
# id: get the media entry by id
# page: get the page by number
# perPage: the number of entries per page
queue(
id: ID,
page: Int,
perPage: Int
): MediaEntryConnection
# the current position in the song
songPosition: Int
# if the music player is currently playing
playing: Boolean!
# the volume of the music player
volume: Float
# if the music player plays on repeat
repeat: Boolean
# the currently playing song
currentSong: MediaEntry
# the quality of the music that is played (YouTube quality)
quality: String
# the name of the voice channel the music player is playing in
voiceChannel: String
# if the music player is connected to a voice channel
connected: Boolean!
# if the music player is paused
paused: Boolean!
}
type User {
# the id of the user
id: ID!
# the discord id of the user
discordId: String
# the name of the user
name: String!
# the url of the users avatar
avatar: String
# if the user is a bot
bot: Boolean
# the discord tag of the user
tag: String!
# the current presence of the user
presence: Presence
}
type Role {
# the id of the role
id: ID!
# the discord id of the role
discordId: String
# the name of the role
name: String
# the color of the role
color: String
}
type GuildMemberRoleEdge {
# the id of the edge
id: ID!
node: GuildMember
# if the role is the highest of the guild member
isHighest: Boolean
}
type GuildMemberRoleConnection {
edges: [GuildMemberRoleEdge]
nodes: [GuildMember]
# the pagination information
pageInfo: PageInfo
}
type GuildRoleEdge {
# the id of the edge
id: ID!
node: Role
# the members in the role
#
# Arguments
# id: get the member by id
# page: get the page by number
# perPage: the number of entries per page
members(
id: ID,
page: Int,
perPage: Int
): GuildMemberRoleConnection
}
type GuildRoleConnection{
edges: [GuildRoleEdge]
nodes: [Role]
# the pagination information
pageInfo: PageInfo
}
type GuildMember {
# the id of the guild member
id: ID!
# the discord id of the guild member
discordId: String
# the user associated with the guild member
user: User
# the nickname of the guild member
nickname: String
# the roles of the guild member
roles(
first: Int = 10,
offset: Int = 0,
id: String
): [Role]
# the highest role of the guild member
highestRole: Role
}
type GuildMemberEdge {
# the id of the edge
id: ID!
node: GuildMember
# if the guild member is the server owner
isOwner: Boolean
}
type GuildMemberConnection{
edges: [GuildMemberEdge]
nodes: [GuildMember]
# the pagination information
pageInfo: PageInfo
}
type Guild {
# the id of the guild
id: ID!
# the discord id of the guild
discordId: ID
# the guild's name
name: String
# the owner of the guild
owner: GuildMember
# the members in the guild
#
# Arguments
# id: get the member by id
# page: get the page by number
# perPage: the number of entries per page
members(
id: ID,
page: Int,
perPage: Int
): GuildMemberConnection
# the roles of the guild
#
# Arguments
# id: get the role by id
# page: get the page by number
# perPage: the number of entries per page
roles(
id: ID,
page: Int,
perPage: Int
): GuildRoleConnection
# the url of the guild icon
icon: String
}
type GuildEdge {
# the id of the edge
id: ID!
node: Guild
# the music player associated with the guild
musicPlayer: MusicPlayer
# the saved media of the guild
#
# Arguments
# page: the number of the page
# perPage: the number of entries per page
savedMedia (
page: Int,
perPage: Int
): mediaEntryConnection
}
type GuildConnection {
edges: [GuildEdge]
nodes: [Guild]
# the pagination information
pageInfo: PageInfo
}
type Client {
# the guilds the client has joined
#
# Arguments
# id: get the guild by id
# page: get the page by number
# perPage: the number of entries per page
guilds (
id: ID,
page: Int,
perPage: Int
): GuildConnection
# the number of voice connections
voiceConnectionCount: Int
# the bot user
user: User
# the current average ping
ping: Float
# the websocket status
status: Int
# the total uptime
uptime: Int
}
type LogEntry {
# the id of the log entry
id: ID!
# the message of the log entry
message: String
# the level of the log entry
level: Level
# the timestamp of the log entry
timestamp: String
# the module that created the log entry
module: String
}
type Query {
# The bots client
client: Client
# the presences in the presence rotation
presences: [String]!
# the prefix for commands
prefix: String
# The log entries generated in the current runtime.
#
# Arguments
# first: the number of entries to get
# offset: the offset of the entries
# id: get the log entry by id
# last: oposite of first - the latest entries
# level: filter by loglevel
logs(
first: Int,
offset: Int = 0,
id: String,
last: Int = 10,
level: LogLevel
): [LogEntry]
}
type Mutation {
# adds media to the queue
#
# Arguments
# guildId: the id of the guild
# url: the url to the media YouTube video
addMediaToQueue(
guildId: ID!,
url: String!
): MusicPlayer
# removes media from the queue
#
# Arguments
# guildId: the id of the guild
# entryId: the id of the media entry to remove
removeMediaFromQueue(
guildId: ID!,
entryId: ID!
): MusicPlayer
# skips to the next song
#
# Arguments
# guildId: the id of the guild
skipSong(guildId: ID!): MusicPlayer
# toggles between pause and play
#
# Arguments
# guildId: the id of the guild
togglePause(guildId: ID!): MusicPlayer
# toggles repeat
#
# Arguments
# guildId: the id of the guild
toggleRepeat(guildId: ID!): MusicPlayer
# stops the music
#
# Arguments
# guildId: the id of the guild
stopMusic(guildId: ID!): MusicPlayer
}