Skip to content

Commit

Permalink
feat: findGuild(resolve)
Browse files Browse the repository at this point in the history
  • Loading branch information
Faf4a committed Oct 26, 2023
1 parent b55a541 commit cb45d61
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/functions/guild/findGuild.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = async d => {
const data = d.util.aoiFunc(d);
if (data.err) return d.error(data.err);

const [resolve] = data.inside.splits;

const guild = d.client.guilds.cache.get(resolve) || d.client.guilds.cache.find(g => g.name.toLowerCase() === resolve.toLowerCase());

data.result = guild ? guild.id : undefined;

return {
code: d.util.setCode(data)
}
}

0 comments on commit cb45d61

Please sign in to comment.