Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cesiumlabs/discord.js-snowflake
Simple discord.js framework
https://github.com/cesiumlabs/discord.js-snowflake
bot discordjs framework javascript
Last synced: about 2 months ago
JSON representation
Simple discord.js framework
- Host: GitHub
- URL: https://github.com/cesiumlabs/discord.js-snowflake
- Owner: CesiumLabs
- License: gpl-3.0
- Archived: true
- Created: 2020-11-14T11:44:42.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-16T13:16:21.000Z (almost 4 years ago)
- Last Synced: 2024-09-30T15:29:50.854Z (about 2 months ago)
- Topics: bot, discordjs, framework, javascript
- Language: JavaScript
- Homepage: https://npmjs.com/package/discord.js-snowflake
- Size: 23.4 KB
- Stars: 9
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Discord.js Snowflake
Simple **[discord.js](https://npmjs.com/package/discord.js)** framework.> Note: This package is under development. Do not use it in production!
# Installing
```sh
$ npm install discord.js-snowflake
```# Example
## index.js
```js
const Discord = require("discord.js-snowflake");
const client = new Discord.Client({
defaultPrefix: "!",
ignoreBots: true,
commandsDir: __dirname + "/commands",
eventsDir: __dirname + "/events",
handleCommands: true, // set this to false if you want to handle it manually. If true, it runs command handler in every msg
loadDefaultCommands: true,
owner: "YOUR_DISCORD_ID",
logErrors: true,
commandErrorMessage: "❌ | Something went wrong while running command **{{command}}**\n```xl\n{{error}}\n```",
commandNotFound: "❌ | Command **{{command}}** not found!"
});
```## events/ready.js
```js
class Ready {constructor(client) {
this.client = client;
}execute() {
console.log("Bot is online!");
}}
module.exports = Ready;
```## commands/avatar.js
```js
const { Command, MessageEmbed } = require("discord.js-snowflake");class Avatar extends Command {
constructor(client) {
super(client, {
name: "avatar",
aliases: ["av"],
description: "Shows avatar of the user"
});
}async execute(message, args) {
const user = message.mentions.users.first() || message.author;
const avatar = user.displayAvatarURL({ dynamic: true, size: 2048 });const embed = new MessageEmbed()
.setTitle(`Avatar of ${user.tag}`)
.setColor("RANDOM")
.setImage(avatar);return message.channel.send(embed);
}}
module.exports = Avatar;
```# Default Commands Available
- ping
- eval# Links
### **[Discord Server](https://discord.gg/2SUybzb)**## © 2020 - **[Snowflake Studio ❄](https://snowflakedev.xyz)**