useTheme
function in meocord/common Since 4.1.0
useTheme(): ResolvedThemeThe theme of the running call, with every role present.
Read it wherever a call runs: in a handler, in a service or presenter it calls, and in work it starts, such as a
timer's follow-up. Outside a call, it is the theme of the app the process runs, from when its start begins until the
start fails or the app has shut down, its onShutdown hooks included, and MeoCord's defaults otherwise; it never
throws.
Returns
ResolvedThemeThe resolved theme, with every role present.
Examples
@Command('save', CommandType.SLASH)
async save(interaction: ChatInputCommandInteraction) {
const { colors, emojis } = useTheme()
await respond(interaction).send({ embeds: [{ description: `${emojis.success} Saved`, color: resolveColor(colors.success) }] })
}