forked from Supositware/Haha-Yes
Should not show sticky post
This commit is contained in:
parent
6c67cd5a79
commit
eaa439f68c
1 changed files with 5 additions and 1 deletions
|
@ -40,13 +40,17 @@ class FourchanCommand extends Command {
|
||||||
|
|
||||||
let i = Math.floor((Math.random() * response.threads.length));
|
let i = Math.floor((Math.random() * response.threads.length));
|
||||||
|
|
||||||
|
while(response.threads[i].posts[0].sticky == 1) {
|
||||||
|
i = Math.floor((Math.random() * response.threads.length));
|
||||||
|
}
|
||||||
|
|
||||||
let description = response.threads[i].posts[0].com;
|
let description = response.threads[i].posts[0].com;
|
||||||
|
description = decodeURI(description);
|
||||||
|
|
||||||
let regex = /(<([^>]+)>)/ig;
|
let regex = /(<([^>]+)>)/ig;
|
||||||
if (regex.test(description)) {
|
if (regex.test(description)) {
|
||||||
description = response.threads[i].posts[0].com.replace(/(<([^>]+)>)/ig,'');
|
description = response.threads[i].posts[0].com.replace(/(<([^>]+)>)/ig,'');
|
||||||
}
|
}
|
||||||
description = decodeURI(description);
|
|
||||||
|
|
||||||
const FourchanEmbed = new MessageEmbed()
|
const FourchanEmbed = new MessageEmbed()
|
||||||
.setColor('#ff9900')
|
.setColor('#ff9900')
|
||||||
|
|
Loading…
Reference in a new issue