-
-
Save typeoneerror/5878516 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This our standard require js bootstrap file. It assumes you are using the | |
// require-jquery.js file that require.js provides | |
// Set the require.js configuration for the application | |
require.config({ | |
// Base path used to load scripts | |
baseUrl: 'js/', | |
// Prevent caching during dev | |
urlArgs: "bust=" + (new Date()).getTime(), | |
// Exclude these modules on build | |
stubModules: ['text'], | |
// Set common library paths | |
paths: { | |
jquery: 'empty:', // jquery is already loaded | |
underscore: 'libs/underscore', | |
backbone: 'libs/backbone' | |
} | |
}); | |
// Define the application entry point | |
define('main', function (require) { | |
// Dependencies | |
var $ = require('jquery'), | |
router = require('router'); // This is the router.js file. Note, it gets invoked before DOM is loaded | |
// Auto go to a project detail page. Trigger = true will tell it to run the callback | |
// function from the router definition. | |
router.navigate("project/some-slug", {trigger:true}) | |
}); | |
// Start the application | |
require(['main']); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(function(require) { | |
// Dependencies | |
var $ = require('jquery'), | |
Backbone = require('backbone'); | |
// Create router. We're assuming you aren't doing anything nuts, thus a single router | |
// for the whole site is suffient | |
var AppRouter = Backbone.Router.extend({ | |
// Define routes | |
routes: { | |
"": "home", | |
"projects": "projects", | |
"project/:slug": "project", | |
}, | |
// Handle those routes. These callbacks get called when navigate is called with | |
// trigger = true | |
project: function(slug) { }, | |
projects: function() {}, | |
home: function() {} // The home page | |
}); | |
// Listen for history changes | |
Backbone.history.start({ | |
pushState: true, | |
silent: true // This assumes that the server is handling the initial route and rendering your deep link | |
}); | |
// Return the router for triggering links | |
return new AppRouter; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
const Discord = require('discord.js'); const client = new Discord.Client(); //Toutes les actions à faire quand le bot se connecte client.on("ready", function () { console.log("Mon BOT est Connecté"); }) client.login("TOKEN DE VOTRE BOT");
Et voilà, vous pouvez maintenant commencer