Code Monkey home page Code Monkey logo

master-bot's Introduction

A Discord Music Bot written in TypeScript using Sapphire, discord.js, Next.js and React

image image

System dependencies

Setup bot

Create an application.yml file root folder.

Download the latest Lavalink jar from here and also place it in the root folder.

PostgreSQL

Linux

Either from the official site or follow the tutorial for your distro.

MacOS

Get brew, then enter 'brew install postgresql'.

Windows

Getting Postgres and Prisma to work together on Windows is not worth the hassle. Create an account on heroku and follow these steps:

  1. Open the dashboard and click on 'New' > 'Create new app', give it a name and select the closest region to you then click on 'Create app'.
  2. Go to 'Resources' tab, under 'Add-ons' search for 'Heroku Postgres' and select it. Click 'Submit Order Form' and then do the same step again (create another postgres instance).
  3. Click on each 'Heroku Postgres' addon you created, go to 'Settings' tab > Database Credentials > View Credentials and copy the each one's URI to either DATABASE_URL or SHADOW_DB_URL in the .env file you will be creating in the settings section.
  4. Done!

Redis

MacOS

brew install redis.

Windows

Download from here.

Linux

Follow the instructions here.

Settings (env)

Create a .env file in the root directory and copy the contents of .env.example to it. Note: if you are not hosting postgres on Heroku you do not need the SHADOW_DB_URL variable.

# DB URL
DATABASE_URL="postgresql://john:doe@localhost:5432/master-bot?schema=public"

# Bot Token
DISCORD_TOKEN=""

NEXTAUTH_SECRET="somesupersecrettwelvelengthword"
NEXTAUTH_URL=
NEXTAUTH_URL_INTERNAL=http://localhost:3000
NEXT_PUBLIC_INVITE_URL="https://discord.com/api/oauth2/authorize?client_id=yourclientid&permissions=8&scope=bot"

# Next Auth Discord Provider
DISCORD_CLIENT_ID=""
DISCORD_CLIENT_SECRET=""

# Lavalink
LAVA_HOST="0.0.0.0"
LAVA_PASS="youshallnotpass"
LAVA_PORT=2333
LAVA_SECURE=false

# Spotify
SPOTIFY_CLIENT_ID=""
SPOTIFY_CLIENT_SECRET=""

# Twitch
TWITCH_CLIENT_ID=""
TWITCH_CLIENT_SECRET=""

# Other APIs
TENOR_API=""
NEWS_API=""
GENIUS_API=""
RAWG_API=""

Gif features

If you have no use in the gif commands, leave everything under 'Other APIs' empty. Same applies for Twitch, everything else is needed.

DB URL

Change 'john' to your pc username and 'doe' to some password, or set the name and password you created when you installed Postgres.

Bot Token

Generate a token in your Discord developer portal.

Next Auth

You can leave everything as is, just change 'yourclientid' in NEXT_PUBLIC_INVITE_URL to your Discord bot id and then change 'domain' in NEXTAUTH_URL to your domain or public ip. You can find your public ip by going to www.whatismyip.com.

Next Auth Discord Provider

Go to the OAuth2 tab in the developer portal, copy the Client ID to DISCORD_CLIENT_ID and generate a secret to place in DISCORD_CLIENT_SECRET. Also, set the following URLs under 'Redirects':

Make sure to change 'domain' in http://domain:3000/api/auth/callback/discord to your domain or public ip.

Lavalink

You can leave this as long as the values match your application.yml.

Spotify and Twitch

Create an application in each platform's developer portal and paste the relevant values.

Pnpm

Install pnpm: npm install -g pnpm or on Windows iwr https://get.pnpm.io/install.ps1 -useb | iex or on Mac using Homebrew brew install pnpm

Running the bot

  1. If you followed everything right, hit pnpm i in the root folder. When it finishes make sure prisma didn't error.
  2. Open a separate terminal in the root folder and run 'java -jar Lavalink.jar' (must be running all the time).
  3. Wait a few seconds and run pnpm dev in the root folder in another terminal window.
  4. If everything works, your bot and dashboard should be running.
  5. Enjoy!

Commands

A full list of commands for use with Master Bot

