diff --git a/public/discord.svg b/public/discord.svg deleted file mode 100644 index c4cfed9..0000000 --- a/public/discord.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/public/discord_logo.png b/public/discord_logo.png deleted file mode 100644 index 74e55fd..0000000 Binary files a/public/discord_logo.png and /dev/null differ diff --git a/public/gift.svg b/public/gift.svg deleted file mode 100644 index 1ab8298..0000000 --- a/public/gift.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/music.svg b/public/music.svg deleted file mode 100644 index f13b3b8..0000000 --- a/public/music.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/poll.svg b/public/poll.svg deleted file mode 100644 index 3c572cb..0000000 --- a/public/poll.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/App.js b/src/App.js index 83dbcee..62abdb3 100644 --- a/src/App.js +++ b/src/App.js @@ -24,7 +24,7 @@ import { Button } from "@material-ui/core"; import A from "./components/Shared/A"; import useSnapshot from "./hooks/useSnapshot"; import LeaderBoard from "./components/LeaderBoard/LeaderBoard"; -import { v4 as uuidv4 } from "uuid"; +import { v4 as uuidv4 } from 'uuid'; function App(props) { const [userId, setUserId] = useState(""); @@ -57,8 +57,8 @@ function App(props) { (async () => { if (setOTC.current) return; if (firebaseInit !== false && user?.uid) { - await firebase.db.collection("Secret").doc(user.uid).set({ value: uuidv4() }); - setOTC.current = true; + await firebase.db.collection("Secret").doc(user.uid).set({value: uuidv4()}); + setOTC.current = true } })(); }, [firebaseInit, user, setOTC]); @@ -80,30 +80,24 @@ function App(props) { } else { try { console.log(code); - const isSignedIn = !!firebase.auth.currentUser; - const response = await fetch(`${process.env.REACT_APP_API_URL}/discord/token?code=${code}&create=${!isSignedIn}`); + const response = await fetch(`${process.env.REACT_APP_API_URL}/discord/token?code=${code}`); // const response = await fetch("http://localhost:3200/discord/token?code="+code) if (!response.ok) { console.log(await response.json()); - alert("fail"); + console.log("fail"); } else { console.log(user?.uid); const json = await response.json(); - let discordUser; - if (!isSignedIn) { - discordUser = await firebase.auth.signInWithCustomToken(json.token); - } - await firebase.db .collection("Streamers") - .doc(user?.uid || discordUser?.uid || " ") + .doc(user?.uid || " ") .collection("discord") .doc("data") .set(json); - alert("success"); + console.log("success"); } } catch (err) { - alert(err.message); + console.log(err.message); } } window.location = "/#/dashboard/discord"; @@ -116,14 +110,7 @@ function App(props) { if (firebaseInit !== false && user) { setUserId(user.uid); const userData = (await firebase.db.collection("Streamers").doc(user.uid).get()).data(); - let profilePictureResponse; - if (!userData.twitchAuthenticated) { - profilePictureResponse = await fetch( - `${process.env.REACT_APP_API_URL}/profilepicture?user=${userData?.discordId}&platform=discord` - ); - } else { - profilePictureResponse = await fetch(`${process.env.REACT_APP_API_URL}/profilepicture?user=${userData?.TwitchName}`); - } + const profilePictureResponse = await fetch(`${process.env.REACT_APP_API_URL}/profilepicture?user=${userData?.TwitchName}`); const profilePicture = await profilePictureResponse.json(); firebase.db.collection("Streamers").doc(user.uid).update({ profilePicture, diff --git a/src/components/DashBoard/Discord/DiscordPage.js b/src/components/DashBoard/Discord/DiscordPage.js index aac5bd7..2a9da3e 100644 --- a/src/components/DashBoard/Discord/DiscordPage.js +++ b/src/components/DashBoard/Discord/DiscordPage.js @@ -177,22 +177,19 @@ const DiscordPage = React.memo(({ location, history, match }) => { async e => { const name = e.value; const guildByName = userDiscordInfo.guilds.find(guild => guild.name === name); - const selectedGuildId = guildByName.id; - try{ - - if (guildId) { - const path = match.url.split("/"); - if (path.length > 3) { - history.push(`${path.slice(0, 3).join("/")}/${selectedGuildId}`); - } else { - history.push(`${selectedGuildId}`); - } - } else { - history.push(`${match.url}/${selectedGuildId}`); - } - }catch(err){ - - } + const selectedGuildId = guildByName.id; + try { + if (guildId) { + const path = match.url.split("/"); + if (path.length > 3) { + history.push(`${path.slice(0, 3).join("/")}/${selectedGuildId}`); + } else { + history.push(`${selectedGuildId}`); + } + } else { + history.push(`${match.url}/${selectedGuildId}`); + } + } catch (err) {} const { result: isMember } = await sendLoadingRequest(`${process.env.REACT_APP_API_URL}/ismember?guild=` + selectedGuildId); // const channelReponse = await sendLoadingRequest(`${process.env.REACT_APP_API_URL}/getchannels?guild=` + selectedGuildId); diff --git a/src/components/DashBoard/Discord/Plugins/CustomCommands/CommandItem.js b/src/components/DashBoard/Discord/Plugins/CustomCommands/CommandItem.js index 6c07e0f..15b8460 100644 --- a/src/components/DashBoard/Discord/Plugins/CustomCommands/CommandItem.js +++ b/src/components/DashBoard/Discord/Plugins/CustomCommands/CommandItem.js @@ -115,7 +115,7 @@ const CommandItem = ({
- +

{name}

diff --git a/src/components/DashBoard/Discord/Plugins/CustomCommands/CreateCommand.js b/src/components/DashBoard/Discord/Plugins/CustomCommands/CreateCommand.js index b3936ea..be59ce2 100644 --- a/src/components/DashBoard/Discord/Plugins/CustomCommands/CreateCommand.js +++ b/src/components/DashBoard/Discord/Plugins/CustomCommands/CreateCommand.js @@ -89,7 +89,7 @@ const CreateCommand = ({ setCreatingCommand, children, role, guild: userConnecte })) ); } - }, [editing, userConnectedGuildInfo?.roles, setAllowedRoles]); + }, [editing]); return ( diff --git a/src/components/DashBoard/Discord/Plugins/PluginHome.js b/src/components/DashBoard/Discord/Plugins/PluginHome.js index dd6cc08..a4824f5 100644 --- a/src/components/DashBoard/Discord/Plugins/PluginHome.js +++ b/src/components/DashBoard/Discord/Plugins/PluginHome.js @@ -10,7 +10,6 @@ import plugins from "./plugins.json"; import CustomCommands from "./CustomCommands/CustomCommands"; import { CommandContextProvider } from "../../../../contexts/CommandContext"; import App from "./App"; -import Roles from "./Roles"; const PluginHome = ({ match, guildId, connectedGuild }) => { const [prefix, setPrefix] = useState("!"); @@ -113,13 +112,6 @@ const PluginHome = ({ match, guildId, connectedGuild }) => { )} - {activePlugins["roles"] && ( - - - - - - )} diff --git a/src/components/DashBoard/Discord/Plugins/Roles.js b/src/components/DashBoard/Discord/Plugins/Roles.js deleted file mode 100644 index 6c29be4..0000000 --- a/src/components/DashBoard/Discord/Plugins/Roles.js +++ /dev/null @@ -1,67 +0,0 @@ -import React, { useEffect, useState, useCallback, useContext } from "react"; -import firebase from "../../../../firebase"; -import { colorStyles } from "../../../Shared/userUtils"; -import { DiscordContext } from "../../../../contexts/DiscordContext"; -import Select from "react-select"; - -const Leveling = ({ location, guild: userConnectedGuildInfo }) => { - const { setActivePlugins } = useContext(DiscordContext); - const guildId = userConnectedGuildInfo?.id; - - useEffect(() => { - (async () => { - const guild = await firebase.db - .collection("Leveling") - .doc(guildId || " ") - .get(); - const data = guild.data(); - if (data) { - const id = data.notifications; - if (id) { - const apiUrl = `${process.env.REACT_APP_API_URL}/resolvechannel?guild=${guildId}&channel=${id}`; - const response = await fetch(apiUrl); - const channel = await response.json(); - } - } - })(); - }, [location, guildId]); - - return ( -
-
- - -

Role Management

-
- - - -
-
-
-

Different ways to have the bot manage user roles. Give a role on join, toggle roles with reactions, etc.

-
-
-

Add an action

-
-
-
- ); -}; - -export default React.memo(Leveling); diff --git a/src/components/DashBoard/Discord/Plugins/plugins.json b/src/components/DashBoard/Discord/Plugins/plugins.json index 53d7deb..77220c6 100644 --- a/src/components/DashBoard/Discord/Plugins/plugins.json +++ b/src/components/DashBoard/Discord/Plugins/plugins.json @@ -42,30 +42,10 @@ "comingSoon": true }, { - "id": "roles", - "title": "Role Management", + "id": "reactionroles", + "title": "Reaction Roles", "image": "aprove.png", - "description": "Let the bot manage members roles in different ways like reaction roles", - "comingSoon": true - }, - { - "id": "music", - "title": "Music", - "image": "music.svg", - "description": "Let your members get roles by reacting to messages", - "comingSoon": true - },{ - "id": "polls", - "title": "Polls", - "image": "poll.svg", - "description": "Let your members get roles by reacting to messages", - "comingSoon": true - },{ - "id": "giveaways", - "title": "Giveaways", - "image": "gift.svg", "description": "Let your members get roles by reacting to messages", "comingSoon": true - } ] diff --git a/src/components/header/Header.js b/src/components/header/Header.js index d6bed26..444053e 100644 --- a/src/components/header/Header.js +++ b/src/components/header/Header.js @@ -6,6 +6,7 @@ import { CSSTransition } from "react-transition-group"; import ClickAwayListener from "@material-ui/core/ClickAwayListener"; import { useCallback } from "react"; import Modal from "react-modal"; +import YouTubeIcon from "@material-ui/icons/YouTube"; import A from "../Shared/A"; import ClearIcon from "@material-ui/icons/Clear"; import firebase from "../../firebase"; @@ -37,7 +38,7 @@ const Header = props => { if (data) { const { displayName, profilePicture } = data; setCurrentUser(prev => ({ - ...prev, + ...prev, name: displayName, profilePicture, })); @@ -132,26 +133,10 @@ const Header = props => { Twitch - + {/* */}
{ Chat Manager Discord Bot Community - - Support Us - + Support Us {/* About */} diff --git a/src/components/header/Header.scss b/src/components/header/Header.scss index 4b523ad..5f4f6f5 100644 --- a/src/components/header/Header.scss +++ b/src/components/header/Header.scss @@ -198,7 +198,7 @@ justify-content: center; align-items: center; - & > button[type="submit"]{ + & > button:first-child{ all: unset; box-sizing: content-box !important; width: 100%; @@ -242,9 +242,6 @@ width: 70%; flex: 1; box-sizing: content-box !important; - &.discord{ - background: #6f86d4; - } cursor: pointer; &:hover { filter: brightness(0.85);