Skip to content

Commit

Permalink
Postmeme fix ig
Browse files Browse the repository at this point in the history
  • Loading branch information
kyan0045 authored May 19, 2023
1 parent 03f68e4 commit dddab91
Showing 1 changed file with 20 additions and 52 deletions.
72 changes: 20 additions & 52 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1489,60 +1489,28 @@ async function playFGame(message, channel) {
}

async function postMeme(message) {
let PlatformMenu = message.components[0].components[0]
const MemeTypeMenu = message.components[1].components[0]

// options
const Platforms = PlatformMenu.options.map((opt) => opt.value);
const MemeTypes = MemeTypeMenu.options.map((opt) => opt.value);

// selected option
const Platform = Platforms[Math.floor(Math.random() * Platforms.length)]
const MemeType = MemeTypes[Math.floor(Math.random() * MemeTypes.length)]

// default option
/*const defaultOption = PlatformMenu.options.find(opt => opt.default === true);
const defaultLabel = defaultOption ? defaultOption.label : '';
if (!defaultLabel) {
setTimeout(
async () => {
await message.selectMenu(0, [`${Platform}`])
setTimeout(
async () => {
await message.selectMenu(1, [`${MemeType}`])
},
randomInteger(100,
300))
},
randomInteger(config.cooldowns.buttonClick.minDelay,
config.cooldowns.buttonClick.maxDelay)
)
}*/
setTimeout(
async () => {
await message.selectMenu(0, [`${Platform}`])
setTimeout(
async () => {
await message.selectMenu(1, [`${MemeType}`])

setTimeout(
async () => {
await message.clickButton(message?.components[2]?.components[0])
},
randomInteger(config.cooldowns.buttonClick.minDelay,
config.cooldowns.buttonClick.maxDelay)
)
const PlatformMenu = message.components[0].components[0];
const MemeTypeMenu = message.components[1].components[0];

},
randomInteger(100,
300))
// options
const Platforms = PlatformMenu.options.map((opt) => opt.value);
const MemeTypes = MemeTypeMenu.options.map((opt) => opt.value);

},
randomInteger(config.cooldowns.buttonClick.minDelay,
config.cooldowns.buttonClick.maxDelay)
)
// selected option
const Platform = Platforms[Math.floor(Math.random() * Platforms.length)];
const MemeType = MemeTypes[Math.floor(Math.random() * MemeTypes.length)];



await wait(randomInt(config.cooldowns.buttonClick.minDelay * 2, config.cooldowns.buttonClick.maxDelay * 2))
await message?.selectMenu(PlatformMenu, [Platform]);

await wait(randomInt(config.cooldowns.buttonClick.minDelay, config.cooldowns.buttonClick.maxDelay * 2))
await message?.selectMenu(MemeTypeMenu, [MemeType]);

await wait(randomInt(config.cooldowns.buttonClick.minDelay, config.cooldowns.buttonClick.maxDelay * 2))

await clickButton(message, message.components[2]?.components[0]);
}


Expand Down

0 comments on commit dddab91

Please sign in to comment.