Use Dexbi with Modmail

Connect your Modmail bot from Deploy, and Dexbi answers members in every Modmail thread.

Modmail lets members DM your bot to reach your staff. Each conversation becomes a thread: a private channel in your server where your staff read the member's messages and reply with ?reply.

Dexbi can answer in those threads. You set it up in the Dexbi dashboard, the same way you set up Dexbi for a ticket bot: you start a new ticket deployment and pick Modmail. Then you send two commands to your Modmail bot, and it connects by itself. There's no key to create or paste.

It takes about two minutes, and you don't need to write any code.

What Dexbi does in your threads

  • It replies to members straight away, at any time of day, so nobody waits for staff to come online.
  • It gives your staff time to reply when they're talking to the member, and answers if they don't.
  • It escalates the thread to your staff when the member needs something only a person can do, such as a refund.
  • It closes the thread once the member says their problem is solved.
  • It renames the thread channel so your staff can see what each thread is about from the channel list.

Each of these is explained in How it works in a thread below. You change all of them in the dashboard.

Before you start

You need all three of these:

  1. Your own Modmail bot, version 4.0 or newer. This is the open-source Modmail bot that you host yourself, for example on your own server or a hosting service. Dexbi works with every 4.x version: 4.0, 4.1 and 4.2. Not sure which one you have? Send ?about and Modmail shows its version.

    Works with Modmail v4 (4.0 to 4.2) and bots built on it, like OpenModmail and hosted Modmail bots, whatever version number they show. Use the install command below exactly as written, with @master at the end: it works on all of them.

    It doesn't work with the hosted bot from modmail.xyz, or with other bots that have "modmail" in their name. Those don't support Modmail plugins.

  2. The Owner permission level on your Modmail bot. Modmail only lets its owners add plugins. Connecting Dexbi needs the Administrator level or higher.

  3. The Owner or Admin role in your Dexbi workspace. Only they can create deployments. See Roles.

If you haven't set up Dexbi yet, follow Set up in 5 minutes first. Dexbi needs your documents to answer members' questions.

Set it up

Start a Modmail deployment

  1. Open the Dexbi dashboard and go to Deploy.
  2. Under Ticket agent, click New.
  3. Dexbi asks What ticket system do you use? Pick Modmail.

The page shows Connect your Modmail bot, with two commands to send to your Modmail bot. Nothing is created yet: the deployment appears in your list once your bot connects. Keep this page open for the next two steps.

Add the plugin to Modmail

Copy the first command from the page and send it in any channel where your Modmail bot reads commands:

?plugins add throgz/modmail-plugins/dexbi@master

Modmail downloads the plugin and turns it on. This takes a few seconds, and Modmail replies when it's done.

Every command on this page starts with ?, Modmail's usual prefix. If your Modmail bot uses another one, like - or !, type that instead.

Only an owner of your Modmail bot can run these commands. If Modmail doesn't reply at all, you're not one: ask whoever runs or hosts your Modmail bot to add you as an owner.

Connect it

Copy the second command from the page and send it in the same place. It looks like this, with your own code at the end:

?dexbi connect ABCD-2345

The code links your Modmail bot to this deployment.

  • It works once.
  • It expires after 15 minutes. While the page is open, it gets a new code by itself, so the one you see always works.
  • Never share it. Anyone who uses it first connects their bot instead of yours.
  • Only Modmail Administrators can run it, and the plugin deletes your ?dexbi connect message right after it runs.

While it waits, the page says Waiting for your Modmail bot…. When the plugin connects, Dexbi creates a deployment called Modmail. It appears in your Ticket agent list as Connected, and its page opens with its settings. You don't need to refresh the page.

If you leave the page before connecting, nothing is left behind. Click New again for a new code.

Check that it works

Ask a test question in your Modmail bot's channel:

?dexbi test how do I reset my password?

Dexbi's answer appears in the channel you sent it in. No member gets a message.

You're done. From now on, Dexbi replies to members in every new Modmail thread.

Change its settings

Open Deploy and click your Modmail deployment in the Ticket agent list. Every setting is on its page, and changes save as you make them. Your Modmail bot picks them up on its next message. You don't need to send any command.

Name. What the deployment is called in the list. It's Modmail to start with.

