{"id":14983473,"url":"https://github.com/sheweny/discord-resolve","last_synced_at":"2025-10-29T22:30:41.298Z","repository":{"id":37104711,"uuid":"377802545","full_name":"Sheweny/discord-resolve","owner":"Sheweny","description":"This module groups together functions to retrieve data from different types of arguments. ","archived":false,"fork":false,"pushed_at":"2023-07-31T21:04:41.000Z","size":191,"stargazers_count":2,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-09-24T12:02:41.591Z","etag":null,"topics":["data","discord","discord-js","mentions","resolver","sheweny","utility"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sheweny.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-17T11:11:20.000Z","updated_at":"2022-06-19T04:19:33.000Z","dependencies_parsed_at":"2024-06-21T14:18:53.004Z","dependency_job_id":null,"html_url":"https://github.com/Sheweny/discord-resolve","commit_stats":{"total_commits":96,"total_committers":3,"mean_commits":32.0,"dds":"0.39583333333333337","last_synced_commit":"20c6a4e76e3c59b2cbc124e1d48ce40dd252a013"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sheweny%2Fdiscord-resolve","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sheweny%2Fdiscord-resolve/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sheweny%2Fdiscord-resolve/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sheweny%2Fdiscord-resolve/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sheweny","download_url":"https://codeload.github.com/Sheweny/discord-resolve/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219867875,"owners_count":16554375,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data","discord","discord-js","mentions","resolver","sheweny","utility"],"created_at":"2024-09-24T14:07:15.623Z","updated_at":"2025-10-29T22:30:40.969Z","avatar_url":"https://github.com/Sheweny.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Discord-resolve\n\nSheweny plugin\n\nThis 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.\n\n## Getting Started\n\nPrerequisites\n\nNode.js 16.6.0 or newer is required.\n\n### Instalation\n\nWith npm :\n\n```sh-session\nnpm install @sheweny/resolve\n```\n\nWith yarn :\n\n```sh-session\nyarn add @sheweny/resolve\n```\n\n## Usage\n\nImport the module from node_modules :\n\nWith CommonJS syntax :\n\n```js\nconst { DiscordResolve } = require(\"@sheweny/resolve\");\n```\n\nWith module syntax :\n\n```js\nimport { DiscordResolve } from \"@sheweny/resolve\";\n```\n\nCreate a new instance of DiscordResolve with the client has a parameter.\n\n```js\nconst resolve = new DiscordResolve(client).\n```\n\n## Methods\n\n---\n\n## [async] resolveUser(arg)\n\nGet a user and fetch discord if it is not in the cache.\n\nParameters :\n\n- arg : Id, mention, name, start of name, name + discriminator. (string)\n\nReturn : User or undefined\n\n```js\nconst user = await resolve.resolveUser(\"@Sheweny#1234\");\n```\n\n## resolveGuild(arg)\n\nGet a guild in common with the bot.\n\nParameters :\n\n- arg : Name or id of guild. (string)\n\n```js\nconst guild = resolve.resolveGuild(\"Sheweny's server\");\n```\n\nReturn : Guild or undefined\n\n## [async] resolveMember(guild, arg)\n\nGet a guild member and fetch discord if it is not in the cache.\n\nParameters :\n\n- guild : The guild where is the member (Guild)\n- arg : Id, mention, username, start of username. (string)\n\nReturn : GuildMember or undefined\n\n```js\nconst member = await resolve.resolveMember(guild, \"@Sheweny#1234\");\n```\n\n## resolveChannel(guild, arg)\n\nGet a guild channel from a guild.\n\nParameters :\n\n- guild : The guild where is the channel (Guild)\n- arg : Id, mention, name, start of name. (string)\n\nReturn : GuildChannel or undefined\n\n```js\nconst channel = resolve.resolveChannel(guild, \"general\");\n```\n\n## resolveRole(guild, arg)\n\nGet a guild role.\n\nParameters :\n\n- guild : The guild (Guild)\n- arg : Id, mention, name, start of name. (string)\n\nReturn : Role or undefined\n\n```js\nconst role = resolve.resolveRole(guild, \"@everyone\");\n```\n\n## resolveGuildEmoji(guild, arg)\n\nGet a emoji from a guild.\n\nParameters :\n\n- guild : The guild where is the emoji (Guild)\n- arg : Id, name, emoji (mention). (string)\n\nReturn : GuildEmoji or undefined\n\n```js\nconst emoji = resolve.resolveGuildEmoji(guild, \":smile:\");\n```\n\n## resolveModo(member)\n\nCheck if user have a moderator permissions (ADMINISTRATOR, MANAGE_GUILD or BAN_MEMBERS).\n\nParameters :\n\n- member : GuildMember\n\nReturn : Boolean\n\n```js\nconst isModo = resolve.resolveModo(member);\n```\n\n## Example\n\n```js\nconst { DiscordResolve } = require(\"@sheweny/resolve\");\nconst { Client, Intents } = require(\"discord.js\");\n\nconst client = new Client({\n  intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES],\n});\nconst util = new DiscordResolve(client);\nclient.on(\"messageCreate\", async (msg) =\u003e {\n  const args = msg.content.split(\" \");\n  const user = await util.resolveUser(args[0]); // args[0] accept id, mention, name, start of name and username + discriminator.\n  const guild = util.resolveGuild(args[1]); // args[1] accept id, and name.\n  const member = await util.resolveMember(msg.guild, args[2]); // args[2] accept id, mention, username, start of username.\n  const channel = util.resolveChannel(msg.guild, args[3]); // args[3] accept id, mention and name.\n  const role = util.resolveRole(msg.guild, args[4]); // args[4] accept id, mention, name and start of name.\n  const emoji = util.resolveGuildEmoji(msg.guild, args[5]); // args[5] accept id, name and emoji.\n});\nclient.login(\"token\");\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsheweny%2Fdiscord-resolve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsheweny%2Fdiscord-resolve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsheweny%2Fdiscord-resolve/lists"}