Skip to content

Commit

Permalink
Add local hosting guide
Browse files Browse the repository at this point in the history
  • Loading branch information
jsmsj committed Nov 10, 2022
1 parent 992eac8 commit 857f01d
Show file tree
Hide file tree
Showing 12 changed files with 155 additions and 3 deletions.
24 changes: 24 additions & 0 deletions changelog.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,29 @@
"description":"Added info command which tells about the bot and gives deploying tutorial.",
"timestamp":1661434206

},
"21":{
"title":"add ETA, update ytlink",
"description":"Bot now shows ETA for completion and updated youtube link for hosting.",
"timestamp":1668090262

},
"22":{
"title":"add files done/files left",
"description":"Bot now shows Transferred files out of total files.",
"timestamp":1668093682

},
"23":{
"title":"update requirements to support py 3.11",
"description":"Now bot will work with python 3.11",
"timestamp":1668094162

},
"24":{
"title":"Add local hosting guide",
"description":"Added guide for hosting the bot locally.",
"timestamp":1668099982

}
}
2 changes: 1 addition & 1 deletion cogs/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async def log(self,ctx):
@commands.command(description=f"About Me and instructions on how to deploy the bot.\n`{prefix}info`")
async def info(self,ctx):
desc = "A discord bot to **clone public/private google drive links** to your personal teamdrive or google drive. Additionally it offers commands to **generate service accounts**, and with proper tutorials.\n\n> IT IS NOT A MIRROR BOT"
desc+= "\n\nDeploying Tutorial : [Youtube](https://youtu.be/csH-SaaDN6A)\n"
desc+= "\n\nDeploying Tutorial : [Youtube](https://www.youtube.com/watch?v=MfnP1M0BW7Y)\n"
desc+="\nOther Tutorials:\n"
desc+="""[quickstart](https://youtu.be/7PvR1MC_khI)
[auth](https://youtu.be/fUKg5Ge2zl4)
Expand Down
47 changes: 47 additions & 0 deletions docs/Host Locally.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Hosting Locally
> Note: The bot doesn't use a lot of resources. My testing shows it uses less than 100 MB of RAM and 0.1% of CPU
## Create MongoDB URI and Discord Bot Token

1. Follow this tutorial and keep the mongodb uri as well as bot token handy.
2. Video: [YouTube](https://youtu.be/OQeUGL26Zdk)
3. Ignore the HEROKU Variables
4. Also Keep your discord user id with you.

## Setting up bot locally

1. Download the latest version of this repository from [this link](https://github.com/jsmsj/GdriveCloneBot/archive/refs/heads/master.zip)
2. Extract it at a suitable location
![](../images/local%201.png)

3. Go to cogs folder and delete _config.py.
4. Open _config_sample.py and edit accordingly.
>Make sure to retain the quotes and brackets.
![](../images/local%202.png)

## Installing requirements

1. Open Command Prompt in that folder.
![](../images/local%203.png)

2. <b>Optional Step</b> Run `pip install virtualenv`.
3. Then run `virtualenv venv` to create a virtual environment.
![](../images/local%204.png)
4. Run `cd venv/Scripts`
5. Activate the virtual environment by running `activate`
6. Go back to the bot directory where main.py file is located.

7. Run `pip install -r requirements.txt`
![](../images/local%205.png)

## Running the bot

1. Run `python main.py`
![](../images/local%206.png)

# The bot is ready. Now you can use the bot as you wish.

### Commands Examples are available in the following video :

<p><a href="https://www.youtube.com/watch?v=MfnP1M0BW7Y"> <img src="https://img.shields.io/badge/See%20Video-black?style=for-the-badge&logo=YouTube" width="160""/></a></p>
2 changes: 1 addition & 1 deletion docs/changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</div>
<div class="col-3">
<div class="list-group list-group-horizontal">
<a href="https://youtu.be/csH-SaaDN6A" class="list-group-item list-group-item-dark" style="width:100%;">Video Tutorial</a>
<a href="https://www.youtube.com/watch?v=MfnP1M0BW7Y" class="list-group-item list-group-item-dark" style="width:100%;">Video Tutorial</a>
</div>
</div>
<div class="col-3">
Expand Down
75 changes: 75 additions & 0 deletions docs/host_locally.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Home | GdriveCloneBot</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="" />
<!-- CSS only -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor" crossorigin="anonymous">

<!-- <link rel="icon" href="img/favicon.png"> -->
</head>
<body class = "bg-secondary">
<div class="text-bg-dark p-4 text-center h2">
<a class="navbar-brand" href="#">
<img src="./img/gdrivelogo.png" alt="" width="33" height="30">
</a>
Google Drive Clone Bot
<a class="navbar-brand" href="#">
<img src="./img/discordlogo.png" alt="" width="36" height="36">
</a>
</div>
<div class="container">
<div class="row text-center h5 justify-content-center">
<div class="col-3">
<div class="list-group list-group-horizontal">
<a href="./changelog.html" class="list-group-item list-group-item-dark" style="width:100%;">Changelog</a>
</div>
</div>
<div class="col-3">
<div class="list-group list-group-horizontal">
<a href="https://www.youtube.com/watch?v=MfnP1M0BW7Y" class="list-group-item list-group-item-dark" style="width:100%;">Video Tutorial</a>
</div>
</div>
<div class="col-3">
<div class="list-group list-group-horizontal">
<a href="https://github.com/jsmsj/GdriveCloneBot" target="_blank" class="list-group-item list-group-item-dark" style="width:100%;">Github Repository</a>
</div>
</div>
</div>
<div class="row text-center h5 justify-content-center">
<div class="col-3">
<div class="list-group list-group-horizontal">
<a href="./host_locally.html" target="_blank" class="list-group-item list-group-item-dark" style="width:100%;">Host Locally</a>
</div>
</div>
<div class="text-bg-light rounded m-3 p-3">
<!-- <md-block id="mdblk">
</md-block> -->
<zero-md src="https://raw.githubusercontent.com/jsmsj/GdriveCloneBot/master/cogs/Host%20Locally.md" id="mdblk"></zero-md>
</div>
</div>


<div class="position-absolute bottom-0 end-0 table-responsive">
<table class="table table-dark table-striped">
<tr>
<td>
<button type="button" class="btn btn-outline-info">
<a class="navbar-brand" href="https://www.github.com/jsmsj" target="_blank" rel="noopener noreferrer">
<img src="./img/githublogo.png" alt="" width="25" height="25">
&nbsp;jsmsj
</a>
</button>
</td>
</table>
</div>
<script
type="module"
src="https://cdn.jsdelivr.net/gh/zerodevx/zero-md@2/dist/zero-md.min.js"
></script>
<script src="main.js"></script>
</body>
</html>
8 changes: 7 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</div>
<div class="col-3">
<div class="list-group list-group-horizontal">
<a href="https://youtu.be/csH-SaaDN6A" class="list-group-item list-group-item-dark" style="width:100%;">Video Tutorial</a>
<a href="https://www.youtube.com/watch?v=MfnP1M0BW7Y" class="list-group-item list-group-item-dark" style="width:100%;">Video Tutorial</a>
</div>
</div>
<div class="col-3">
Expand All @@ -38,6 +38,12 @@
</div>
</div>
</div>
<div class="row text-center h5 justify-content-center">
<div class="col-3">
<div class="list-group list-group-horizontal">
<a href="./host_locally.html" target="_blank" class="list-group-item list-group-item-dark" style="width:100%;">Host Locally</a>
</div>
</div>
<div class="text-bg-light rounded m-3 p-3">
<!-- <md-block id="mdblk">
Expand Down
Binary file added images/local 1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/local 2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/local 3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/local 4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/local 5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/local 6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 857f01d

Please sign in to comment.