Releases: shysolocup/willclient
Releases · shysolocup/willclient
1.0.2
1.0.1
WillClient v1.0.1
Added TypeScript support to building and compiling
1.0.0
WillClient 1.0.0
Slash Command Update
- Added slash commands with wc.slashCommand()
- Added slash command events
- Added plugins
- Updated command handling
- Updated event action functions to have the option to specify the button's id
- Added custom Function and Property classes
- Added cooldown events
- Rewrote documentation
- Reorganized and updated custom event list
- Reorganized and updated permissions list
- Added setToken()
- Added wc.ctx
- Added fileType parameter for parseEmoji()
- Token is required in the creation of new instances now for registering slash commands
const { Client } = require('discord.js');
const client = new Client({ /* your stuff here */ });
const { WillClient } = require('willclient');
const config = require('./config.json');
const wc = new WillClient({ client: client, prefix: "!", token: config.token });
wc.event("ready", (ctx) => {
console.log(`Logged in as ${ctx.user.tag}`);
});
/* commands */
wc.slashCommand({ name: "ping", desc: "Replies with pong!", cooldown: "5s" }, async (ctx, cmd) => {
if (cmd.onCooldown) return;
ctx.reply("Pong!");
});
wc.slashCommand("button", "Sends a button to press", async (ctx, cmd) => {
let button = new wc.Button({ id: "TestButton", label: "Press me!", style: "primary" });
let row = new wc.ActionRow([ button ]);
ctx.reply({ components: [row] });
});
/* events */
wc.buttonAction("TestButton", (ctx) => {
ctx.reply("You pressed me!");
});
wc.event("onCooldown", (ctx, cmd) => {
ctx.reply("Command on cooldown!");
});
client.login(config.token);
0.6.0 Test
this is a test to see if I can write to the psc depricated package, also enjoy having some early features that have been there for a bit
0.5.2
Accidently deleted 0.5.1 on here lol but anyway mostly just an update to some minor stuff like the readme file I'm also gonna change the logo color later so that it shows up better
0.5.0
Discord+PS v0.5.0
WORKING ON NPM SUPPORT
NPM support is being worked on currently though it may take a bit
Channels
- CHANNEL PERMISSIONS SETTING, EDITING, AND DELETING WILL BE FIXED TO WORK WITH THE PERMISSION SYSTEM LATER
- Added PSClient.channel.permissions.sync(channel) (channel is optional and defaults to ctx.channel)
Users/Members
- Added PSClient.user.roles
Class
let cache = PSClient.user.roles.cache(user) // user is optional and defaults to ctx.member returns an array of roles
let list = PSClient.user.roles.list(user) // returns an array of role names
let ids = PSClient.user.roles.ids(user) // returns an array of role ids
let has = PSClient.user.roles.has(role id, user) // checks if a user has a role by id returns an boolean
let hasName = PSClient.user.roles.hasName(role name, user) // checks if a user has a role by name returns a boolean
/* Aliases
- PSClient.user.roleCache()
- PSClient.user.roleList()
- PSClient.user.roleIds()
- PSClient.user.hasRole()
- PSClient.user.hasRoleName()
*/
- Added PSClient.user.permissions
Class
let cache = PSClient.user.permissions.cache(user) // user is optional and defaults to ctx.member returns an object of permissions with true or false
let list = PSClient.user.permissions.list(user) // returns an array of permissions a user has
let has = PSClient.user.permissions.has(permissions, user) // permissions is an array checks if a user has permissions
/* Aliases
- PSClient.user.permissionCache()
- PSClient.user.permissionList()
- PSClient.user.hasPermissions()
*/
Guilds
- Caches and original (or F) for guild things are separated now
- Caches only update when the bot is started bc discord.js works that way
- Original uses a function but can't be used outside of the function bc discord.js
- Caches have an optional guild argument while original does not
- The only one without a cache is members bc discord.js
// caches
let roles = PSClient.guild.roles(guild);
let stuff = PSClient.guild.stuff(guild); // all channels (categories threads and text/voice channels)
let channels = PSClient.guild.channels(guild); // threads and text/voice channels
let categores = PSClient.guild.categories(guild);
let textChannels = PSClient.guild.textChannels(guild); // alias PSClient.guild.TCs()
let voiceChannels = PSClient.guild.voiceChannels(guild); // alias PSClient.guild.VCs()
let threadChannels = PSClient.guild.threadChannels(guild); // alias PSClient.guild.threads()
let emojis = PSClient.guild.emojis(guild);
let stickers = PSClient.guild.stickers(guild);
// originals
PSClient.guild.members( (members) => {
members.forEach( (member) => {
// do stuff
});
});
PSClient.guild.roleF( (roles) => {
roles.forEach( (role) => {
// do stuff
});
});
PSClient.guild.channelF( (channels) => {
channels.forEach( (channel) => {
// do stuff
});
});
PSClient.guild.emojiF( (emojis) => {
emojis.forEach( (emoji) => {
// do stuff
});
});
PSClient.guild.stickerF( (stickers) => {
stickers.forEach( (sticker) => {
// do stuff
});
});
Miscellaneous
- Added PSClient.send() as an alternative to PSClient.channel.send()
- Added a time system ("1s", "1m", "1h", etc) that can be used for things like command cooldown and for deleteAfter in messages
- Updated eventList to fix a few things
- Embed, Button, Select Menus, and Action Rows are now classes instead of just functions so now you have to use new for added coolness:
// before
let embed = PSClient.Embed({/* stuff */});
let button = PSClient.Button({/* stuff */});
let selection = PSClient.Selection({/* stuff */});
let row = PSClient.ActionRow([/* stuff */]);
// now
let embed = new PSClient.Embed({/* stuff */});
let button = new PSClient.Button({/* stuff */});
let selection = new PSClient.Selection({/* stuff */});
let row = new PSClient.ActionRow([/* stuff */]);
- Added an optional guild for fetchGuild things
let user = await PSClient.fetchGuildUser(user, guild);
let channel = await PSClient.fetchGuildChannel(channel, guild);
let role = await PSClient.fetchGuildRole(role, guild);
- Added a time.parse() function used for turning time strings into numbers
types:
- s: second
- m: minute
- h: hour
- d: day
- w: week
- y: year
PSClient.time.parse("1m"); // 60