Giter VIP home page Giter VIP logo

wdr's Introduction

Webhook Data Receiver

alt text The contents of this repo are a proof of concept and are for educational use only, all copyrights belong to their respective owners.alt text

This bot requires intermediate knowledge of discord and bots. You will need a minimun of TWO bot tokens, one for channels and one for subscriptions. This is not for a beginner user. You will not receive beginner level support for this.

As of Release 2.0 you will need to run the sub migration script. /static/dbMigrate.js.example. Add db info, and rename to .js

Installation:

1: git clone https://github.com/PartTimeJS/WDR.git to desired location or download the zip and unzip.

2: cd to the new WDR folder

3: Type node -v in your terminal to determine if node is installed on your machine.

  • If not or version is less than 12, update or download node.js from here: https://nodejs.org/en/
  • Type node -v again in your terminal post install to confirm installation.

4: Install npm package requirements.

  • Run npm install in your cloned directory.

5: Edit the Config files and save them without the .example on them.

Discords in configs/discords

- You need to add a file each Discord you plan on serving. WebhookDataReceiver is multi-discord capable. The geofence should encompass the whole area that the discord covers. Must be in geojson format.

Geofences in configs/geofences

- Add geofences for each city/discord.

Embeds in configs/geofences

- Copy each embed exmaple and rename without .ex
- Make any changes you want with the variable key.

Filters in configs/filters

- Copy each embed example and rename without .ex
- Make any changes you want or create your own. Must name the filter in your channels.

Subscription Presets in configs/sub_presets

- These are presets users can select instead of manually creating a subscription.
- Follow the example files.

6: Channels

  • Within the configs folder, you will have folders for each type of feed channel. Create files identical to the examples.

7: Filters

In /filters you will find examples of spawns, quest, and raid feeds. These files can be named whatever you want, there is no more name requirement. These are spawn filters based on PA type, also with a min_iv and max_iv override.

Quests

  • Quest feeds can be filtered by reward and/or encounter. Add each reward our encounter to the "Rewards" array.
  • They are case sensitive, so please see examples. Refer to /static/en.json for all rewards.

Raids

  • Raids can be filtered by type, levels, and ex eligibility.
  • If you DO NOT want to filter by Ex Eligibility, REMOVE the "Ex_Eligible" field completely from the filter.
  • You can add as many or as few levels to the filter as you with 1-5 as the examples show.
  • The "Egg_Or_Boss" field must be set to either "boss" or "egg".

Spawns

  • This WebhookDataReceiver uses PA type filters with some overrides in the config.
  • The "Type" field must be "monster".
  • You must set the min_iv and max_iv for the filter. Defaults 0 and 100.
  • You must set the min_level and max_level for the filter. Defaults 0 and 35.
  • More specific IVs can be set for each monster (replace True/False with {"min_iv":"80"}), but that value must be within the min_iv and max_iv you set.
  • You can set the bot to post without IVs using the "Post_Without_IV" field. Set this to true or false.

8: Start the bot. pm2 start wdr.js --name WDR

Subscriptions

  • Subscription commands can only be used in the command channel set in the discords.json.
  • Type .help (or whatever prefix you set) for command instructions.
  • Rewards that users can subscribe to are set in quest_config.json in the configs folder. These are case sensitive and the Encounter rewards must state "Encounter" after the monster name just as the example shows.

wdr's People

Contributors

astu04 avatar chuckleslove avatar corbindk avatar darthbutcher avatar davispogo avatar dependabot[bot] avatar lokixx avatar parttimejs avatar sabregreen avatar tallypokemap avatar valleypogo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

wdr's Issues

Invalid Embed filename (raid_eggs.js)

FILE: WDR/src/feeds/raid.js
LINE: 59
OLD CODE: Embed_Config = require(WDR.Dir + '/configs/embeds/raid_eggs.js');
NEW CODE: Embed_Config = require(WDR.Dir + '/configs/embeds/raid_egg.js');

FILE: WDR/src/subscriptions/raid.js
LINE: 119
OLD CODE: Embed_Config = require(WDR.Dir + '/configs/embeds/raid_eggs.js');
NEW CODE: Embed_Config = require(WDR.Dir + '/configs/embeds/raid_egg.js');

