Skip to navigation

SDK resources

Every namespace and method on the Aegis client.
View as Markdown

Naming

Method names follow the path they call. Path parameters become positional arguments in the order they appear, and the payload is the last one — a query object for GET, a body for POST/PUT/PATCH.

GET /v1/image/filter/{type}?image=…
→ aegis.image.filter('ascii', { image: '…' })

The …Query versus …Body suffix on exported types tells you which you are holding.

Music

The largest namespace — see the Music guide for what these do.

// Search and play
aegis.music.search({ query, limit?, provider? })
aegis.music.play(guildId, body)
// Playback
aegis.music.pause(guildId)
aegis.music.resume(guildId)
aegis.music.skip(guildId)
aegis.music.restart(guildId)
aegis.music.stop(guildId)
aegis.music.seek(guildId, { position })
aegis.music.shuffle(guildId)
// Queue
aegis.music.queue(guildId)
aegis.music.clearQueue(guildId)
aegis.music.removeFromQueue(guildId, index)
aegis.music.moveInQueue(guildId, index, { to })
// Volume
aegis.music.volume(guildId)
aegis.music.setVolume(guildId, { volume, muted? })
aegis.music.mute(guildId, { muted? })
aegis.music.unmute(guildId)
// Loop, fading, gapless, filters, mixes
aegis.music.loop(guildId)
aegis.music.setLoop(guildId, { mode })
aegis.music.fading(guildId)
aegis.music.setFading(guildId, body)
aegis.music.nextTrack(guildId)
aegis.music.setNextTrack(guildId, { gapless })
aegis.music.filters(guildId)
aegis.music.setFilters(guildId, body) // {} clears them
aegis.music.mix(guildId)
aegis.music.addMix(guildId, body)
aegis.music.setMixVolume(guildId, mixId, { volume })
aegis.music.removeMix(guildId, mixId)
// Metadata
aegis.music.meaning(guildId, { encoded })
aegis.music.lyrics(guildId, { encoded, lang? })

addMix requires volume in its type even though the server defaults it to 0.8, because the generated schema marks defaulted properties as required.

Jobs

aegis.jobs.get(id)
aegis.jobs.wait(id, { timeout? }) // seconds, 1–300

wait rejects with an AegisError of status 504 if the job is still running when the timeout elapses.

Image

aegis.image.filter(type, { image }) // pixelart, ascii, blur, sepia, ...
aegis.image.overlay(type, { image }) // gay, communism, drip, wanted

Both return a queued job, not an image — collect it with aegis.jobs.

Tools

aegis.tools.screenshot({ url, device?, fullpage? })
aegis.tools.encode({ text })
aegis.tools.decode({ text })

aegis.binary.encode and aegis.binary.decode are deprecated aliases of the last two.

Minecraft

aegis.minecraft.info(player)
aegis.minecraft.textures(player)
aegis.minecraft.render(player, { render?, scale?, skinUrl?, capeUrl? })

Roblox

aegis.roblox.user(target) // string | number
aegis.roblox.game(target) // string | number, numeric only

Translation

aegis.translation.translate({ text, to, from? })
aegis.translation.detect({ text })
aegis.translation.languages()

Bible

aegis.bible.languages()
aegis.bible.types(language)
aegis.bible.translations()
aegis.bible.books(translation)
aegis.bible.chapter(translation, book, chapter)
aegis.bible.search(translation, { q })
aegis.bible.verses(translation, { refs })
aegis.bible.data(language, type)

Holidays

aegis.holidays.next(countryCode)
aegis.holidays.year(countryCode, year)

Fun

aegis.fun.roleplay({ type, amount? })

General

aegis.general.status()

This response has no data envelope in the API, so it resolves to the whole object.

Getting at the response types

import type {
Track,
PlayerState,
PlayResult,
PausedResult,
SkipResult,
OkResult,
VolumeResult,
MuteResult,
SeekResult,
ShuffleResult,
ClearQueueResult,
RestartResult,
LoopResult,
RemoveResult,
MoveResult,
Job,
Fading,
AudioFilters,
MixLayer,
Meaning,
Lyrics,
} from 'aegis-api'

Those cover the music and job shapes. Anything else is reachable through the schema:

import type { components } from 'aegis-api'
type SearchResult = components['schemas']['MusicSearchResult']
type BibleData = components['schemas']['BibleDataSummary']