Skip to content

Commit

Permalink
Update to version 0.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
vaverix committed May 15, 2020
1 parent 59bd59c commit 09b9962
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vaverix-twitch-bot",
"description": "Desktop application that allows you to log-in into multiple Twitch.tv channels at once. It also notifies you when someone mentions you in any channel you choose and has couple of other extra features.",
"author": "vaverix",
"version": "0.0.8",
"version": "0.0.9",
"license": "MIT",
"scripts": {
"dev": "electron-webpack dev",
Expand Down
11 changes: 8 additions & 3 deletions src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,16 @@ const getBTTVEmotes = (channel) => {
bttvEmoteCache.data[channel] = []
}
bttvEmoteCache.data[channel].push(n)
bttvEmoteCache.data[channel] = underscore.uniq(
bttvEmoteCache.data[channel],
'code'
)
} else {
bttvEmoteCache.data.global.push(n)
bttvEmoteCache.data.global = underscore.uniq(
bttvEmoteCache.data.global,
'code'
)
}
mainWindow.webContents.send('channel:emotes', bttvEmoteCache)
})
Expand Down Expand Up @@ -484,9 +492,6 @@ ipcMain.on('app:login', (e, data) => {
let searchFor = String(val).toLowerCase().trim()
if (message.toLowerCase().indexOf(searchFor) != -1) notify = true
})
console.log(lookFor)
console.log(message)
console.log(notify)
if (notify) {
mainWindow.webContents.send('channel:notification', msg)
}
Expand Down
97 changes: 95 additions & 2 deletions src/renderer/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
>
<div
:id="'scrollable-' + currentChannel"
@click="showEmotesMenu = false"
@scroll.passive="onScroll"
class="row scrollable with-input"
>
Expand Down Expand Up @@ -171,7 +172,7 @@
/>
<label for="input_message">message...</label>
</div>
<div class="col s2 input-field">
<div class="col s2 input-field flow-root">
<button
@click="sendMessage(currentChannel)"
class="btn-small waves-effect waves-light purple darken-4"
Expand All @@ -182,6 +183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RhPiA8P3hwYWNrZXQgZW5kPSJyIj8+vHZnmgAAAkxJREFUOMu1k02L01AUhs9GxA9EREHc+AtcirhxUOpCf4FLdwqj6EZ07Y9Q0IUDIrgeF65VkKmV6bTNpO00/bBp2twmuWlz8918eG5WThs6M0w9cEgvvHn65j3nQpqm8L9638E0zYeU0nOe54LrujAaDcGaTsHHc7fTBrnfz3TUpECpAZ7ngaZrINZFmKLOcRyYTCYg1GqLcELIZhRFXd/3XqDwtCz3YYrilcDR6ckkSVJecRzPLMvasBm75To2SK2948EtCyMI/MfpXEXRrK4M5Jd/er0zSRKDYRpHh0v1JgjlCti2raQ5NcPC2DYRfENHKJ/L4TNXVRgOFJ7z3XRJ8eiCIBB8339ExuRSeaecQZfCwzAENJc5cl3naxwn6UGF+hTdv0fntxljfOPy4fxTeYdhAD++f4PdWvXEdunXWVEUruyKtbXRUHmga+PXRB19QCNdHPq+P8Kzjc7fVCuVwuJAMTeGHUcR/C6VoNmoX94q/rzakvauNZr16xpR7yP8lUbIJ4TL83CMazQxJxuVncq9BXiv18takiTcHOvL/Mt5hUZSXdPeor7A46SGAbVqdTEWZaiAPJBBJWrhIGgYhNu4ik+08fhCQxSzQeKAwaQ0H95oiiAIVS7Sc13GUYpxvEN3a3w2uLKArqHTbmeruBTOHAZB4K/nbEQHXT7FmVzk62YgmF8i/vvQcBSc+uf6R45jf0TATRch3CWzrOxWUkM/OrzVan3Gp4aiZ4xZ58lYzQA+AvnzWPBices5Or7Dp45w0A1tdfBV918SOwMSMlt3aQAAAABJRU5ErkJggg=="
/></i>
</button>
<button
@click="showEmotesMenu = !showEmotesMenu"
class="btn-small btn-emotes waves-effect waves-light purple darken-4"
type="button"
>
<i class="material-icons">&#128517;</i>
</button>

<div :class="{ open: showEmotesMenu }" class="emotes-menu">
<div
v-if="emotes.data && 'global' in emotes.data"
class="menu-emotes"
>
<p>global</p>
<div class="emotes-list">
<img
v-for="(emote, i) in emotes.data.global"
:key="i"
:src="
'https:' +
String(emotes.urlTemplate)
.replace('{{id}}', emote.id)
.replace('{{image}}', '1x')
"
@click="addToMessage(emote.code)"
class="emote link"
/>
</div>
</div>
<div
v-if="emotes.data && currentChannel in emotes.data"
class="menu-emotes"
>
<p>{{ currentChannel }}</p>
<div class="emotes-list">
<img
v-for="(emote, i) in emotes.data[currentChannel]"
:key="i"
:src="
'https:' +
String(emotes.urlTemplate)
.replace('{{id}}', emote.id)
.replace('{{image}}', '1x')
"
@click="addToMessage(emote.code)"
class="emote link"
/>
</div>
</div>
</div>
</div>
</div>
</div>
Expand Down Expand Up @@ -478,6 +529,7 @@ export default {
__keywords: '',
},
showAdvancedOptions: false,
showEmotesMenu: false,
loggedIn: false,
isConnected: false,
disableLogin: false,
Expand Down Expand Up @@ -538,6 +590,7 @@ export default {
}
},
pickChannel(channel) {
this.showEmotesMenu = false
this.currentChannel = channel
if (this.options && this.options['__streampreview']) {
this.dragStreamPreview()
Expand Down Expand Up @@ -671,6 +724,16 @@ export default {
})
return newMessage
},
addToMessage(text) {
this.input[this.currentChannel] += ` ${text} `
this.$forceUpdate()
try {
this.$el.querySelector('#input_message_' + this.currentChannel).focus()
} catch (e) {
// empty
}
this.showEmotesMenu = false
},
versionClick() {
ipcRenderer.send('dev:openDevTools', {})
},
Expand Down Expand Up @@ -966,7 +1029,7 @@ body,
display: inline-grid;
}
#swipe-notifications .input-field {
display: none;
display: none !important;
}
.relative {
position: relative;
Expand Down Expand Up @@ -1029,6 +1092,36 @@ input,
font-size: 13px;
padding: 0 10px;
}
.btn-emotes {
position: relative;
}
.emotes-menu {
display: none;
position: absolute;
border: 1px solid #313131;
background: #252525;
padding: 0 10px;
top: -253px;
left: -78px;
height: 250px;
overflow-y: auto;
width: 170px;
z-index: 1;
}
.emotes-menu.open {
display: block;
}
.emotes-menu .emote.link {
margin: 1px 2px;
}
.btn-emotes i {
font-size: 13px;
filter: grayscale(1);
}
.flow-root {
display: table !important;
display: flow-root !important;
}
.input-field .prefix.active {
color: #9b6aff;
}
Expand Down

0 comments on commit 09b9962

Please sign in to comment.