imaegoo / pushoo

💬 即时消息推送 Node SDK
https://pushoo.js.org
MIT License
115 stars 10 forks source link

discord webhook support #18

Closed funnyzak closed 2 years ago

funnyzak commented 2 years ago
const pushoo = require('pushoo');

function run() {
  pushoo
    .notice('discord', {
      content: 'Hello World' + new Date().getTime(),
      token: '123456789012345678#abcdefghijklmnopqrstuvwxyz',
      options: {
        discord: {
          userName: 'Pushoo',
          avatarUrl: 'https://avatars.githubusercontent.com/u/64772673?v=4',
        },
      },
    })
    .then((rlt) => {
      console.log(`Pushoo notice success: ${rlt}`);
    });
}

function run2() {
  pushoo
    .notice('discord', {
      content: 'Hello World' + new Date().getTime(),
      token: 'https://discord.com/api/webhooks/123456789012345678/abcdefghijklmnopqrstuvwxyz',
    })
    .then((rlt) => {
      console.log(`Pushoo notice success: ${rlt}`);
    });
}

run();