finalized automated build for web

This commit is contained in:
2020-08-09 14:43:33 +09:00
parent 94a9d18c02
commit 56b3448138
19 changed files with 83 additions and 35 deletions

View File

@@ -1,8 +1,25 @@
import React from 'react';
import logo from './logo.svg';
import './App.css';
function App() {
import RPC from 'discord-rpc';
function App(): JSX.Element {
let client: any = null;
const clientId = '207646673902501888';
const scopes = ['rpc', 'rpc.api', 'messages.read'];
if (client === null) {
client = new RPC.Client({ transport: 'websocket' });
if (client) {
client.on('ready', () => {
if (client) {
console.log('Logged in as', client.application.name);
console.log('Authed for user', client.user.username);
client.selectVoiceChannel('740735736361517137');
}
});
// Log in to RPC with client id
client.login({ clientId, scopes });
}
}
return (
<div className="App">
<header className="App-header">

View File

@@ -5,9 +5,11 @@ import App from './App';
import * as serviceWorker from './serviceWorker';
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
(
<React.StrictMode>
<App />
</React.StrictMode>
),
document.getElementById('root')
);