Answering:

  • When it replies: Smart reply (the default), All messages or Only pings. They work the same as in a ticket. See When it replies.
  • Wait for your team: with Smart reply, how long Dexbi gives your staff to reply before it answers. 5 minutes unless you change it. Never leaves the thread to your staff once they have replied. See When your staff reply.
  • Show images from the docs: whether Dexbi includes screenshots from your documents in its replies.
  • Reply as (paid plans): Dexbi sends replies as Dexbi, or under your Personalize name and picture if you set them. The option shows that name. Anonymous staff makes them look like an anonymous reply from your staff. On the Free plan, replies always show as Dexbi. See How replies look.

Escalate to staff. Lets Dexbi escalate a thread to your staff when one of your escalation rules matches. See When the member needs a person.

Smart close. Lets Dexbi close a thread once the member says they're done. See When the problem is solved.

Smart rename. Lets Dexbi add a short title to the thread channel's name. See Thread names.

Modmail keeps its own thread logs, so a Modmail deployment has no Transcripts setting.

Connection status

The Ticket agent list on Deploy shows your Modmail deployment next to your other ticket deployments, with one of these:

StatusWhat it means
ConnectedYour Modmail bot is connected and has checked in recently. Dexbi is answering.
Not seen latelyYour Modmail bot was connected, but hasn't checked in for over an hour.
DisconnectedYou clicked Disconnect. Your Modmail bot is cut off and Dexbi doesn't answer. Click Reconnect to use it again.

While it's running, the plugin checks in with Dexbi every 10 minutes, so you can tell from the dashboard that it's still working.

Not seen lately usually means your Modmail bot is offline, or the plugin was removed. Start your bot again, or add the plugin again. It shows Connected again on its next check-in.

Reconnect

To connect a different Modmail bot, or to set it up again from the start, open the deployment and click Reconnect. You get a new code. Send the two commands to the bot you want to connect.

Only one bot can be connected to a deployment at a time. When the new code is used, the old connection stops working.

Disconnect

To cut your Modmail bot off straight away, open the deployment and click Disconnect. Dexbi stops answering in your Modmail threads at once. The deployment and its settings stay on Deploy, marked Disconnected. Click Reconnect when you want Dexbi back.

Which threads Dexbi answers

Dexbi answers in every thread your Modmail bot opens. That includes threads members open by picking an option from Modmail's thread menu, and threads you move to another category with ?move.

To keep Dexbi out of a single thread, send ?dexbi pause inside it. To keep it out for a while, add how long: ?dexbi pause 30m, ?dexbi pause 1h or ?dexbi pause 24h. A timed pause ends by itself, even if your Modmail bot restarts. Send ?dexbi resume there to end a pause early.

While a thread is paused, Dexbi doesn't answer anyone there, but it still reads your staff's replies. When it answers again, it knows what your staff told the member.

To stop Dexbi in every thread but keep your settings, click Disconnect in the deployment. To remove it for good, delete the deployment on Deploy: your Modmail bot is disconnected straight away too.

How it works in a thread

When a member asks a question

Dexbi replies in the thread using Modmail's normal reply.

  • The member gets the reply in their DMs, exactly like a reply from your staff.
  • Your staff see the same reply in the thread channel.

Dexbi says hello at the start of a new conversation. In its answers, it offers more help if the member needs it.

When your staff reply

When one of your staff replies to the member, with ?reply or any other Modmail reply command, Dexbi sees the reply too.

It then works the same as in a Discord ticket: when the member writes, Dexbi gives your staff time to reply. If nobody does, Dexbi answers. How long it waits is Wait for your team in the deployment, 5 minutes unless you change it. See Smart reply in a ticket.

Your staff don't need to type anything special for any of this. They reply the way they always do.

When the member needs a person

You decide what needs a person by writing escalation rules in the Dexbi dashboard, for example "the member asks for a refund".

When a member's message matches one of your rules, Dexbi:

  1. tells the member that someone from your team will help them,
  2. posts a card in the thread titled "Dexbi escalated this thread to your team", with a short summary of the problem, so your staff don't have to read the whole conversation,
  3. pings the roles that your escalation actions ping.