Music

Command Description Usage
/play Play any song or playlist from youtube, you can do it by searching for a song by name or song url or playlist url /play darude sandstorm
/pause Pause the current playing song /pause
/resume Resume the current paused song /resume
/leave Leaves voice channel if in one /leave
/remove Remove a specific song from queue by its number in queue /remove 4
/queue Display the song queue /queue
/shuffle Shuffle the song queue /shuffle
/skip Skip the current playing song /skip
/skipall Skip all songs in queue /skipall
/skipto Skip to a specific song in the queue, provide the song number as an argument /skipto 5
/volume Adjust song volume /volume 80
/music-trivia Engage in a music trivia with your friends. You can add more songs to the trivia pool in resources/music/musictrivia.json /music-trivia
/loop Loop the currently playing song or queue /loop
/lyrics Get lyrics of any song or the lyrics of the currently playing song /lyrics song-name
/now-playing Display the current playing song with a playback bar /now-playing
/move Move song to a desired position in queue /move 8 1
/queue-history Display the queue history /queue-history
/create-playlist Create a custom playlist /create-playlist 'playlistname'
/save-to-playlist Add a song or playlist to a custom playlist /save-to-playlist 'playlistname' 'yt or spotify url'
/remove-from-playlist Remove a track from a custom playlist /remove-from-playlist 'playlistname' 'track location'
/my-playlists Display your custom playlists /my-playlists
/display-playlist Display a custom playlist /display-playlist 'playlistname'
/delete-playlist remove a custom playlist /delete-playlist 'playlistname'

Gifs

Command Description Usage
/gif Get a random gif /gif
/jojo Get a random jojo gif /jojo
/gintama Get a random gintama gif /gintama
/anime Get a random anime gif /anime
/baka Get a random baka gif /baka
/cat Get a cute cat picture /cat
/doggo Get a cute dog picture /doggo
/hug Get a random hug gif /hug
/slap Get a random slap gif /slap
/pat Get a random pat gif /pat
/triggered Get a random triggered gif /triggered
/amongus Get a random Among Us gif /amongus

Other

Command Description Usage
/fortune Get a fortune cookie tip /fortune
/insult Generate an evil insult /insult
/chucknorris Get a satirical fact about Chuck Norris /chucknorris
/motivation Get a random motivational quote /motivation
/random Generate a random number between two provided numbers /random 0 100
/8ball Get the answer to anything! /8ball Is this bot awesome?
/rps Rock Paper Scissors /rps
/bored Generate a random activity! /bored
/advice Get some advice! /advice
/game-search Search for game information. /game-search super-metroid
/kanye Get a random Kanye quote /kanye
/world-news Latest headlines from reuters, you can change the news source to whatever news source you want, just change the source in line 13 in world-news.js or ynet-news.js /world-news
/translate Translate to any language using Google translate.(only supported languages) /translate english ありがとう
/about Info about me and the repo /about
/urban dictionary Get definitions from urban dictionary /urban javascript
/activity Generate an invite link to your voice channel's activity /activity voicechannel Chill
/twitch-status Check the status of a Twitch steamer /twitch-status streamer: bacon_fixation

Resources

Getting a Tenor API key

Getting a NewsAPI API key

Getting a Genius API key

Getting a rawg API key

Getting a Twitch API key

Installing Node.js on Debian

Installing Node.js on Windows

Installing on a Raspberry Pi

Using a Repl.it LavaLink server

Using a public LavaLink server

Using an Internal LavaLink server

Contributing

Fork it and submit a pull request! Anyone is welcome to suggest new features and improve code quality!

Contributors ❤️

Bacon Fixation ⭐ - Countless contributions

ModoSN - 'resolve-ip', 'rps', '8ball', 'bored', 'trump', 'advice', 'kanye', 'urban dictionary' commands and visual updates

PhantomNimbi - bring back gif commands, lavalink config tweaks

Natemo6348 - 'mute', 'unmute'

kfirmeg - play command flags, dockerization, docker wiki

rafaeldamasceno - 'music-trivia' and Dockerfile improvements, minor tweaks

navidmafi - 'LeaveTimeOut' and 'MaxResponseTime' options, update issue template, fix leave command

