|
|
|
@ -72,7 +72,13 @@ function handleSettigns(event)
|
|
|
|
|
|
|
|
|
|
function handleClose(element)
|
|
|
|
|
{
|
|
|
|
|
if(element.parentNode.id == 'roleRuleWrapper' || element.parentNode.id == 'FeedWrapper') document.getElementById('popup').classList.remove('hidden');
|
|
|
|
|
if(element.parentNode.id == 'roleRuleWrapper' || element.parentNode.id == 'FeedWrapper')
|
|
|
|
|
{
|
|
|
|
|
document.getElementById('popup').classList.remove('hidden');
|
|
|
|
|
document.getElementById('change').innerText = 'Change';
|
|
|
|
|
document.getElementById('change2').innerText = 'Change';
|
|
|
|
|
}
|
|
|
|
|
if(element.parentNode.id =="FeedWrapper") document.getElementById('ChannelName').classList = '';
|
|
|
|
|
element.parentNode.classList.add('hidden');
|
|
|
|
|
}
|
|
|
|
|
async function requestChange()
|
|
|
|
@ -349,6 +355,7 @@ function addRule(element)
|
|
|
|
|
document.getElementById('emojiID').placeholder = 'Emoji ID'
|
|
|
|
|
document.getElementById('messageID').placeholder = 'Message ID'
|
|
|
|
|
document.getElementById('emojiImg').src = 'images/favicon.ico';
|
|
|
|
|
document.getElementById('change').innerText = 'Add';
|
|
|
|
|
}
|
|
|
|
|
function updateRule(element)
|
|
|
|
|
{
|
|
|
|
@ -437,6 +444,7 @@ function addFeed(element)
|
|
|
|
|
document.getElementById('DCchannelID').placeholder = '';
|
|
|
|
|
document.getElementById('YTchannelID').placeholder = '';
|
|
|
|
|
document.getElementById('CostumMessageI').placeholder = '';
|
|
|
|
|
document.getElementById('change2').innerText = 'Add';
|
|
|
|
|
}
|
|
|
|
|
async function updateFeed(element)
|
|
|
|
|
{
|
|
|
|
@ -449,7 +457,7 @@ async function updateFeed(element)
|
|
|
|
|
document.getElementById('ChannelName').classList ='';
|
|
|
|
|
document.getElementById('ChannelName').classList.add(element.id);
|
|
|
|
|
document.getElementById('DCchannelID').value = feed.ChannelId;
|
|
|
|
|
document.getElementById('YTchannelID').value = feed.YTChannelId;
|
|
|
|
|
document.getElementById('YTchannelID').value = 'https://www.youtube.com/@' + await getChannelName(feed.YTChannelId);
|
|
|
|
|
document.getElementById('CostumMessageI').value = feed.CostumMessage;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -477,13 +485,8 @@ function deleteFeed(element)
|
|
|
|
|
|
|
|
|
|
function _updateFeed(element)
|
|
|
|
|
{
|
|
|
|
|
var isNew=false;
|
|
|
|
|
if(element.parentNode.children[1].innerText == 'New Feed') isNew = true;
|
|
|
|
|
var feedID;
|
|
|
|
|
if(!isNew) feedID = document.getElementById('ChannelName').classList[1];
|
|
|
|
|
console.log('fid', feedID)
|
|
|
|
|
feedID = document.getElementById('ChannelName').classList.value;
|
|
|
|
|
var gid = document.getElementsByClassName('guildname')[0].id;
|
|
|
|
|
console.log('gid', gid)
|
|
|
|
|
var DCchannelID = document.getElementById('DCchannelID').value;
|
|
|
|
|
var YTchannelID = document.getElementById('YTchannelID').value;
|
|
|
|
|
var CostumMessageI = document.getElementById('CostumMessageI').value;
|
|
|
|
@ -491,7 +494,7 @@ function _updateFeed(element)
|
|
|
|
|
{
|
|
|
|
|
method: "POST",
|
|
|
|
|
mode: "cors",
|
|
|
|
|
headers: {DCchannelID, YTchannelID, CostumMessageI, gid,isNew, feedID},
|
|
|
|
|
headers: {DCchannelID, YTchannelID, CostumMessageI, gid, feedID},
|
|
|
|
|
})
|
|
|
|
|
.then(result => result.json())
|
|
|
|
|
.then(res =>
|
|
|
|
|