Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dodana emotka peepoLove #22

Merged
merged 7 commits into from
Oct 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,20 @@ import * as _ from 'lodash';

import './styles/styles.scss';

function GETRequest(url) // https://stackoverflow.com/questions/247483/http-get-request-in-javascript
{
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", url, false);
xmlHttp.send(null);
return xmlHttp.responseText;
}

function App() {
const [koders, setKoder] = useState({});
let users = {};

var response = GETRequest("https://api.frankerfacez.com/v1/badge/bot");
var bots = JSON.parse(response)['users']['2']; // bots names from ffz api
useEffect(() => {
const client = new tmi.Client({
options: { debug: true },
Expand All @@ -26,6 +37,8 @@ function App() {
users[tags.username] = {...users[tags.username], 'msg': message};
setKoder({...users});
} else {
if (Object.values(bots).includes(tags.username))
return;
users = {...users, [tags.username]: {'msg': message, 'channel': tags}};
setKoder({...users});
}
Expand All @@ -49,4 +62,4 @@ function App() {
);
}

export default App;
export default App;
Binary file added src/assets/images/emotes/HACKERMANS.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 7 additions & 2 deletions src/utils/emotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import petthepeepo from '../assets/images/emotes/petthepeepo.gif';
import coffee from '../assets/images/emotes/coffee.gif'
import kekw from '../assets/images/emotes/KEKW.png';
import feelsokayman from '../assets/images/emotes/FeelsOkayMan.png';
import babyodasip from '../assets/images/emotes/BabyYodaSip.gif'
import babyyodasip from '../assets/images/emotes/BabyYodaSip.gif'
import hackermans from '../assets/images/emotes/HACKERMANS.gif'

export const emotes = (emoji) => {
switch (emoji) {
Expand Down Expand Up @@ -41,7 +42,7 @@ export const emotes = (emoji) => {
return {
status: true, 'emoji': 'https://static-cdn.jtvnw.net/emoticons/v2/9/default/light/3.0'
};
case ':d':
case 'pepelaugh':
return {
status: true, 'emoji': pepelaugh
};
Expand Down Expand Up @@ -69,6 +70,10 @@ export const emotes = (emoji) => {
return {
status: true, 'emoji': 'https://static-cdn.jtvnw.net/emoticons/v2/303571809/default/light/3.0'
};
case 'hackermans':
return {
status: true, 'emoji': hackermans
}
default:
return {
status: false
Expand Down