To choose who gets pinged, go to Guidance > Escalation and add a Ping a role action under On escalation. Your Modmail threads use the same roles as your Discord tickets. With no role there, Dexbi pings no one, and the card is still posted.

Only your staff can see the card. The member doesn't.

After an escalation, Dexbi stays quiet in that thread until it's closed. When your staff are done and want Dexbi to take the thread back, send ?dexbi resume inside it. Dexbi answers the member's next messages again, and remembers the whole thread. If the same member opens a new thread later, Dexbi answers again from the start.

When the problem is solved

When the member says their problem is solved, or that they don't need any more help, Dexbi sends a short goodbye. Then it closes the thread the same way ?close does.

This means everything a normal close does still happens. Modmail saves the thread log, and the member gets your usual closing message.

Dexbi doesn't close a Modmail thread just because the member went quiet. Modmail's own ?close timers still work as usual for that.

Thread names

After Dexbi understands what the thread is about, it adds a short title to the end of the thread channel's name. For example, throgz becomes throgz-double-charge.

  • The member's name stays at the front, so your staff can still find threads by name.
  • Dexbi renames each thread only once.
  • Renaming is included on paid plans.
  • Your Modmail bot needs the Manage Channels permission. Most Modmail bots already have it. If it's missing, Dexbi posts a note in the thread telling you.

Screenshots and files

Screenshots members send

When a member sends a screenshot, Dexbi looks at it and answers with it in mind. For example, if a member sends a picture of an error message, Dexbi reads the error.

  • Dexbi reads up to 4 images per message.
  • Images can be PNG, JPG, WebP or GIF.
  • For other files, like a PDF or a zip, Dexbi only sees the file name, not what's inside.
  • If a member sends only a file with no text, Dexbi doesn't reply, and your staff handle it.

Screenshots Dexbi sends

If your documents include screenshots, Dexbi can show them in its answers. They're attached to the reply the same way an image your staff attach is, and several images show together in one reply.

To make this work for every Modmail bot, the plugin first posts the screenshots in your Modmail log channel, with the text "Screenshots from a Dexbi answer". This gives each image a Discord link that keeps working. Please don't delete those posts, or the images in old replies will stop loading.

How replies look

Dexbi's replies use the same card as your staff's replies, so members and staff see one consistent style. Who the reply comes from depends on your plan.

On the Free plan, every reply shows as Dexbi, with Dexbi's name and logo, and ends with a "Powered by dexbi.app" line that links to dexbi.app. Reply as is locked on the Free plan. The Terms of Service say the line has to stay visible.

On a paid plan, there's no line, and you pick the sender with Reply as in the deployment:

  • Dexbi (the default): the reply shows as Dexbi. If you set a nickname or avatar in Personalize, it shows those instead, and the option carries your nickname.
  • Anonymous staff: the reply looks like an anonymous reply from your staff, using the anonymous name and picture you set in Modmail.

Showing Dexbi or your Personalize profile as the sender needs version 1.2.0 of the plugin or newer. Older versions show your Modmail bot's name. See Update or remove the plugin.

Dexbi's formatting is adjusted to fit the card:

  • headings become bold lines,
  • tables become simple lines of text,
  • a very long answer is sent as more than one reply, so nothing gets cut off.

Commands

Your settings live in the dashboard, so the plugin only has a few commands.

CommandWhat it does
?dexbiShows whether Dexbi is connected and working, and the list of commands.
?dexbi connect <code>Connects your Modmail bot to a Modmail deployment. The code comes from the dashboard.
?dexbi test <question>Shows Dexbi's answer in this channel. No member gets a message.
?dexbi pause [30m, 1h or 24h]Send inside a thread. Dexbi stops replying in that thread only, until you resume it or the time runs out. It still reads your staff's replies.
?dexbi resumeSend inside a thread. Dexbi replies there again: it lifts a pause, and takes back a thread it escalated to your team.
?dexbi forgetSend inside a thread. Dexbi forgets the thread so far and starts fresh. A pause stays.
?dexbi key <key>Connects with an API key instead. See Connect with an API key.

Who can use which command:

  • connect, key and test need the Administrator permission level in Modmail.
  • ?dexbi, pause, resume and forget work for anyone with the Supporter level or higher.

