imaegoo / pushoo

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

discord webhook support #18

Closed funnyzak closed 1 year ago

funnyzak commented 1 year 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();