Skip to content

Instantly share code, notes, and snippets.

@typeoneerror
Forked from weotch/main.js
Last active January 22, 2021 16:13
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save typeoneerror/5878516 to your computer and use it in GitHub Desktop.
Save typeoneerror/5878516 to your computer and use it in GitHub Desktop.
// 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']);
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;
});
@Korenthin
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment