Giter VIP home page Giter VIP logo

movie-night-discord-bot's Introduction

Movie Night Bot for Discord

This is a Discord Bot written in Node.JS using Discord.JS library to interface with the Discord API.

MongoDB connection is required to store and retrieve settings as well as film details. The schema is available within bot.js

The Movie DB API is used to gather any relevant data to movies throughout the application.

Setup

Create a config.json file in the root directory

{
  "prefix": "set to whichever prefix you wish the bot to use.",
  "token": "set to your discord bot API token",
  "movieDbAPI": "set to your API token from developers.themoviedb.org (Required to get movie data when requested by user)",
  "mongoLogin": "set to your connection string for any MongoDB collection (Check Mongoose for more information)"
}

I would recommend removing dblapi.js and references to topggAPI/testing from bot.js as this is simply to post statistics to a third party website.

Run index.js which will spawn a sharding manager, which runs bot.js to instantiate all commands and handle responses.

Commands

List of commands available at https://movienightbot.xyz/commands/

Approach

General development approach was followed from Discord.js documentation to ensure best practices were implemented in terms of bots. Many settings had to be adjusted to ensure my EC2 servers memory usage wouldn't climb indefinitely with default options.

index.js will simply be spawning a sharding manager, which points to bot.js as the primary file to spawn. This is a required implementation by Discord after a bot has exceeded 2,500 servers.

Command script files are separated into a Command folder, these are then loaded in by Bot.js and handles events/command execution. The default prefix is --

Bot.js will check every message for any alias/command text and if it is present it will continue with checks and execution.

On leaving/kicked from a server, we delete settings and movies from that server

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.