npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@sheweny/resolve

v1.3.3

Published

This module groups together functions to retrieve data from different types of arguments

Readme

Discord-resolve

Sheweny plugin

This module groups together functions to retrieve data from different types of arguments. The functions group together all the possible cases each time (id, mention, name, start of name, name + tag). This module can also be used with slash-commands to give several options to a user.

Getting Started

Prerequisites

Node.js 16.6.0 or newer is required.

Instalation

With npm :

npm install @sheweny/resolve

With yarn :

yarn add @sheweny/resolve

Usage

Import the module from node_modules :

With CommonJS syntax :

const { DiscordResolve } = require("@sheweny/resolve");

With module syntax :

import { DiscordResolve } from "@sheweny/resolve";

Create a new instance of DiscordResolve with the client has a parameter.

const resolve = new DiscordResolve(client).

Methods


[async] resolveUser(arg)

Get a user and fetch discord if it is not in the cache.

Parameters :

  • arg : Id, mention, name, start of name, name + discriminator. (string)

Return : User or undefined

const user = await resolve.resolveUser("@Sheweny#1234");

resolveGuild(arg)

Get a guild in common with the bot.

Parameters :

  • arg : Name or id of guild. (string)
const guild = resolve.resolveGuild("Sheweny's server");

Return : Guild or undefined

[async] resolveMember(guild, arg)

Get a guild member and fetch discord if it is not in the cache.

Parameters :

  • guild : The guild where is the member (Guild)
  • arg : Id, mention, username, start of username. (string)

Return : GuildMember or undefined

const member = await resolve.resolveMember(guild, "@Sheweny#1234");

resolveChannel(guild, arg)

Get a guild channel from a guild.

Parameters :

  • guild : The guild where is the channel (Guild)
  • arg : Id, mention, name, start of name. (string)

Return : GuildChannel or undefined

const channel = resolve.resolveChannel(guild, "general");

resolveRole(guild, arg)

Get a guild role.

Parameters :

  • guild : The guild (Guild)
  • arg : Id, mention, name, start of name. (string)

Return : Role or undefined

const role = resolve.resolveRole(guild, "@everyone");

resolveGuildEmoji(guild, arg)

Get a emoji from a guild.

Parameters :

  • guild : The guild where is the emoji (Guild)
  • arg : Id, name, emoji (mention). (string)

Return : GuildEmoji or undefined

const emoji = resolve.resolveGuildEmoji(guild, ":smile:");

resolveModo(member)

Check if user have a moderator permissions (ADMINISTRATOR, MANAGE_GUILD or BAN_MEMBERS).

Parameters :

  • member : GuildMember

Return : Boolean

const isModo = resolve.resolveModo(member);

Example

const { DiscordResolve } = require("@sheweny/resolve");
const { Client, Intents } = require("discord.js");

const client = new Client({
  intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES],
});
const util = new DiscordResolve(client);
client.on("messageCreate", async (msg) => {
  const args = msg.content.split(" ");
  const user = await util.resolveUser(args[0]); // args[0] accept id, mention, name, start of name and username + discriminator.
  const guild = util.resolveGuild(args[1]); // args[1] accept id, and name.
  const member = await util.resolveMember(msg.guild, args[2]); // args[2] accept id, mention, username, start of username.
  const channel = util.resolveChannel(msg.guild, args[3]); // args[3] accept id, mention and name.
  const role = util.resolveRole(msg.guild, args[4]); // args[4] accept id, mention, name and start of name.
  const emoji = util.resolveGuildEmoji(msg.guild, args[5]); // args[5] accept id, name and emoji.
});
client.login("token");