Kyoyo - added back 'now-playing'

MontejoJorge - added back 'remind'

malokdev - 'uptime' command

chimaerra - minor command tweaks

master-bot's People

Contributors

austinmcrane avatar bacon-fixation avatar chimaerra avatar commanderroot avatar dependabot[bot] avatar franklinmoy3 avatar galnir avatar hisham3d avatar julepthemusicbot avatar juliusmarminge avatar ka1-s avatar kfirmeg avatar kiyoshikuncool avatar kmkm133 avatar modosn avatar montejojorge avatar muhitrhn avatar natemo2625 avatar navidmafi avatar notkyoyo avatar phantomnimbi avatar rafaeldamasceno avatar thaddeuskkr avatar wolf20482 avatar yungando avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

master-bot's Issues

Feature: Playlist :D

Hi, Your code helps me out a lot.

I would love to see the playlist feature write by you.

I did the url.match for the playlist but it didn't work. If you have free time please help me out, if not it's totally fine :)

Many thanks,

Playing music no works

Hello,
when I use !play (youtube link), bot joins to voice channel but there isn't sound.

Bot have correct permissions on Discord server, so it shouldn't be problem. API keys are also correct.

Before opening "Cannot read property 'xyz' of undefined" or any issue

Many users copy commands from this bot to their existing bots and get the classic "Cannot read property 'xyz of undefined" or something else is undefined. This happens because this bot uses the master branch of discord.js which has new voice changes . Before opening an issue about the said error please try these 2 solutions:

  1. Do not open an issue if you simply "copied" code over from this repository to your bot/existing bot. This is absolutely not recommended and will not work as expected. If you did so, the next steps won't assist you.

  2. Did you install discord.js-commando and discord.js#master correctly? When running npm view discord.js version you should get 12.5.1, and you should get 0.12.2 from running npm view discord.js-commando version.

  3. Go to your dependencies section in your package.json, you should see discord.js and discord.js-commando listed like this:
    "discord.js": "github:discordjs/discord.js#stable",
    "discord.js-commando": "github:discordjs/Commando"
    If there are numbers instead of "github....", replace them with the "github" versions and hit npm install.

  4. Make sure you have installed python 2.7 correctly.

A strange issue popped up

Hello, first of all, thank you for creating this amazing bot.
I followed your guide based on this link.
And It seems that after running node index.json, it returns an error of:

internal/modules/cjs/loader.js:1195
    throw err;
    ^

SyntaxError: /home/pi/Master-Bot/config.json: Unexpected token / in JSON at position 20
    at parse (<anonymous>)
    at Object.Module._extensions..json (internal/modules/cjs/loader.js:1192:22)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (/home/pi/Master-Bot/index.js:4:27)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)

TypeError: Cannot read property 'username' of undefined

I have no idea why I miss this error, could you help me?
Error:
(node:8031) DeprecationWarning: Collection#filterArray: use Collection#filter instead
Running command music:play.
TypeError: Cannot read property 'username' of undefined
at owners.map (/root/discord-bots/d4rkn3ss/node_modules/discord.js-commando/src/commands/message.js:239:48)
at Array.map ()
at CommandMessage.run (/root/discord-bots/d4rkn3ss/node_modules/discord.js-commando/src/commands/message.js:237:37)
at process._tickCallback (internal/process/next_tick.js:68:7)

Music Trivia only plays one song

When starting a music trivia the bot only plays one song, after it either hitting the 30 second timeout or the correct answer is given the bot doesn't play a second song.

I've tried running !end-trivia but this also does nothing. Running !music-trivia again just says one is already running.

Hi how can i change the messages

Hi greetings. i'm using your bot at my discord server but i have to translate to Turkish
I translated commands but i can't edit help command. For example when i write //help bot says "Sent you a DM with information." but i want to change it. I can not find it at files can you help me? (:

TypeError: fields.flat is not a function

Im hosting my bot in glitch.com
Its working before idk why i get this error

Ready!8:26 PM

Oops! Error: 400 Bad Request8:26 PM

