finalized automated build for web
This commit is contained in:
@@ -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">
|
||||
|
||||
@@ -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')
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user