项目作者: wvovaw

项目描述 :
Discord.js bot for anonymous communication
高级语言: JavaScript
项目地址: git://github.com/wvovaw/anonimalus.git
创建时间: 2020-09-05T17:04:28Z
项目社区:https://github.com/wvovaw/anonimalus

开源协议:MIT License

下载



Anonimalus


The Anonimalus
















Description

Send anonymous messages to channels on servers where this bot is available.
Also you can send anonymous messages directly to users who has at least one common server with this bot.

Commands

Command Syntax Description
dm !dm user_id message Send a message to user
send !send channel_id message Send a message to guild channel
howto !howto Show how to copy ids
help !help Show a short resume of bots features

It is also possible to send messages from this site page.

Project structure

  • Main codebase /*
    • Bot /lib/commands/*, /lib/EventHandler.js
    • Api /lib/api/*
  • Website /www

Both of them has their own node_modules

Quick start

Clone and install dependencies

  1. git clone https://github.com/wvovaw/anonimalus.git
  2. cd anonimalus
  3. npm install

Register new discord app

  1. Go to devportal
  2. Create new app, go to bot section
  3. Copy a secret token
  4. Make sure SERVER MEMBERS INTENT option is enabled
  5. Save

Authentication

Create .env file and set DISCORD_TOKEN variable in there.

  1. echo DISCORD_TOKEN="YourTokenGoesHere" > .env

Run bot

  1. npm start

This setup runs localy on your machine, or on VDS/VPS

Deploying on Heroku

  1. Fork this repo
  2. Sign up on Heroku
  3. Connect your github
  4. Create new dino from your github repo
  5. Add DISCORD_TOKEN in variables (how to)
  6. Sign up here and create a cron job that will ping your app every 15-30 minutes to keep your app alive

Website

Developing

Go to /www directory and run

  1. gridsome develop

It will run developing server with hot reload

Build and deploy

Compile the static website to /dist directory

  1. npm run web-build

Before you perform deploying, add your repository as origin

  1. git add origin https://github.com/yourname/reponame

Push the /dist dir to the remote on gh-pages branch. The site will be avaliable at https://*yourname*.github.io/anonimalus

  1. npm run web-deploy

If you want to use the website to send messages

Make sure the last 2 lines is not commented out in app.js

  1. const { start } = require('./lib/api/server');
  2. start(eventHandler);

Change the url of POST request in Anonimalus\www\src\components\Form.vue

  1. axios({
  2. method: 'post',
  3. url: 'https://yourappname.herokuapp.com/send',
  4. data: d
  5. })
  6. ...