You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
A TypeScript NodeJS API Wrapper for Guilded.gg API.
Currently unstable and in active dev. Use with caution.
The name is gapi but silly google took that name so on npm we use gupi
Design Goals
Amazing Scalability!
Great developer experience!
Extremely flexible/dynamic!
Features
Initial Connection
Handle closes/Reconnection
Advanced RAM control!
Add custom props
Remove undesired props to save RAM
Limit the max amount of items in a collection.
Basic Cache control
Clean and powerful events system
Event listeners that are ran when an event occurs.
Useful events available to help debug!
Clean and powerful tasks system.
Runs a function at a certain interval. Useful for things like unmute and updating bot lists etc.
Can be used for cache sweeping to keep your cache optimized for exactly what you want.
Clean and powerful monitors system.
Runs a function on every message sent. Useful for stuff like auto-moderation or tags.
Easily ignore bots, users, edits, dms.
Powerful permission checks.
Clean and powerful inhibitors system
Stops a command from running if a requirement fails.
Easily add custom inhibitors!
Clean and powerful commands system
Powerful argument handling including validating, parsing and modifications.
Easily create custom arguments for your specific needs.
Command aliases.
Cooldowns and allowed uses before cooldown triggers.
Argument prompting!
Author and bot permission checks in server AND in channel!
Clean and powerful languages system.
Built in multi-lingual support.
Uses i18next, one of the best localization tools available.
Supports nested folders to keep cleaner translation files
GH Actions
Linter
Prettier
TSC
Event Handlers
100% API coverage
Custom(Redis) cache support
Step by step guide
GH Actions: Deploy on release
Readme image/logo??
Proxy WS support (Pending until sharding is implemented in Guilded)
Proxy REST support (Pending until Rate Limits are better implemented in Guilded)
Usage
Beginner/Basic
import{Client}from'gupi';newClient({email:'emailhere',password:'passwordhere'}).on('ready',()=>console.log('Successfully connected to gateway')).on('messageCreate',message=>{if(message.content==='!ping'){message.send(`Ping MS:${Date.now()-message.timestamp}ms`);}}).on('unknown',console.log).connect();
BotClient (Full Command Framework)
// index.tsimport{BotClient}from'gupi';importconfigsfrom'./configs';// Start it up!constclient=newBotClient(configs).on('ready',()=>console.log('Successfully connected to gateway')).connect();// src/commands/avatar.tsimport{Command,CommandArgument,Message,User,Embed}from'gupi';exportdefaultclassextendsCommand{name='avatar';aliases=['pfp'];description='🖼️ View the avatar image for a user or the server.';arguments=[{name:'server',type:'string',literals:['server'],required:false},{name:'user',type:'user',required:false},]asCommandArgument[];asyncexecute(message:Message,args:{user?:User;server?:'server'}){// BY DEFAULT WE USE THE USERS OWN URLleturl=message.author.dynamicAvatarURL({type:'Large'});// IF THE USER WANTED THE SERVER AVATAR USE ITif(args.server&&message.team)url=message.team.dynamicAvatarURL({type:'Large'});// IF A USER WAS REQUESTED, THEN WE USE THATif(args.user)url=args.user.dynamicAvatarURL({type:'Large'});returnmessage.send(newEmbed().setAuthor(message.author).setDescription(`[${message.translate('commands/avatar:DOWNLOAD_LINK')}](${url})`).setImage(url),);}}
Advanced Customizations
Everything below this is to showcase examples of advanced features! They are intentionally written in a way that is confusing to a beginner developer, as it is not meant for you. This is an extreme edge case scenario for bots that scale really big!
// Cache Control!// Set to 0 to disable caching. Apply to any desired Collection.client.users.maxSize=1000;client.connect();
About
A TypeScript NodeJS API Wrapper for Guilded.gg API