From f4b4b63faa80057e2d0a456ac702a97ffaaf37d2 Mon Sep 17 00:00:00 2001 From: Kata Date: Thu, 21 Mar 2019 04:51:09 -0500 Subject: [PATCH] add bot name modularity --- Roleypoly.js | 4 +++- next.config.js | 4 ++++ ui/pages/auth/login.js | 14 +++++++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Roleypoly.js b/Roleypoly.js index 305eb56..13295ff 100644 --- a/Roleypoly.js +++ b/Roleypoly.js @@ -109,7 +109,9 @@ class Roleypoly { this.ctx.sql = sequelize this.M = fetchModels(sequelize) this.ctx.M = this.M - await sequelize.sync() + if (!process.env.DB_NO_SYNC) { + await sequelize.sync() + } this.ctx.server = new ServerService(this.ctx) this.ctx.discord = new DiscordService(this.ctx) diff --git a/next.config.js b/next.config.js index 97151df..9219483 100644 --- a/next.config.js +++ b/next.config.js @@ -1,4 +1,8 @@ +import 'dotenv/config' module.exports = { + publicRuntimeConfig: { + BOT_HANDLE: process.env.BOT_HANDLE + }, webpack: config => { // Fixes npm packages that depend on `fs` module config.node = { diff --git a/ui/pages/auth/login.js b/ui/pages/auth/login.js index 24e72e4..ea0b5e0 100644 --- a/ui/pages/auth/login.js +++ b/ui/pages/auth/login.js @@ -7,6 +7,8 @@ import RPC from '../../config/rpc' import redirect from '../../lib/redirect' import dynamic from 'next/dynamic' import type { PageProps, ServerSlug } from '../../types' +import getConfig from 'next/config' +const { publicRuntimeConfig: { BOT_HANDLE } } = getConfig() type AuthLoginState = { humanCode: string, @@ -160,6 +162,16 @@ export default class AuthLogin extends React.Component{ username }#{discrim} + } + + return <>roleypoly#3712 + } + render () { return
@@ -167,7 +179,7 @@ export default class AuthLogin extends React.ComponentSign in with Discord
- Or, send a DM to roleypoly#3712 saying: login + Or, send a DM to {this.dm} saying: login