Skip to content

Prefix Resolver

This guide will help you to understand the prefix resolver.

The PrefixResolver service is used to manage the bot’s prefixes. You can use it to add, remove, and get prefixes for a guild.

To access the PrefixResolver service, you need to get it from the ServiceContainer.

import { ServiceContainer } from 'zumito-framework';
import { PrefixResolver } from 'zumito-framework';
const prefixResolver = ServiceContainer.get(PrefixResolver);

Once you have the PrefixResolver service, you can use it to manage the bot’s prefixes.

To get a prefix for a guild, you can use the getPrefix method.

const prefix = await prefixResolver.getPrefix(guildId);