Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

discord-mudlet-map

Delwing55MIT0.3.0

This little library helps with Discord bot configuration to provide small Mudlet map fragment images with given location.

mudlet, map, mud, discord

readme

Discord Mudlet Map

This little library helps with Discord bot configuration to provide small Mudlet map fragment images with given location.

Example

const BOT_TOKEN = "your_token"

const Discord = require("discord.js");
const client = new Discord.Client({ intents: [Discord.Intents.FLAGS.GUILD_MESSAGES, Discord.Intents.FLAGS.GUILDS, Discord.Intents.FLAGS.MESSAGE_CONTENT] });

const { configure, MapProviders, LocationResolvers } = require("discord-mudlet-map")

let config = {
  Achaea: { 
    locationExtractor: LocationResolvers.plainRegexp("!achaea (\\d+)"),
    provider: MapProviders.retryingDownloader("https://raw.githubusercontent.com/IRE-Mudlet-Mapping/AchaeaCrowdmap/gh-pages/Map/map", { retries: 5, delay : 10000 }) },
    messageCreator: (key, area, room) => `${key} - ${area.areaName} (${room.id})`,
    renderArea: false, // if missing or false will render part of map around location (recommended), otherwise will render whole area with locaiton marked
    settings: {
      isRound: true
    } // Reffer to: https://github.com/Delwing/js-mudlet-map-renderer#settings-and-their-default-values
};

configure(client, config);

client.login(BOT_TOKEN);

changelog

0.3.0

  • drop renderFragmentOption
  • add renderArea option

0.2.0

  • add message creator configuration

0.1.2

  • fix hash search

0.1.1

  • fix dependency

0.1.0

  • add location search functions
  • fix no room handling

0.0.7

  • fix map downloader - should prevent attempts to read map before stream finishes writes, thus failing to read map
  • move configuration loop into bot-configurator.js

0.0.6

  • remove debug messages

0.0.5

  • Use limitting function for generating area image

0.0.4

  • Update dependencies

0.0.3

  • Add way of customizing map rendering settings

0.0.2

  • Fix README example

0.0.1

  • Initial release