Skip to content

Discord bot that plays sounds or music when somebody joins or leaves a voice channel.

License

Notifications You must be signed in to change notification settings

EnhancedMind/WelcomerBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcomer Bot

A complete code to download for a Welcomer Bot
-> Bot that plays sound when somebody joins or leaves a voice channel :)
-> type *help in chat to learn more when you set up the bot

Configuration

Copy the config.json.example in the config folder and rename it to config.json

{
    "terminateOnUncaughtException": true,
    "bot": {
        "token": "put your bot token here",
        "prefix": "*",
        "ignoreMessageEndingWithPrefix": false,
        "ownerID": "put your discord id here"
    },
    "status": {
        "status": "online",
        "game": "made by EnhancedMind ❤️"
    },
    "emoji": {
        "success": ":notes:",
        "info": ":bulb:",
        "warning": ":warning:",
        "error": ":no_entry_sign:",
        "loading": ":watch:",
        "searching": ":mag_right:"
    },
    "response": {
        "missingArguments": "Missing arguments. Please use `{prefix}help` for more information.",
        "invalidPermissions": "You do not have the permission to use this command.",
        "invalidNumber": "Please provide a valid number.",
        "noChannel": "You must be in a voice channel.",
        "wrongChannel": "You must be in the same voice channel as I am.",
        "afkChannel": "You can't be in a AFK voice channel.",
        "noMusic": "No music is playing on this server."
    },
    "player": {
        "maxTime": 15,
        "playIntoEmptyChannel": false,
        "selfDeaf": false,
        "debug": false,
        "allowedExtensions": ["mp3", "wav", "ogg", "flac", "m4a", "aac", "webm", "opus", "aiff", "wma", "ac3"]
    },
    "logs": {
        "resetLogOnStart": true,
        "logToFile": false,
        "timeFormat": "en-US"
    }
}

  • terminateOnUncaughtException: whether to terminate the process on uncaught exception or not - only for advanced users

  • bot.token: the token of your discord bot you can get from Discord Developers page
  • bot.prefix: the prefix which will be used for your bot's commands
  • bot.ignoreMessageEndingWithPrefix: whether to ignore messages (commands) ending with the prefix or not (useful for * and prefixes like this that are used for markdown)
  • bot.ownerID: your discord user id you can get by right clicking user on discord after enabling developer mode

  • status.status: the status of the bot - online / idle / dnd / invisible
  • status.game: the game status the bot will show. can be changed with a command

  • emoji.success: the emoji that will be used for success messages
  • emoji.info: the emoji that will be used for info messages
  • emoji.warning: the emoji that will be used for warning messages
  • emoji.error: the emoji that will be used for error messages
  • emoji.loading: the emoji that will be used for loading messages
  • emoji.searching: the emoji that will be used for searching messages

  • response.notValidCommand: whether to send a message when the user uses a command that doesn't exist
  • response.missingArguments: the message that will be sent when the command is missing arguments
  • response.invalidPermissions: the message that will be sent when the user does not have the permission to use the command
  • response.invalidNumber: the message that will be sent when the user provides an invalid number
  • response.noChannel: the message that will be sent when the bot is not in a voice channel, but the command requires it
  • response.wrongChannel: the message that will be sent when the user is not in the same voice channel as the bot, but the command requires it
  • response.afkChannel: the message that will be sent when the user is in a AFK voice channel, but the user tries to play music
  • response.noMusic: the message that will be sent when the user tries to use a command that requires music to be playing, but there is no music playing

  • player.maxTime: the maximum length of a soound that will be accepted by the setsong command
  • player.playIntoEmptyChannel: whether to play leave sound into an empty voice channel or not
  • player.selfDeaf: whether to deafen the bot or not
  • player.debug: whether to show audioplayer debug messages or not
  • player.allowedExtensions: the extensions that will be allowed to be played by the bot - only for advanced users

  • logs.resetLogOnStart: whether to clear the session log on start or continue at the end of the file ´
  • logs.logToFile: whether to log to a file or only to the console
  • logs.timeFormat: the time format that will be used for the logs - en-US


Adding sounds

To add sounds you will need to add them to the music folder.

In the sounds folder there are 3 files and a users folder.

  • default.mp3 is the sound that will be played when a user joins a voice channel.
  • leave0.mp3 and leave1.mp3 are the sounds that will be played when a user leaves a voice channel. One of them will be randomly selected based on 50% chance.

  • users folder is where you can add custom join sounds for users. To add user a custom sound, simply put a music file named 'USERID_optionalcomment.extention' You can get the userid in discord after enabling developer mode by right clicking the user and selecting 'copy ID'. The allowed extensions are the same as in the config file. I strongly advise against changing the allowedExtensions in the config if you don't know what you are doing.

Instalation

To use the project you will need:
Node JS v16.11 or newer

You will need to install some modules using the following command:
npm i

Please do not withdraw the license and keep the credits on this project.

Made with ❤️ by EnhancedMind

About

Discord bot that plays sounds or music when somebody joins or leaves a voice channel.

Resources

License

Stars

Watchers

Forks

Languages