Timed pauses, ?dexbi forget, and ?dexbi resume taking back an escalated thread need version 1.3.0 of the plugin or newer. See Update or remove the plugin.

When something goes wrong

If Dexbi can't reply, for example because your plan's replies ran out, the member doesn't get an error message. Their message reaches your staff in the thread as normal, and your staff can reply themselves.

Your staff also get a note in the thread explaining what went wrong. Only staff can see it. The same problem is noted once per thread, so the note doesn't repeat.

While your Modmail deployment is paused, disconnected or deleted, Dexbi posts nothing at all, not even a note. Modmail works as if Dexbi wasn't there. ?dexbi tells your staff why.

What you seeWhat to do
Modmail doesn't reply to ?plugins addCheck you used your bot's own prefix, and that you're an owner of the Modmail bot (see Add the plugin).
The page still says Waiting for your Modmail bot…Check that Modmail replied to ?plugins add. Then send the ?dexbi connect command from the page again, with the code shown there now.
?dexbi connect isn't recognisedYour Modmail bot has an older copy of the plugin. Run ?plugins update throgz/modmail-plugins/dexbi@master first, then the ?dexbi connect command again.
?dexbi connect says the code didn't workThe code was already used, or it expired. Copy the command again from the page: it always shows a fresh code.
The list says Not seen latelyYour Modmail bot is offline, or the plugin was removed. Start the bot again, or add the plugin again.
?dexbi says it's disconnectedSomeone clicked Disconnect, used a new code from Reconnect on another bot, or deleted the deployment. Go to Deploy, open your Modmail deployment and click Reconnect. If it was deleted, set it up again with New > Modmail. Members see nothing while it's disconnected.
?dexbi says the deployment is pausedSomeone paused your Modmail deployment. Dexbi stays quiet in every thread, and Modmail works as usual. Go to Deploy, open your Modmail deployment and click Resume.
Dexbi doesn't reply in one threadIf your staff replied last, Dexbi waits for them first (Wait for your team, 5 minutes unless you changed it). With Never, it leaves the thread to them. It may be paused there, or it escalated the thread to your team and stays quiet on purpose. Either way, send ?dexbi resume inside the thread when you want Dexbi back.
A note says your plan's replies ran outDexbi starts replying again when your monthly replies reset, or when you upgrade. That thread stays with your staff: send ?dexbi resume in it to hand it back.
A note says Dexbi couldn't rename the threadGive your Modmail bot the Manage Channels permission.

What it costs

  • Each reply Dexbi sends counts as one AI reply on your Dexbi plan, the same as a reply in your Discord channels.
  • Your staff's messages are free. Dexbi reads them so it knows when your staff are talking, but that doesn't use your replies.
  • ?dexbi test uses one AI reply, because Dexbi writes a real answer.
  • When your AI replies for the month run out, Dexbi stops replying until they reset. Your staff handle threads as usual in the meantime. The threads Dexbi couldn't answer then stay with your staff after the replies reset. Send ?dexbi resume in one to hand it back to Dexbi.

Update or remove the plugin

?dexbi shows which version of the plugin you have. When a newer one is out, your Modmail deployment's page says Update available, with the command to copy. To get the newest version:

?plugins update throgz/modmail-plugins/dexbi@master

To remove the plugin:

?plugins remove throgz/modmail-plugins/dexbi@master

Removing the plugin doesn't delete anything in your Dexbi workspace. The deployment stays on Deploy and shows Not seen lately. Click Disconnect or delete it there if you don't need it anymore.

Connect with an API key

You can also connect the plugin with an API key instead of a code. Most servers don't need this: use a Modmail deployment if you can.

  1. In the dashboard, go to Settings > API keys, create a key and copy it.
  2. Send ?dexbi key <your key> to your Modmail bot. The plugin deletes your message straight away, so nobody else can copy the key.

With a key, there's no deployment on Deploy, so you can't change the settings in the dashboard. If you set the plugin up with ?dexbi key before this update, it keeps the reply style, escalation role and wait you set then. New setups use the defaults: Smart reply, a 5-minute wait for your team, replies as the bot, and no role pinged on an escalation.

Build your own

The plugin uses the Dexbi API. To connect a different bot yourself, see the Modmail recipe.

On this page