-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved to discord-bot-quickstart on the backend
- Loading branch information
Showing
29 changed files
with
339 additions
and
955 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
import * as fs from 'fs'; | ||
import { requireFile, writeJson, logger, BotConfig, Bot } from './resources'; | ||
import { requireFile, projectDir, writeJson } from 'discord-bot-quickstart'; | ||
import { IRhythmBotConfig, RhythmBot } from './bot'; | ||
|
||
process.on('unhandledRejection', error => logger.error('Uncaught Promise Rejection', error)); | ||
|
||
if (!fs.existsSync('./bot-config.json')) { | ||
writeJson({ discord: { token: '<BOT-TOKEN>' } }, './bot-config.json'); | ||
const configPath = projectDir('../bot-config.json'); | ||
if (!fs.existsSync(configPath)) { | ||
writeJson({ discord: { token: '<BOT-TOKEN>' } }, configPath); | ||
} | ||
let config: BotConfig = requireFile('./bot-config.json'); | ||
|
||
let config: IRhythmBotConfig = requireFile('../bot-config.json'); | ||
|
||
const bot = new RhythmBot(config); | ||
|
||
if (!!config && config.discord.token === '<BOT-TOKEN>') { | ||
logger.debug('Invalid Token - Create valid token in the Discord Developer Portal'); | ||
bot.logger.debug('Invalid Token - Create valid token in the Discord Developer Portal'); | ||
console.log('Invalid Token - Create valid token in the Discord Developer Portal'); | ||
process.exit(0); | ||
} | ||
|
||
let bot = new Bot(config); | ||
|
||
bot.connect() | ||
.then(() => { | ||
logger.debug('Bot Ready'); | ||
console.log('Bot Online'); | ||
bot.logger.debug('Rhythm Bot Online'); | ||
bot.listen(); | ||
}) | ||
.catch(err => logger.error(err)); | ||
.catch(err => bot.logger.error(err)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { IBotConfig } from 'discord-bot-quickstart'; | ||
|
||
export interface IRhythmBotConfig extends IBotConfig { | ||
auto?: { | ||
deafen?: boolean, | ||
pause?: boolean, | ||
play?: boolean, | ||
reconnect?: boolean | ||
}, | ||
queue?: { | ||
announce?: boolean; | ||
repeat?: boolean; | ||
}, | ||
stream?: { | ||
seek?: number; | ||
packetLossPercentage?: number; | ||
forwardErrorCorrection?: boolean; | ||
volume?: number; | ||
bitrate?: number | 'auto'; | ||
}, | ||
emojis?: { | ||
addSong?: string; | ||
stopSong?: string; | ||
playSong?: string; | ||
pauseSong?: string; | ||
skipSong?: string; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.