Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Nemuno
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Leviathan
Nemuno
Commits
9da94ba6
Commit
9da94ba6
authored
Feb 27, 2021
by
Reviath
Browse files
Options
Downloads
Patches
Plain Diff
bot.js is ready to mysql connection
parent
4f986fb4
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
bot.js
+15
-3
15 additions, 3 deletions
bot.js
settings.example.json
+5
-1
5 additions, 1 deletion
settings.example.json
with
20 additions
and
4 deletions
bot.js
+
15
−
3
View file @
9da94ba6
const
Discord
=
require
(
'
discord.js
'
);
const
client
=
new
Discord
.
Client
();
const
ms
=
require
(
'
ms
'
);
const
moment
=
require
(
'
moment
'
);
const
ready
=
require
(
'
./events/ready
'
);
const
message
=
require
(
'
./events/message
'
);
const
settings
=
require
(
'
./settings.json
'
);
...
...
@@ -10,11 +8,25 @@ const db = require('quick.db')
const
ytdl
=
require
(
'
discord-ytdl-core
'
);
const
YouTube
=
require
(
'
simple-youtube-api
'
);
require
(
'
./functions
'
)(
client
,
ytdl
,
settings
);
var
mysql
=
require
(
'
mysql
'
);
var
connection
=
mysql
.
createConnection
({
host
:
settings
.
host
,
user
:
settings
.
user
,
password
:
settings
.
password
,
database
:
settings
.
db
});
connection
.
connect
((
err
)
=>
{
if
(
err
){
throw
err
;
}
console
.
log
(
'
Successfully connected to MySQL database.
'
);
});
client
.
commands
=
new
Discord
.
Collection
();
client
.
aliases
=
new
Discord
.
Collection
();
ready
.
ready
(
client
);
message
.
message
(
client
,
settings
,
Discord
);
message
.
message
(
client
,
settings
,
Discord
,
connection
);
client
.
youtube
=
new
YouTube
(
settings
.
api
);
client
.
queue
=
new
Map
();
...
...
This diff is collapsed.
Click to expand it.
settings.example.json
+
5
−
1
View file @
9da94ba6
...
...
@@ -2,5 +2,9 @@
"prefix"
:
"PREFİX"
,
"author"
:
"AUTHOR"
,
"token"
:
"TOKEN"
,
"api"
:
"API TOKEN"
"api"
:
"API TOKEN"
,
"host"
:
"HOST"
,
"db"
:
"DATABASE"
,
"user"
:
"USER"
,
"password"
:
"PASSWORD"
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment