ChristopherBThai / Discord-OwO-Bot

A Discord bot that will keep track of your OwO
https://discordapp.com/oauth2/authorize?client_id=408785106942164992&permissions=1074120776&scope=bot
Other
556 stars 407 forks source link

step by step how to install and run owo bot on windows computer #361

Open koderbilal opened 1 year ago

koderbilal commented 1 year ago

step by step installation

If there is something you cannot do in the steps below, just let us know.

  1. Download and install the latest version of node.js.

  2. Download and install "visual studio 2017 build tools" on your computer.

  3. "https://www.python.org/downloads/release/python-360/" you download python to your computer from here.

    note : Copy the folder you installed while installing python

  4. You write the following code in cmd and enter it. this is something that is necessary.

npm install -g node-gyp
  1. you adjust the following thing in your own way.
npm config set python /path/to/executable/python
node-gyp configure --msvs_version=2015

note: type the following to see if it is set up correctly.

Type "npm config edit" and enter, a page will open

image

Check if there are the above values ​​on the page that opens, because you have installed windows build tools according to yourself, and also because you have customized the python path you have installed yourself, you need to set it yourself.

  1. then type "node-gyp configure" on the command line and enter.

If it gives the following error, it means it has been installed.

image

  1. now we can deal with setting up and running the project.

the part I show in the screenshot below

image

and delete "canvas": "^2.6.1",

image

note: The reason we do this is because it gives an error in the installation of the module, then we will install it separately.

Now after doing these, you click the folder named Discord-OwO-Bot-master, then open the powerShell application and type npm install.

and finally the modules load without any problems

image

If you remember, we deleted the "merge-images" part and the "canvas" part above, to install it, type npm install merge-images canvas and enter, it will be installed without any problems.

image

You've done all the things up to here, are you done? Of course not, it's not over.

  1. Download MariaDB and install them on your computer.

Create a file named "all-dbs.sql" and copy and save the following things in it.

DROP TABLE IF EXISTS `mysql`.`global_priv`;
DROP VIEW IF EXISTS `mysql`.`user`;

Then run the database installed on your computer and import the sql files in the "secret" folder.

warning: If you get an error while running the files, first import the file named CREATE-OWO-TABLES.sql and run it. then run the file named all-dbs.sql that you created and then run the file named CREATE-OWO-TABLES.sql again. After that, run the file named OWO-TABLE-DATA.sql. If you get the error "Table user already exists" when running the initial file, ignore it.

note: The process up to this point was related to installation, the next processes are to fix problems with the code itself.

  1. Open the folders named src\commands\commandList\utils and delete the file named covid.js in the utils folder.

Question: Why are we deleting the file named covid.js?

Answer: There is a problem with the covid url on line 167 in the file named covid.js. this is Error: Invalid URI "/covid" in the problem.

image

for example as in the pictures below

image

image

image

  1. Delete the file named captcha.js in the src\commands\commandList\admin folder.

note: because there is no file named captcha.js in the tokens folder, this is a special file different from the one we deleted.

  1. Open the messageCreate.js file in the src/eventHandlers folder and add your own server id to the server ids in the whitelist section on the 8th line.

image

  1. finally you can run this bot. I assume that you have edited the content of the required env file according to your gend.

Type the code below and enter.

node index.js

Warning: After running your bot, you may see a few errors on the command line. One of these errors is the SnailSocket connect_error error and the other is the StreamSocket connect_error error, these errors are not important.