How to use giphy-api - 2 common examples

To help you get started, we’ve selected a few giphy-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github codigofalado / twitch-giphy / src / index.ts View on Github external
async function main() {
  try {
    // Inicia o servidor
    const Server = server();

    // Inicializa a API da Twitch e do Giphy
    const { channels, token, username } = config.twitch;
    const { token: giphy_token, rating } = config.giphy;
    const { chat } = new twitch({ token, username });
    const gif = giphy(giphy_token);

    // Conecta na Twitch e aos entra nos chats configurados
    await chat.connect();
    await Promise.all(channels.map(ch => chat.join(ch)));

    // Escutar todas as mensagem privadas
    chat.on('PRIVMSG', async payload => {
      const {
        tags: { color },
        username,
        message,
        channel,
      } = payload;

      // Caso o usuário não tem uma cor definida, ele irá gerar uma cor
      const user_color = color === true ? GenerateColor() : color;
github revolunet / react-twiml / examples / GiphyGame.js View on Github external
return new Promise((resolve, reject) => {
    if (state) {
      return resolve(state)
    }
    let word = getRandomWord()
    return resolve(giphy().search(word).then(res => ({
      word,
      url: res.data[0].images.fixed_height.url,
      tries: -1
    })))
  })
}

giphy-api

JavaScript module for the giphy.com API that supports promises and callbacks.

MIT
Latest version published 3 years ago

Package Health Score

51 / 100
Full package analysis

Popular giphy-api functions