add docs and delete option to inline command
This commit is contained in:
parent
66010047b5
commit
ff9168e493
12
README.md
12
README.md
|
@ -61,6 +61,18 @@ The Artificer comes with a few supplemental commands to the main rolling command
|
||||||
* Adds you to an ignore list so the bot will never respond to you
|
* Adds you to an ignore list so the bot will never respond to you
|
||||||
* `[[opt-in` **Available via DM ONLY**
|
* `[[opt-in` **Available via DM ONLY**
|
||||||
* Removes you from the ignore list
|
* Removes you from the ignore list
|
||||||
|
* `[[inline [subcommand]`
|
||||||
|
* Controls whether or not inline rolls can be done in a guild, defaults off. These commands may only be used by the Owner or Admins of your guild.
|
||||||
|
* An inline roll is a roll that does not immediately start with `[[`, such as `test [[d20]]`.
|
||||||
|
* Available subcommands:
|
||||||
|
* `[[api help`
|
||||||
|
* Provides a message similar to this subcommand description.
|
||||||
|
* `[[inline status`
|
||||||
|
* Shows the current status of inline rolls for this guild.
|
||||||
|
* `[[inline allow` or `[[inline enable`
|
||||||
|
* Allows inline rolls in the guild.
|
||||||
|
* `[[inline block` or `[[inline disable` or `[[inline delete`
|
||||||
|
* Blocks inline rolls in the guild.
|
||||||
* `[[xdydzracsq!]]`
|
* `[[xdydzracsq!]]`
|
||||||
* This is the command the bot was built specifically for.
|
* This is the command the bot was built specifically for.
|
||||||
* It looks a little complicated at first, but if you are familiar with the [Roll20 formatting](https://artificer.eanm.dev/roll20), this will no different.
|
* It looks a little complicated at first, but if you are familiar with the [Roll20 formatting](https://artificer.eanm.dev/roll20), this will no different.
|
||||||
|
|
|
@ -85,6 +85,11 @@ export const help = (message: DiscordenoMessage) => {
|
||||||
value: 'Removes you from the ignore list',
|
value: 'Removes you from the ignore list',
|
||||||
inline: true,
|
inline: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: `\`${config.prefix}inline [subcommand]\``,
|
||||||
|
value: `Controls whether or not inline rolls can be done in a guild, run \`${config.prefix}inline help\` for more details`,
|
||||||
|
inline: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: `\`${config.prefix}xdydzracsq!${config.postfix}\` ...`,
|
name: `\`${config.prefix}xdydzracsq!${config.postfix}\` ...`,
|
||||||
value:
|
value:
|
||||||
|
|
|
@ -5,7 +5,7 @@ import config from '~config';
|
||||||
import dbClient from 'db/client.ts';
|
import dbClient from 'db/client.ts';
|
||||||
import { inlineList, queries } from 'db/common.ts';
|
import { inlineList, queries } from 'db/common.ts';
|
||||||
|
|
||||||
import { failColor, infoColor1, successColor } from 'embeds/colors.ts';
|
import { failColor, infoColor1, infoColor2, successColor } from 'embeds/colors.ts';
|
||||||
|
|
||||||
import utils from 'utils/utils.ts';
|
import utils from 'utils/utils.ts';
|
||||||
|
|
||||||
|
@ -66,6 +66,7 @@ export const toggleInline = async (message: DiscordenoMessage, args: string[]) =
|
||||||
break;
|
break;
|
||||||
case 'block':
|
case 'block':
|
||||||
case 'disable':
|
case 'disable':
|
||||||
|
case 'delete':
|
||||||
await dbClient.execute('DELETE FROM allow_inline WHERE guildid = ?', [message.guildId]).catch((e) => {
|
await dbClient.execute('DELETE FROM allow_inline WHERE guildid = ?', [message.guildId]).catch((e) => {
|
||||||
utils.commonLoggers.dbError('toggleInline.ts:65', 'delete from allow_inline', e);
|
utils.commonLoggers.dbError('toggleInline.ts:65', 'delete from allow_inline', e);
|
||||||
errorOut = true;
|
errorOut = true;
|
||||||
|
@ -75,7 +76,6 @@ export const toggleInline = async (message: DiscordenoMessage, args: string[]) =
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'status':
|
case 'status':
|
||||||
default:
|
|
||||||
message.send({
|
message.send({
|
||||||
embeds: [
|
embeds: [
|
||||||
{
|
{
|
||||||
|
@ -86,6 +86,50 @@ export const toggleInline = async (message: DiscordenoMessage, args: string[]) =
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
case 'h':
|
||||||
|
case 'help':
|
||||||
|
default:
|
||||||
|
message
|
||||||
|
.send({
|
||||||
|
embeds: [
|
||||||
|
{
|
||||||
|
color: infoColor2,
|
||||||
|
title: `${config.name}'s Inline Roll Details:`,
|
||||||
|
description:
|
||||||
|
`${config.name} has an option to allow inline rolls in your guild. An inline roll is a roll that does not immediately start with \`${config.prefix}\`, such as \`test ${config.prefix}d20${config.postfix}\`.
|
||||||
|
|
||||||
|
By default, inline rolls are blocked from being sent in your guild. These commands may only be used by the Owner or Admins of your guild.`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
color: infoColor1,
|
||||||
|
title: 'Available Inline Commands:',
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: `\`${config.prefix}inline help\``,
|
||||||
|
value: 'This command',
|
||||||
|
inline: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: `\`${config.prefix}inline status\``,
|
||||||
|
value: 'Shows the current status of inline rolls for this guild',
|
||||||
|
inline: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: `\`${config.prefix}inline allow/enable\``,
|
||||||
|
value: 'Allows inline rolls in the guild',
|
||||||
|
inline: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: `\`${config.prefix}inline block/disable/delete\``,
|
||||||
|
value: 'Blocks inline rolls in the guild',
|
||||||
|
inline: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
})
|
||||||
|
.catch((e: Error) => utils.commonLoggers.messageSendError('apiHelp.ts:67', message, e));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if (errorOut) {
|
if (errorOut) {
|
||||||
message.send({
|
message.send({
|
||||||
|
|
Loading…
Reference in New Issue