Skip to content

Commit

Permalink
Remove my hardcoded Discord User ID and add config
Browse files Browse the repository at this point in the history
  • Loading branch information
dxnter committed Oct 23, 2020
1 parent f49f18b commit b52bcd4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ For comments and support contact me on Discord: <strong>dxnter#0001</strong>
### Requirements
- [Discord Bot Token](https://github.com/reactiflux/discord-irc/wiki/Creating-a-discord-bot-&-getting-a-token)
- [Last.FM API Key](https://last.fm/api)
- [Discord User ID](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-)

### Installation
```bash
Expand All @@ -41,9 +42,12 @@ npm install

### Configuration
Rename `config.example.json` to `config.json` in the root directory and enter in the correct information for each property.

`OWNERS` can either be a single Discord User ID or multiple ID's separated by a comma. Owners will have complete control over Lasty and bypass command throttling.
```json
{
"PREFIX": "",
"OWNERS": "",
"DISCORD_BOT_TOKEN": "",
"LASTFM_API_KEY": ""
}
Expand Down
1 change: 1 addition & 0 deletions config.example.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"PREFIX": "",
"OWNERS": "",
"DISCORD_BOT_TOKEN": "",
"LASTFM_API_KEY": ""
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lasty",
"version": "2.0.0",
"version": "2.0.1",
"description": "A Discord bot for fetching Last.fm stats",
"main": "bot.js",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import { CronJob } from 'cron';
import './db';
import checkIfValidToken from './utils/checkIfValidToken';
import weeklyStatCron from './utils/weeklyStatCron';
import { PREFIX, DISCORD_BOT_TOKEN } from '../config.json';
import { OWNERS, PREFIX, DISCORD_BOT_TOKEN } from '../config.json';

checkIfValidToken();

const client = new Client({
commandPrefix: PREFIX,
owner: '136246346280730624',
owner: OWNERS.split(',').map(id => id.trim()),
disableMentions: 'everyone'
});

Expand Down

0 comments on commit b52bcd4

Please sign in to comment.