/rbd/pnpm-volume/2fe8ac4a-1d04-4487-bf4a-df3ec67ce89f/node_modules/discord.js/src/structures/MessageEmbed.js:4338:26 PM

.flat(2)8:26 PM

^8:26 PM

8:26 PM

TypeError: fields.flat is not a function8:26 PM

at Function.normalizeFields (/rbd/pnpm-volume/2fe8ac4a-1d04-4487-bf4a-df3ec67ce89f/node_modules/discord.js/src/structures/MessageEmbed.js:433:8)8:26 PM

at MessageEmbed.setup (/rbd/pnpm-volume/2fe8ac4a-1d04-4487-bf4a-df3ec67ce89f/node_modules/discord.js/src/structures/MessageEmbed.js:68:50)8:26 PM

at new MessageEmbed (/rbd/pnpm-volume/2fe8ac4a-1d04-4487-bf4a-df3ec67ce89f/node_modules/discord.js/src/structures/MessageEmbed.js:11:10)8:26 PM

at embeds.map.e (/rbd/pnpm-volume/2fe8ac4a-1d04-4487-bf4a-df3ec67ce89f/node_modules/discord.js/src/structures/Message.js:101:48)8:26 PM

at Array.map ()8:26 PM

at CommandoMessage._patch (/rbd/pnpm-volume/2fe8ac4a-1d04-4487-bf4a-df3ec67ce89f/node_modules/discord.js/src/structures/Message.js:101:39)8:26 PM

at new Message (/rbd/pnpm-volume/2fe8ac4a-1d04-4487-bf4a-df3ec67ce89f/node_modules/discord.js/src/structures/Message.js:43:20)8:26 PM

at new CommandoMessage (/rbd/pnpm-volume/2fe8ac4a-1d04-4487-bf4a-df3ec67ce89f/node_modules/discord.js-commando/src/extensions/message.js:14:4)8:26 PM

at MessageManager.add (/rbd/pnpm-volume/2fe8ac4a-1d04-4487-bf4a-df3ec67ce89f/node_modules/discord.js/src/managers/BaseManager.js:49:32)8:26 PM

at MessageManager.add (/rbd/pnpm-volume/2fe8ac4a-1d04-4487-bf4a-df3ec67ce89f/node_modules/discord.js/src/managers/MessageManager.js:29:18)

Cannot read property 'extend'.

