Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@spectacles/cache
Advanced tools
Cache Discord objects in a cool way. Currently only supports Redis.
const { Client } = require('@spectacles/cache');
const Redis = require('ioredis');
const redis = new Redis();
const cache = new Client(redis); // client accepts an ioredis instance
(async () => {
const role = await cache.guilds['some id'].roles.get('some other id');
await cache.actions.guilds.upsert({ id: 'meme' }); // etc.
})();
The internal data structures closely follows the format of data as returned from Discord. Every structure with an ID that is returned as an array will be converted to an object keyed by ID.
guilds
members
roles
presence
roles
emojis
voice_states
- keyed by user IDchannels
channels
overwrites
users
const memberRoles = await cache.guilds['some id'].members['some id'].roles.get();
// memberRoles is an object { [roleID]: ...roleInfo }
All actions have 3 methods: set
, upsert
, and delete
which behave as named. They are exposed on Client#actions
.
guilds
channels
users
roles
members
emojis
voiceStates
cache.actions.guilds.upsert(guild);
FAQs
Caching for Discord data.
The npm package @spectacles/cache receives a total of 11 weekly downloads. As such, @spectacles/cache popularity was classified as not popular.
We found that @spectacles/cache demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.