Multiple subscription collectors running at the same time

The easiest way to describe this issue is with an example:
Lets say I enter .pokemon and then view
Then .raid and add
At this point, I get prompts for adding both a pokemon and raid subscription.

My assumption would be that by entering .raid, the .pokemon series of prompts would end and the .raid series of prompts would begin. Instead they both seem to be operating simultaneously. This happens with all the subscription commands (not just raid and pokemon) and you can get more than two collectors going at once. Please let me know if this is not clear enough of a description of the problem.

Here are the two different errors that pop up in the log:
0|WDR | DiscordAPIError: Unknown Message 0|WDR | at RequestHandler.execute (/home/cvm/WDR/node_modules/discord.js/src/rest/RequestHandler.js:170:25) 0|WDR | at runMicrotasks (<anonymous>) 0|WDR | at processTicksAndRejections (internal/process/task_queues.js:93:5) { 0|WDR | method: 'delete', 0|WDR | path: '/channels/XXXXXXXXXXXX/messages/XXXXXXXXXXX', 0|WDR | code: 10008, 0|WDR | httpStatus: 404

0|WDR | TypeError: Cannot read property 'channel' of null 0|WDR | at /home/cvm/WDR/src/commands/subscription/raid/collect_match.js:8:35 0|WDR | at new Promise (<anonymous>) 0|WDR | at Object.module.exports [as MatchCollect] (/home/cvm/WDR/src/commands/subscription/raid/collect_match.js:3:12) 0|WDR | at Query.onResult (/home/cvm/WDR/src/commands/subscription/raid/create.js:78:55) 0|WDR | at runMicrotasks (<anonymous>) 0|WDR | at processTicksAndRejections (internal/process/task_queues.js:93:5)

UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'get' of undefined

Latest master and when I now reload it gives me this;

0|wdr  | 2020-05-06T01:26:50:     at DiscordEmojis.LoadEmojis [as Load] (/root/bots/wdr_wip/modules/base/emojis.js:179:38)
0|wdr  | 2020-05-06T01:26:50:     at Client.MAIN.on (/root/bots/wdr_wip/modules/base/bot.js:600:15)
0|wdr  | 2020-05-06T01:26:50:     at Client.emit (events.js:198:15)
0|wdr  | 2020-05-06T01:26:50:     at WebSocketConnection.triggerReady (/root/bots/wdr_wip/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:125:17)
0|wdr  | 2020-05-06T01:26:50:     at WebSocketConnection.checkIfReady (/root/bots/wdr_wip/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:141:61)
0|wdr  | 2020-05-06T01:26:50:     at GuildCreateHandler.handle (/root/bots/wdr_wip/node_modules/discord.js/src/client/websocket/packets/handlers/GuildCreate.js:13:31)
0|wdr  | 2020-05-06T01:26:50:     at WebSocketPacketManager.handle (/root/bots/wdr_wip/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:105:65)
0|wdr  | 2020-05-06T01:26:50:     at WebSocketConnection.onPacket (/root/bots/wdr_wip/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)
0|wdr  | 2020-05-06T01:26:50:     at WebSocketConnection.onMessage (/root/bots/wdr_wip/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17)
0|wdr  | 2020-05-06T01:26:50:     at WebSocket.onMessage (/root/bots/wdr_wip/node_modules/ws/lib/event-target.js:120:16)
0|wdr  | 2020-05-06T01:26:50: (node:31626) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
0|wdr  | 2020-05-06T01:26:50: (node:31626) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

modules/base/emojis.js:179:38:
let guild = bot.guilds.cache.get(guildArray[i][0]);

It was running fine before this, I pulled a couple of days ago.
Is there another emoji server, or is it something else I need to do?

Support SwiftTileserverCache 2.0

  • /static route is deprecated in SwiftTileserverCache version 1 and removed in version 2
  • use /staticmap instead

Using Templates:

  • Check SwiftTileserverCache beta (vapor branch) readme for Templating info

Using Pregenerate:

  • Post to /staticmap?pregenerate=true&regeneratable=true
  • Use URL im embed: /staticmap/pregenerated/:id

Using Get (not recommended):

  • Use URL im embed /staticmap with info as query parameters

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.