V1.3.3 HOTFIX

Patch to more strictly type mod.ts
This commit is contained in:
Ean Milligan (Bastion) 2021-01-27 03:34:49 -05:00
parent 2f6b76cdf7
commit 5a50f2a19f
4 changed files with 14 additions and 3 deletions

View File

@ -1,5 +1,5 @@
# The Artificer - A Dice Rolling Discord Bot
Version 1.3.2 - 2020/01/27
Version 1.3.3 - 2020/01/27
The Artificer is a Discord bot that specializes in rolling dice. The bot utilizes the compact [Roll20 formatting](https://roll20.zendesk.com/hc/en-us/articles/360037773133-Dice-Reference) for ease of use and will correctly perform any needed math on the roll (limited to basic algebra).

View File

@ -1,6 +1,6 @@
export const config = {
"name": "The Artificer", // Name of the bot
"version": "1.3.2", // Version of the bot
"version": "1.3.3", // Version of the bot
"token": "the_bot_token", // Discord API Token for this bot
"prefix": "[[", // Prefix for all commands
"postfix": "]]", // Postfix for rolling command

4
mod.ts
View File

@ -27,6 +27,8 @@ import { nanoid } from "https://deno.land/x/nanoid@v3.0.0/mod.ts";
import utils from "./src/utils.ts";
import solver from "./src/solver.ts";
import { EmojiConf } from "./src/mod.d.ts";
import config from "./config.ts";
const dbClient = await new Client().connect({
@ -348,7 +350,7 @@ startBot({
// Check if the unhandled command is an emoji request
else {
// Start looping thru the possible emojis
config.emojis.some(e => {
config.emojis.some((e: EmojiConf) => {
// If a match gets found
if (e.aliases.indexOf(command || "") > -1) {
// Send the needed emoji

9
src/mod.d.ts vendored Normal file
View File

@ -0,0 +1,9 @@
// mod.d.ts custom types
export type EmojiConf = {
"name": string,
"aliases": Array<string>,
"id": string,
"animated": boolean,
"deleteSender": boolean
};