Add files via upload
This commit is contained in:
parent
36e49b4a32
commit
bdb4e9d949
8
commands/example.js
Normal file
8
commands/example.js
Normal file
@ -0,0 +1,8 @@
|
||||
exports.run = (client, message, args) => {
|
||||
console.log("Works!")
|
||||
}
|
||||
|
||||
exports.info = {
|
||||
name: "example",
|
||||
enabled: true
|
||||
}
|
4
config.json
Normal file
4
config.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"token": "",
|
||||
"prefix": "!"
|
||||
}
|
38
index.js
Normal file
38
index.js
Normal file
@ -0,0 +1,38 @@
|
||||
const Eris = require('eris')
|
||||
const config = require('./config.json')
|
||||
const client = new Eris(config.token, {maxShards: "auto", getAllUsers:true, intents:["guildPresences", "guildMembers", "guilds", "guildMessages"]})
|
||||
const fs = require('fs')
|
||||
|
||||
// Command Handler
|
||||
client.commands = new Eris.Collection()
|
||||
fs.readdir('./commands/', (err, files) => {
|
||||
if (err) console.error(err)
|
||||
files.forEach(file => {
|
||||
let f = require(`./commands/${file}`)
|
||||
client.commands.set(f.info.name, f)
|
||||
})
|
||||
})
|
||||
|
||||
let prefix = config.prefix
|
||||
|
||||
client.on('messageCreate', async message => {
|
||||
if (message.author.bot || !message.channel.guild || !message.content.startsWith(prefix)) return
|
||||
|
||||
let args = message.content.slice(prefix.length).trim().split(/ +/g)
|
||||
let command = args.shift().toLowerCase()
|
||||
let cmd;
|
||||
if (client.commands.has(command)) cmd = client.commands.get(command)
|
||||
if (cmd) cmd.run(client, message, args)
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
// Ready Event
|
||||
client.on('ready', () => {
|
||||
console.log('Bot is ready!')
|
||||
})
|
||||
|
||||
|
||||
|
||||
client.connect()
|
93
package-lock.json
generated
Normal file
93
package-lock.json
generated
Normal file
@ -0,0 +1,93 @@
|
||||
{
|
||||
"name": "eris-template",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "eris-template",
|
||||
"version": "1.0.0",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"eris": "^0.17.2"
|
||||
}
|
||||
},
|
||||
"node_modules/eris": {
|
||||
"version": "0.17.2",
|
||||
"resolved": "https://registry.npmjs.org/eris/-/eris-0.17.2.tgz",
|
||||
"integrity": "sha512-OzffDSL81VooFXfRn56ienSg7J6fagoN8WdkmCHjn0B9a4jUA3bVouMztQiaXT54jHV5jaX9D0mJ/b9/0mFoVg==",
|
||||
"dependencies": {
|
||||
"ws": "^8.2.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.4.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"opusscript": "^0.0.8",
|
||||
"tweetnacl": "^1.0.3"
|
||||
}
|
||||
},
|
||||
"node_modules/opusscript": {
|
||||
"version": "0.0.8",
|
||||
"resolved": "https://registry.npmjs.org/opusscript/-/opusscript-0.0.8.tgz",
|
||||
"integrity": "sha512-VSTi1aWFuCkRCVq+tx/BQ5q9fMnQ9pVZ3JU4UHKqTkf0ED3fKEPdr+gKAAl3IA2hj9rrP6iyq3hlcJq3HELtNQ==",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/tweetnacl": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz",
|
||||
"integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/ws": {
|
||||
"version": "8.14.2",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz",
|
||||
"integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==",
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"bufferutil": "^4.0.1",
|
||||
"utf-8-validate": ">=5.0.2"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"bufferutil": {
|
||||
"optional": true
|
||||
},
|
||||
"utf-8-validate": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"eris": {
|
||||
"version": "0.17.2",
|
||||
"resolved": "https://registry.npmjs.org/eris/-/eris-0.17.2.tgz",
|
||||
"integrity": "sha512-OzffDSL81VooFXfRn56ienSg7J6fagoN8WdkmCHjn0B9a4jUA3bVouMztQiaXT54jHV5jaX9D0mJ/b9/0mFoVg==",
|
||||
"requires": {
|
||||
"opusscript": "^0.0.8",
|
||||
"tweetnacl": "^1.0.3",
|
||||
"ws": "^8.2.3"
|
||||
}
|
||||
},
|
||||
"opusscript": {
|
||||
"version": "0.0.8",
|
||||
"resolved": "https://registry.npmjs.org/opusscript/-/opusscript-0.0.8.tgz",
|
||||
"integrity": "sha512-VSTi1aWFuCkRCVq+tx/BQ5q9fMnQ9pVZ3JU4UHKqTkf0ED3fKEPdr+gKAAl3IA2hj9rrP6iyq3hlcJq3HELtNQ==",
|
||||
"optional": true
|
||||
},
|
||||
"tweetnacl": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz",
|
||||
"integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==",
|
||||
"optional": true
|
||||
},
|
||||
"ws": {
|
||||
"version": "8.14.2",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz",
|
||||
"integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==",
|
||||
"requires": {}
|
||||
}
|
||||
}
|
||||
}
|
15
package.json
Normal file
15
package.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "eris-template",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"eris": "^0.17.2"
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user