module.exports = Structures.extend('Message', Message => {
TypeError: Cannot read property 'extend' of undefined
at Object. (/home/container/node_modules/discord.js-commando/src/extensions/message.js:7:29)
at Module._compile (internal/modules/cjs/loader.js:816:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
at Module.load (internal/modules/cjs/loader.js:685:32)
at Function.Module._load (internal/modules/cjs/loader.js:620:12)
at Module.require (internal/modules/cjs/loader.js:723:19)
at require (internal/modules/cjs/helpers.js:14:16)
at Object. (/home/container/node_modules/discord.js-commando/src/registry.js:5:25)
at Module._compile (internal/modules/cjs/loader.js:816:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)

cannot read property

Structures.extend('Guild', Guild => {
^

TypeError: Cannot read property 'extend' of undefined

Large playlists error

I removed the playlist limit however whenever I play a large playlist I get this error:

Error: resource youtube#videoListResponse not found
    at C:\Users\Kuba\Desktop\luv\node_modules\simple-youtube-api\src\Request.js:35:68
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async PlayCommand.run (C:\Users\Kuba\Desktop\luv\commands\music\play.js:58:25)
    at async CommandoMessage.run (C:\Users\Kuba\Desktop\luv\node_modules\discord.js-commando\src\extensions\message.js:235:20)
    at async CommandDispatcher.handleMessage (C:\Users\Kuba\Desktop\luv\node_modules\discord.js-commando\src\dispatcher.js:143:19)

Any help please?

Command Request

Could you maybe add a mute and unmute command? Would be very useful.

Command issues

The bot won't play songs that have been added to the queue, instead, it plays the first song and stops. And if you use the %play again it just adds it to the queue unless you restart the bot.

song playing error

Whenever I try to play a song, I get this error,
TypeError: fields.flat is not a function
I only get this error after responding with the song query.
I am hosting my bot on glitch
Screenshot 2020-04-30 at 12 55 09 PM

TypeError: Cannot read property 'channel' of undefined

when i do the command [p]play url it says in the channel on discord: @user, An error occurred while running the command: TypeError: Cannot read property 'channel' of undefined
You shouldn't ever receive an error like this.
Please contact user
In the txt edition im using it says: (node:22516) DeprecationWarning: Collection#filterArray: use Collection#filter instead

Please note i switch my username for user above

Feature Requests

Hey,

It'd be great to have the following features added to the music-trivia if at all possible:

  • When a song isn't guessed correctly it says the artist and song name in chat.
  • Show a leader-board of the top 5 people from the quiz instead of just the winner.
  • After starting a trivia I'd like it to play a preset sound file to give a countdown (i can get the file)

Many thanks

Where?

Where the config.json ?

How do I translate everything?

Hello there. I don't really like opening "issues" for just questions but since it's almost the only way to discuss, here I am.
First of all, your bot is awesome with all these features and stuff(translate option and news especially), so thank you very much for that. Would be happy to donate you some amount of money but I don't have much.
So basically how do I translate the bot completely? As I understand, I need to translate ./commands and discord.js-commando. Is there anything more I need to know? Thanks.

Message for unknown command

Hello,
I can't find where is defined message "Unknown command. Use !help.....". How I can change it, I want to use another text.

ECONNRESET error when trying to play certain youtube videos

I'm getting this error when trying to play some songs :

Error: read ECONNRESET
    at TLSWrap.onStreamRead (internal/stream_base_commons.js:201:27) {
  errno: 'ECONNRESET',
  code: 'ECONNRESET',
  syscall: 'read'
}

How to reproduce

I'm getting the error when trying this command:

!play https://www.youtube.com/watch?v=Y5tjtUFL0j4

Environment informations

$ node -v
v12.14.0
$ npm -v
6.14.4
$ python2.7 --version
Python 2.7.16
$ ffmpeg -version                                                                                                                                                                               
ffmpeg version 4.1.4-1~deb10u1 Copyright (c) 2000-2019 the FFmpeg developers

fields.flat is not a function

I don't know why I get this error, I cloned it using glitch and when I do !play, it says "fields.flat is not a function." If you could help me, thank you.

Embed Help Command

Hi, can you help me to make help command that send embed in channel and not dm the user.

Thats it only...

Users should know about volume being changed

I don't know how to do pull requests so sorry for that :D

./commands/music/volume.js >

from:

message.guild.musicData.volume = volume;
    message.guild.musicData.songDispatcher.setVolume(volume);

to:

message.guild.musicData.volume = volume;
    message.guild.musicData.songDispatcher.setVolume(volume);
	message.say(`Current volume is: ${wantedVolume}%`);

2 errors

Structures.extend('Guild', Guild => {
^
and,

TypeError: Cannot read property 'extend' of undefined
at Object. (/app/index.js:6:12)

Error

PS E:\Elite Online\elite bot\Community Bots\Master-Bot-master> node .
internal/modules/cjs/loader.js:1181
    throw err;
    ^

SyntaxError: E:\Elite Online\elite bot\Community Bots\Master-Bot-master\config.json: Unexpected token / in JSON at position 21
    at parse (<anonymous>)
    at Object.Module._extensions..json (internal/modules/cjs/loader.js:1178:22)
    at Module.load (internal/modules/cjs/loader.js:993:32)
    at Function.Module._load (internal/modules/cjs/loader.js:892:14)
    at Module.require (internal/modules/cjs/loader.js:1033:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (E:\Elite Online\elite bot\Community Bots\Master-Bot-master\index.js:4:27)
    at Module._compile (internal/modules/cjs/loader.js:1144:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1164:10)
    at Module.load (internal/modules/cjs/loader.js:993:32)
PS E:\Elite Online\elite bot\Community Bots\Master-Bot-master>

Cannot read property 'leave' of undefined

TypeError: connection.play is not a function
at queue.(anonymous function).voiceChannel.join.then.connection

(C:\Users\Roman\Desktop\INPGT-BOT\commands\music\play.js:241:10)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:13548) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'leave' of undefined
at queue.(anonymous function).voiceChannel.join.then.catch.e

(C:\Users\Roman\Desktop\INPGT-BOT\commands\music\play.js:273:27)
at process._tickCallback (internal/process/next_tick.js:68:7)

(node:13548) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)

(node:13548) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Cannot read property Hits

TypeError: Cannot read property 'hits' of undefined
at LyricsCommand.run (C:\Users\Nicholas Lee\Downloads\Master-Bot-master\commands\music\lyrics.js:56:38)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async CommandoMessage.run (C:\Users\Nicholas Lee\Downloads\Master-Bot-master\node_modules\discord.js-commando\src\extensions\message.js:235:20)
at async CommandDispatcher.handleMessage (C:\Users\Nicholas Lee\Downloads\Master-Bot-master\node_modules\discord.js-commando\src\dispatcher.js:143:19)

Hi, if you can help me with that, i will feel appreciated

cannot read property

PS C:\Users\Avyaan\Desktop\Discord Bot> node .
C:\Users\Avyaan\Desktop\Discord Bot\index.js:6
Structures.extend('Guild', Guild => {
^

TypeError: Cannot read property 'extend' of undefined
at Object. (C:\Users\Avyaan\Desktop\Discord Bot\index.js:6:12)
?[90m at Module._compile (internal/modules/cjs/loader.js:959:30)?[39m
?[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)?[39m
?[90m at Module.load (internal/modules/cjs/loader.js:815:32)?[39m
?[90m at Function.Module._load (internal/modules/cjs/loader.js:727:14)?[39m
?[90m at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)?[39m
?[90m at internal/main/run_main_module.js:17:11?[39m
PS C:\Users\Avyaan\Desktop\Discord Bot> npm view discord.js version
11.5.1
PS C:\Users\Avyaan\Desktop\Discord Bot> npm view discord.js-commando version
0.10.0
PS C:\Users\Avyaan\Desktop\Discord Bot>

Add spotify.

Hey, Add spotify and also can i get your discord name with tag, I want to ask something important

Cannot read property 'extend' of undefined

C:\botBounceGaming\Master-Bot\index.js:6
Structures.extend('Guild', Guild => {
^

TypeError: Cannot read property 'extend' of undefined
at Object. (C:\botBounceGaming\Master-Bot\index.js:6:12)
�[90m at Module._compile (internal/modules/cjs/loader.js:956:30)�[39m
�[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)�[39m
�[90m at Module.load (internal/modules/cjs/loader.js:812:32)�[39m
�[90m at Function.Module._load (internal/modules/cjs/loader.js:724:14)�[39m
�[90m at Function.Module.runMain (internal/modules/cjs/loader.js:1025:10)�[39m
�[90m at internal/main/run_main_module.js:17:11�[39m

TypeError: Cannot read property 'client' of undefined

When I try the play command, always after I say the name of the song it says in chat that something went wrong with the search of said song and then when I look in the console it says
"TypeError: Cannot read property 'client' of undefined
at new MessageEmbed
\node_modules\discord.js\src\structures\MessageEmbed.js:10:60)
at PlayCommand.run
\commands\music\play.js:144:21)
at processTicksAndRejections (internal/process/task_queues.js:85:5)
at async CommandMessage.run
\node_modules\discord.js-commando\src\commands\message.js:212:19)
at async CommandDispatcher.handleMessage
\node_modules\discord.js-commando\src\dispatcher.js:127:19)
events.js:194"
Btw I took out where it says my name as a user like C:\Users\NAME\Docs\NAME.OF.FOLDER\ANOTHER.NAME

UnhandledPromiseRejectionWarning [TOKEN_INVALID]

Added config.json and changed user id in index.js
when compiling this is the error i get.
i have all the correct dependencies installed and didnt even change anything


(node:23408) UnhandledPromiseRejectionWarning: Error [TOKEN_INVALID]: An invalid token was provided.
at WebSocketManager.connect (D:\eoic-bot\Master-Bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:132:26)
at CommandoClient.login (D:\eoic-bot\Master-Bot\node_modules\discord.js\src\client\Client.js:210:21)
(node:23408) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:23408) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

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.