clientSideMethod() { this.setState({ selectedColor: colors.random(), }); }
const randomSuccessResponse = (username) => { let responses = [ `Yay, video! Your download link's at {link}. You can bookmark this link and check it whenever you make a new download request. Got questions? See ${process.env.EXTERNAL_URL}/p/faq. 🤗`, `Hey, hey, here's your download link: {link}. I may not always reply to you, so check that link whenever you make a new download request. Check out ${process.env.EXTERNAL_URL}/p/faq if you've got any questions.🤗`, `All done, boss! Your download link: {link}. Psst...your new downloads will always be there, even when I don't reply. See ${process.env.EXTERNAL_URL}/p/faq if you've got any questions.👍`, `You're all set! Your new video's at {link}. PS: you can bookmark that link and check it in future whenever you mention me. See you around.🤗`, `I've got you, boss. Your download's at {link}.\n\nPsst...you're awesome!🤗`, `All good, my friend! One new download for you at {link}. Enjoy your day!😁`, ]; let response = responses.random(); return response.replace('{link}', `http://${process.env.EXTERNAL_URL}/${username}`); }
/** * Resolve a user from a user resolvable and returns an extended user * Note that if the user is not found, only username, discriminator and tag are guaranteed (set to unknown) * @param {Client} client - The client instance * @param {User | String | Number} userResolvable - A user resolvable, can be an ID, a username#discriminator pattern or a user object * @returns {ExtendedUser} returns an extended user object */ resolveUser(client, userResolvable) { const defaultUser = { username: 'Unknown', discriminator: 'Unknown' }; // @ts-ignore if (!isNaN(userResolvable)) { const user = client.bot.users.get(userResolvable); return new client.structures.ExtendedUser(user ? user : defaultUser, this.client); } else if (typeof userResolvable === 'string') { const spliced = userResolvable.split('#'); const user = client.bot.users.filter(u => u.username === spliced[0] && u.discriminator === spliced[1]).random(); return new client.structures.ExtendedUser(user ? user : defaultUser, this.client); } else if (typeof userResolvable === 'object') { return new client.structures.ExtendedUser(userResolvable, this.client); } }
async run(message, args, level, settings, texts) { // eslint-disable-line no-unused-vars const numbers = [ ":one:", ":two:", ":three:", ":four:", ":five:", ":six:" ]; try { const roll = numbers.random(); const msg = await message.channel.send(`${texts.cmd.fun.rolling} 🎲`); msg.edit(texts.cmd.fun.rolled.replace(/{{result}}/g, roll)); } catch (error) { return message.channel.send(texts.general.error.replace(/{{err}}/g, error.message)); } }
async run(message, args, level, settings, texts) { // eslint-disable-line no-unused-vars const voiceChannel = message.member.voiceChannel; if (!voiceChannel) return message.channel.send("You must be in a voice channel to be able to play VAPORWAVE MUSIC 可益ビ."); const permissions = voiceChannel.permissionsFor(message.client.user); if (!permissions.has("CONNECT")) return message.channel.send("I cannot play any music, as I do not have the \"CONNECT\" permission."); if (!permissions.has("SPEAK")) return message.channel.send("I cannot play any music, as I do not have the \"SPEAK\" permission."); if (args[0] && args[0].toLowerCase() === "stop") { if (!voiceChannel) return message.channel.send("You must be in a VOICE CHANNEL to use this command."); voiceChannel.leave(); return message.channel.send("STOPPED"); } try { const connection = await voiceChannel.join(); // eslint-disable-line no-unused-vars } catch (error) { this.client.logger.error(`Couldn't join voice channel: ${error}`); return message.channel.send(texts.general.error.replace(/{{err}}/g, error.message)); } const connection = await voiceChannel.join(); const dispatcher = connection.playFile(songs.random()) .on("end", () => voiceChannel.leave()) .on("error", error => this.client.logger.error(error)); dispatcher.setVolumeLogarithmic(5 / 5); }
const randomOutcome = outcomes.random(); try { if (randomOutcome.startsWith("http://i.imgur.com/")) {
changeColor() { this.setState({ selectedColor: colors.random(), }); }