Skip to content

Commit

Permalink
Merge pull request #2 from CompeyDev/dev
Browse files Browse the repository at this point in the history
✨ Add Streaming and Offline status support
  • Loading branch information
Compey authored Mar 25, 2022
2 parents ced1aed + b0dd241 commit b1f15d6
Show file tree
Hide file tree
Showing 2 changed files with 119 additions and 4 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ This action fetches the status of a given user and updates that on a file.
<img src="https://cdn.devcomp.tk/twemoji-13.1.0/assets/svg/1f7e1.svg" width="17"></img> - **Idle**
<br>
<img src="https://cdn.devcomp.tk/twemoji-13.1.0/assets/svg/1f534.svg" width="17"></img> - **Do not disturb**
<br>
<img src="https://cdn.devcomp.tk/twemoji-13.1.0/assets/svg/1f7e3.svg" width="17"></img> - **Streaming**
<br>
<img src="https://cdn.devcomp.tk/twemoji-13.1.0/assets/svg/26aa.svg" width="17"></img> - **Offline**





## Inputs

Expand Down
115 changes: 111 additions & 4 deletions update.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,16 @@ try {
}

console.log(`${stdout}`);
});
});
exec(`sed -i "s/🟣/🟢/g" ${file}`, (err, stdout, stderr) => {
if (err) {
console.error(`exec error: ${err}`);
throw new Error("Command failed.");
return;
}

console.log(`${stdout}`);
});
}

if (status == 'dnd') {
Expand Down Expand Up @@ -69,7 +78,16 @@ try {
}

console.log(`${stdout}`);
});
});
exec(`sed -i "s/🟣/🔴/g" ${file}`, (err, stdout, stderr) => {
if (err) {
console.error(`exec error: ${err}`);
throw new Error("Command failed.");
return;
}

console.log(`${stdout}`);
});
}

if (status == 'idle') {
Expand Down Expand Up @@ -100,8 +118,97 @@ try {
}

console.log(`${stdout}`);
});
}
});
exec(`sed -i "s/🟣/🟡/g" ${file}`, (err, stdout, stderr) => {
if (err) {
console.error(`exec error: ${err}`);
throw new Error("Command failed.");
return;
}

console.log(`${stdout}`);
});
}

if (status == 'offline') {
exec(`sed -i "s/🟢/⚪/g" ${file}`, (err, stdout, stderr) => {
if (err) {
console.error(`exec error: ${err}`);
throw new Error("Command failed.");
return;
}

console.log(`${stdout}`);
});

exec(`sed -i "s/🔴/⚪/g" ${file}`, (err, stdout, stderr) => {
if (err) {
console.error(`exec error: ${err}`);
throw new Error("Command failed.");
return;
}

console.log(`${stdout}`);
});
exec(`sed -i "s/🟡/⚪/g" ${file}`, (err, stdout, stderr) => {
if (err) {
console.error(`exec error: ${err}`);
throw new Error("Command failed.");
return;
}

console.log(`${stdout}`);
});
exec(`sed -i "s/🟣/⚪/g" ${file}`, (err, stdout, stderr) => {
if (err) {
console.error(`exec error: ${err}`);
throw new Error("Command failed.");
return;
}

console.log(`${stdout}`);
});
}

if (status == 'streaming') {
exec(`sed -i "s/🟢/🟣/g" ${file}`, (err, stdout, stderr) => {
if (err) {
console.error(`exec error: ${err}`);
throw new Error("Command failed.");
return;
}

console.log(`${stdout}`);
});

exec(`sed -i "s/🔴/🟣/g" ${file}`, (err, stdout, stderr) => {
if (err) {
console.error(`exec error: ${err}`);
throw new Error("Command failed.");
return;
}

console.log(`${stdout}`);
});
exec(`sed -i "s/🟡/🟣/g" ${file}`, (err, stdout, stderr) => {
if (err) {
console.error(`exec error: ${err}`);
throw new Error("Command failed.");
return;
}

console.log(`${stdout}`);
});
exec(`sed -i "s/⚪/🟣/g" ${file}`, (err, stdout, stderr) => {
if (err) {
console.error(`exec error: ${err}`);
throw new Error("Command failed.");
return;
}

console.log(`${stdout}`);
});
}
});
}

Expand Down

0 comments on commit b1f15d6

Please sign in to comment.