Skip to content

Commit

Permalink
Updates (#2)
Browse files Browse the repository at this point in the history
Various updates
  • Loading branch information
advaith1 committed Jan 21, 2018
1 parent 421c311 commit b08c886
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .config/configstore/update-notifier-npm.json
@@ -1,4 +1,4 @@
{
"optOut": false,
"lastUpdateCheck": 1516231579924
"lastUpdateCheck": 1516406362865
}
1 change: 0 additions & 1 deletion .gitignore

This file was deleted.

File renamed without changes.
23 changes: 5 additions & 18 deletions README.md
@@ -1,23 +1,10 @@
# AdvaithBot
A multipurpose Discord bot, made with [discord.js](https://discord.js.org) and the [Spark framework](https://discordspark.tk).

How to install:
1. Clone this repo
2. Create a file titled `app.js` with the following format:
```js
const Spark = require("sparkbots")

Spark.start({
prefix: "PREFIX_HERE",
token: "TOKEN_HERE"
})

var ClientInjRe = require('./express.js')
Want to self-host AdvaithBot? You can use [glitch](https://glitch.com) to host the bot for free.
`.env` file:
```
Put your prefix and token where it says `PREFIX_HERE` and `TOKEN_HERE`.

3. CD into the folder and run `npm install sparkbots@beta` and `npm install express`

4. Run `node app.js` to start the bot.

You can use [glitch](https://glitch.com) to host the bot for free.
DBL_TOKEN="put your discordbots.org token here"
TOKEN="put your bot's token here"
```
8 changes: 8 additions & 0 deletions app.js
@@ -0,0 +1,8 @@
const Spark = require("sparkbots")

Spark.start({
prefix: "!!",
token: process.env.TOKEN
})

var ClientInjRe = require('./express.js')
24 changes: 23 additions & 1 deletion functions/boot/boot.js
Expand Up @@ -4,6 +4,28 @@ exports.delay = 0;

exports.function = function(client) {

console.log("ran boot function")
const snekfetch = require('snekfetch') //for discordbots.org stats


//runs every hour, used for getting server count for stuff
setInterval(() => {
//updates discordbots.org server count
snekfetch.post(`https://discordbots.org/api/bots/398690824721924107/stats`)
.set('Authorization', process.env.DBL_TOKEN)
.send({ server_count: client.guilds.size })
.then(() => console.log('Updated discordbots.org stats.'))
.catch(err => console.error(`Whoops something went wrong: ${err.body}`));

//updates playing status: Watching x servers
client.user.setPresence({
status: "online",
activity: {
name: `${client.guilds.size} servers`,
type: 3,
}
})
}, 3600000)

console.log("ran boot function")

}

0 comments on commit b08c886

Please sign in to comment.