mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 20:13:30 +01:00
Updated Web Distrib management
This commit is contained in:
@@ -3,7 +3,7 @@ module.exports = function (grunt) {
|
|||||||
require('load-grunt-tasks')(grunt);
|
require('load-grunt-tasks')(grunt);
|
||||||
|
|
||||||
grunt.initConfig({
|
grunt.initConfig({
|
||||||
|
pkg: grunt.file.readJSON("package.json"),
|
||||||
// define source files and their destinations
|
// define source files and their destinations
|
||||||
babel: {
|
babel: {
|
||||||
dist: {
|
dist: {
|
||||||
@@ -19,7 +19,7 @@ module.exports = function (grunt) {
|
|||||||
browserify: {
|
browserify: {
|
||||||
dist: {
|
dist: {
|
||||||
files: {
|
files: {
|
||||||
'web-dist/discord.js': ["lib/index.js"],
|
'web-dist/discord.<%= pkg.version %>.js': ["lib/index.js"],
|
||||||
},
|
},
|
||||||
options: {
|
options: {
|
||||||
browserifyOptions: {
|
browserifyOptions: {
|
||||||
@@ -31,7 +31,7 @@ module.exports = function (grunt) {
|
|||||||
uglify: {
|
uglify: {
|
||||||
min: {
|
min: {
|
||||||
files: {
|
files: {
|
||||||
"./web-dist/discord.min.js": "./web-dist/discord.js"
|
"./web-dist/discord.min.<%= pkg.version %>.js": "./web-dist/discord.js"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,18 +16,12 @@ mybot.on("message", function (message) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var action1 = mybot.sendMessage(message.channel, "this is message " + 1, true);
|
// we can go ahead :)
|
||||||
var action2 = mybot.sendMessage(message.channel, "this is message " + 2).then(log);
|
console.log(message.sender.username);
|
||||||
|
mybot.sendMessage(message.channel, message.sender.username);
|
||||||
function log() {
|
|
||||||
mybot.updateMessage(action1.message, "blurg");
|
|
||||||
mybot.sendMessage(message.channel, "This is message 3 million minus the million so basically just 3");
|
|
||||||
mybot.deleteMessage(action1.message);
|
|
||||||
mybot.sendMessage(message.channel, "This is message RJNGEIKGNER").then(log2);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
mybot.on("ready", function(){
|
mybot.on("ready", function () {
|
||||||
console.log("im ready");
|
console.log("im ready");
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
10
web-dist/README.md
Normal file
10
web-dist/README.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
## Web Distributions
|
||||||
|
|
||||||
|
Here you can find the latest web-ready distributions of discord.js. These distributions will allow you to run discord.js
|
||||||
|
in your browser, which is very useful for making on-the-go bots or clients. For some reason, request times are also much
|
||||||
|
shorter in browsers, so your bots will reply much faster.
|
||||||
|
|
||||||
|
Web Distributions aren't always fully functional, and sometimes catching errors is a pain. As discord.js's support for
|
||||||
|
browserifying is still maturing, please don't expect that it will work out of the box just yet.
|
||||||
|
|
||||||
|
Also, if the versions in this folder are out-dated, you can always run `grunt web` to generate the latest library.
|
||||||
File diff suppressed because it is too large
Load Diff
2
web-dist/discord.min.js
vendored
2
web-dist/discord.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user