Coder Social home page Coder Social logo

leaphant / flowabot Goto Github PK

View Code? Open in Web Editor NEW
109.0 18.0 33.0 2.88 MB

Modular Discord bot with fun features including twitch commands and advanced osu! commands. 🌷

License: MIT License

JavaScript 100.00%
discord osu nodejs modular video gif rendering

flowabot's Introduction

flowabot

flowabot is a modular discord bot with a focus on osu! features. Instead of me explaining this with words, I'll just leave a demonstration video:

Jump to Installation.

Main Features

Fancy scorecards with unique information like a difficulty graph or unstable rate

Get an overview of your osu! stats

Render a video or picture of any osu! beatmap

Get a graph with the hardest parts of a beatmap

Get a graph of the bpm changes throughout a beatmap

You can find more features in the commands list.

Installation

Prerequisites

Setup

Clone the repo and enter the bot directory

git clone https://github.com/LeaPhant/flowabot.git
cd flowabot

Install all modules

npm i

Now you'll be able to use the configuration wizard.

npm run config

Follow the on-screen instructions, just press enter without typing anything for features you don't need.


You should be able to run the bot now.

npm start

If you provided a Discord client ID during the configuration you will receive an invite link to add the bot to your server.


Make the grade emojis work (S rank, A rank, etc.)

npm run emojis

This script will automatically upload the grade emojis to a server you'll have to pick. If there are no free emoji slots create a new server just for the bot to use its emojis from.


To keep the bot running in the background install pm2 and run

pm2 start npm --name flowabot -- start

To start the bot on system boot use

pm2 save
pm2 startup

(This is only tested on Linux)

Patrons

Thanks to anyone supporting me on Patreon, especialy the following peeps who decided to leave $5 or more per month 😳

WitchOfFrost

flowabot's People

Contributors

leaphant avatar metalcupcake5 avatar

Stargazers

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

Watchers

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

flowabot's Issues

TypeError on command '!render fail' on passed map

When running

!render fail

on a recent map that the user has passed, a TypeError is thrown:

[2019-07-14T13:56:50.767Z] Maaster : !render fail
[2019-07-14T13:56:50.768Z] render length 4
[2019-07-14T13:56:50.768Z] specified ar undefined
[2019-07-14T13:56:50.945Z] score has no replay
process beatmap: 460.864ms
uncaughtException: TypeError: Cannot read property 'startTime' of undefined
at prepareBeatmap (/root/flowabot/renderer/render_frame.js:661:100)
at processBeatmap (/root/flowabot/renderer/render_frame.js:575:5)
at /root/flowabot/renderer/render_frame.js:623:9
at ReadStream. (/root/flowabot/node_modules/osu-parser/index.js:467:7)
at ReadStream.emit (events.js:203:15)
at endReadableNT (_stream_readable.js:1129:12)
at process._tickCallback (internal/process/next_tick.js:63:19)

Cannot find High Charts Module

Hey there, followed the installation guide and installed everything beforehand.
On doing

npm i

it throws an error stating that the High Charts Module cannot be found.

Log of it: https://pastebin.com/MStvGdgM

I probably missed a really obvious thing and will feel stupid once its fixed, but I guess Id ask because I really wanna use this awesome bot.

For reference, running this in a completely new Ubuntu 18.04.2 VM.

Thanks :D

UnhandledPromiseRejectionWarning on render

Having

https://osu.ppy.sh/beatmapsets/923095#osu/1927666

as the recent score and running

render strains 10s

results in no output in Discord and this error in the server console

[2019-07-14T05:38:46.785Z] Maaster : !render strains 10s
[2019-07-14T05:38:46.785Z] render length 10
[2019-07-14T05:38:46.785Z] specified ar undefined
(node:28054) UnhandledPromiseRejectionWarning: Couldn't download file
(node:28054) 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: 18)

rendering osr directly from channel

Love the bot ! It would be very cool to have a command to render a replay (osr) that someone sends in a channel. Thank you very much for the work !

Flowabot on Raspberry Pi

Hey,

just toyed around with this for a few days, Endresult is that Phantomjs (Dependency of highcharts) is not meant for arm architectures and as such cannot be properly installed/run on Raspberry PIs. As the project is also deprecated, there wont be any updates to that.

Its a long shot, but theres no way to remove highcharts from flowabot and have it run correctly, right? Or anything that would spring to your mind how I could make it run without phantomjs (or any way for me to install it)?

Thanks and sorry for bugging you so often about problems!

error in rendering

/home/ziv132/bot/renderer/beatmap_preprocessor.js:145
    return Math.sqrt((hitObject2[0] - hitObject1[0]) * (hitObject2[0] - hitObject1[0])
                                                ^

TypeError: Cannot read property '0' of undefined
    at vectorDistance (/home/ziv132/bot/renderer/beatmap_preprocessor.js:145:49)
    at processBeatmap (/home/ziv132/bot/renderer/beatmap_preprocessor.js:523:16)
    at /home/ziv132/bot/renderer/beatmap_preprocessor.js:682:9
    at ReadStream.<anonymous> (/home/ziv132/bot/node_modules/osu-parser/index.js:456:7)
    at ReadStream.emit (events.js:203:15)
    at endReadableNT (_stream_readable.js:1129:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

the command was !fail on the stream part of A FOOL MOON NIGHT [emillistream]

UnhandledPromiseRejectionWarning

Hello, I have the same issue as in #17 but basically with any map.

When trying to render strains from any recent beatmap, bot's response is

Couldn't run command: Couldn't download file

The console output is

(node:108324) UnhandledPromiseRejectionWarning: Couldn't download file
(node:108324) 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: 6)
[2021-01-27T21:38:17.410Z] Couldn't download file
(node:108324) UnhandledPromiseRejectionWarning: Couldn't download file
(node:108324) 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: 8)
[2021-01-27T21:38:17.582Z] Flowobot : Couldn't run command: Couldn't download file

System info:
Machine Type: VM
Operating System: Ubuntu 20.04.1 LTS
Kernel: 5.4.0-61-generic
Architecture: x86_64
Node Version: nvm 10

!render doesn't detect hidden mod

I saw that hidden was implemented a while back (yay!), but it isn't rendered if it's included in the mod arguments (e.g. !render +hddt). It only renders if no + precedes 'hd' which seems a bit odd. This means that rendering directly from a score that uses hidden means flowabot doesn't render with hd. Hope this can be fixed! Thanks again for your hard work :)

Error Rendering map on !render fail

Map: https://osu.ppy.sh/beatmapsets/574824#osu/1217417

Command as it was a recent score: !render fail

Stacktrace:

[2019-07-16T17:25:17.542Z] render length 4
[2019-07-16T17:25:17.542Z] specified ar undefined
[2019-07-16T17:25:17.781Z] score has no replay
[2019-07-16T17:25:17.799Z] flowabot : Rendering...
process beatmap: 542.014ms
/root/flowabot/renderer/render_worker.js:304
position = playfieldPosition(...pos_current);
^
TypeError: Cannot read property 'Symbol(Symbol.iterator)' of playfieldPosition
at /root/flowabot/renderer/render_worker.js:304:36
at Array.forEach ()
at processFrame (/root/flowabot/renderer/render_worker.js:143:28)
at process.on.obj (/root/flowabot/renderer/render_worker.js:422:13)
at process.emit (events.js:198:13)
at emit (internal/child_process.js:832:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
[2019-07-16T17:25:18.886Z] flowabot : Couldn't run command: Error rendering beatmap

Docker support

The bot looked kind of nice, but I'm a lazy bum who hates installation steps and a sucker for docker.

Therefore adding support for Docker by providing a Dockerfile would be nice since you could then easily spin up an instance wherever docker is installed. Maybe even throw it on dockerhub so you could pull and run it with one command.

I don't have access to my computer currently, but I can probably write one in a week or so if that's something you could see adding.

Rendering judgements (100s, 50s, misses)

Hi! Just wanted to know if there's any possibility of adding the ability to render judgements as it's helpful when used to show a recent play. Thanks in advanced and have enjoyed using the bot over the past few months! :)

edit solved prev questions nvmnvm

Can't use Twitch Client ID

So basically when I try to add Twitch Client ID it says not valid id. It either twitch being bithx or something updated in api and its not working.
Me trying:
image

Beatmap wont download

i kept getting Couldn't run command: Couldn't download file whenever i use the bpm command

Command "!pp" id only broken

While going through the files I found that if you run the "!pp" command with the beatmap id only it'll return with a error. It can be fixed under line 1392 in osu.js by changing "_id_only" to "id_only".

Error:
image

Edit 1
Going through more I found that in line 1192 in osu.js "options" is spelled wrong
I also found out if you put a # in front of a number it'll reference a old issue face palm

FS Erros.

fs.js:27
const { Math, Object, Reflect } = primordials;
^

ReferenceError: primordials is not defined
at fs.js:27:35
at req_ (/uwubot/node_modules/natives/index.js:143:24)
at Object.req [as require] (/uwubot/node_modules/natives/index.js:55:10)
at Object. (/uwubot/node_modules/fstream/node_modules/graceful-fs/fs.js:1:37)
at Module._compile (internal/modules/cjs/loader.js:759:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
at Module.load (internal/modules/cjs/loader.js:628:32)
at Function.Module._load (internal/modules/cjs/loader.js:555:12)
at Module.require (internal/modules/cjs/loader.js:666:19)
at require (internal/modules/cjs/helpers.js:16:16)

Permission Denied on npm i during node-pre-gyp install

Hey, probably some stupid mistake but I cant figure it out.

It worked fine for several weeks, then I decided to upgrade and pull the latest changes with npm i and it threw this:

root@maaster-VirtualBox:~/flowabot# npm i

> [email protected] install /root/flowabot/node_modules/canvas
> node-pre-gyp install --fallback-to-build

fs.js:115
    throw err;
    ^

Error: EACCES: permission denied, open '/root/flowabot/node_modules/canvas/package.json'
    at Object.openSync (fs.js:439:3)
    at Object.readFileSync (fs.js:344:35)
    at Run.parseOpts [as parseArgv] (/usr/lib/node_modules/node-pre-gyp/lib/node-pre-gyp.js:136:36)
    at Object.<anonymous> (/usr/lib/node_modules/node-pre-gyp/bin/node-pre-gyp:24:6)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
npm WARN [email protected] requires a peer of @discordjs/uws@^10.149.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of bufferutil@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of erlpack@discordapp/erlpack but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of libsodium-wrappers@^0.7.3 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of node-opus@^0.2.7 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of opusscript@^0.0.6 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of sodium@^2.0.3 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-10-22T21_11_51_188Z-debug.log

node -v return v10.16.0

What am I missing?

phantomjs

Package renamed to phantomjs-prebuilt. Please update 'phantomjs' package references to 'phantomjs-prebuilt'

I can't setup bot

ubuntu@flowabot-423651:~/flowabot$ npm run config
............
Discord bot token [none]: <my token>
/home/ubuntu/flowabot/node_modules/discord.js/src/client/ClientDataManager.js:81
        guild.channels.set(channel.id, channel);
                                   ^

TypeError: Cannot read property 'id' of undefined
    at ClientDataManager.newChannel (/home/ubuntu/flowabot/node_modules/discord.js/src/client/ClientDataManager.js:81:36)
    at Guild.setup (/home/ubuntu/flowabot/node_modules/discord.js/src/structures/Guild.js:307:68)
    at GuildCreateHandler.handle (/home/ubuntu/flowabot/node_modules/discord.js/src/client/websocket/packets/handlers/GuildCreate.js:12:15)
    at WebSocketPacketManager.handle (/home/ubuntu/flowabot/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:108:65)
    at WebSocketConnection.onPacket (/home/ubuntu/flowabot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:336:35)
    at WebSocketConnection.onMessage (/home/ubuntu/flowabot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:299:17)
    at WebSocket.onMessage (/home/ubuntu/flowabot/node_modules/ws/lib/event-target.js:120:16)
    at WebSocket.emit (events.js:198:13)
    at Receiver.receiverOnMessage (/home/ubuntu/flowabot/node_modules/ws/lib/websocket.js:789:20)
    at Receiver.emit (events.js:198:13)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] config: `node generate-config`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] config script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ubuntu/.npm/_logs/2021-04-04T15_16_07_664Z-debug.log
ubuntu@flowabot-423651:~/flowabot$

OS : Ubuntu 20.04 LTS
Node Version : 10.24
Discord.js Version : 11.6.4

full logs
ubuntu@flowabot-423651:~/flowabot$ npm i                                                                                                                        > [email protected] preinstall /home/ubuntu/flowabot/node_modules/highcharts-export-server
> node ./pre.build.js

Preinstall: no tasks to be done, skipping
                                                                                > [email protected] install /home/ubuntu/flowabot/node_modules/phantomjs-prebuilt
> node install.js

PhantomJS not found on PATH
Downloading https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-linux-x86_64.tar.bz2
Saving to /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
Receiving...
  [===============================---------] 77%                                Received 22866K total.
Extracting tar contents (via spawned process)
Removing /home/ubuntu/flowabot/node_modules/phantomjs-prebuilt/lib/phantom
Copying extracted folder /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1617549266385/phantomjs-2.1.1-linux-x86_64 -> /home/ubuntu/flowabot/node_modules/phantomjs-prebuilt/lib/phantom
Writing location.js file
Done. Phantomjs binary available at /home/ubuntu/flowabot/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs

> [email protected] install /home/ubuntu/flowabot/node_modules/canvas
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download 
[canvas] Success: "/home/ubuntu/flowabot/node_modules/canvas/build/Release/canvas.node" is installed via remote

> [email protected] install /home/ubuntu/flowabot/node_modules/diskusage
> node-gyp rebuild

make: Entering directory '/home/ubuntu/flowabot/node_modules/diskusage/build'
  CXX(target) Release/obj.target/diskusage/src/main.o
In file included from ../../nan/nan.h:56,                                                        from ../src/main.cpp:3:                                        /home/ubuntu/.cache/node-gyp/10.24.0/include/node/node.h:573:43: warning: cast between incompatible function types from ‘void (*)(v8::Local<v8::Object>)’ to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]                                              573 |       (node::addon_register_func) (regfunc),                          \       |                                           ^                             /home/ubuntu/.cache/node-gyp/10.24.0/include/node/node.h:607:3: note: in expansion of macro ‘NODE_MODULE_X’                                                       607 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
      |   ^~~~~~~~~~~~~                                                         ../src/main.cpp:42:1: note: in expansion of macro ‘NODE_MODULE’                    42 | NODE_MODULE(diskusage, Init)                                                  | ^~~~~~~~~~~                                                             In file included from /home/ubuntu/.cache/node-gyp/10.24.0/include/node/node.h:63,                                                                                               from ../../nan/nan.h:56,                                                        from ../src/main.cpp:3:                                        /home/ubuntu/.cache/node-gyp/10.24.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)]’:                                                                      /home/ubuntu/.cache/node-gyp/10.24.0/include/node/node_object_wrap.h:84:78:   required from here
/home/ubuntu/.cache/node-gyp/10.24.0/include/node/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<node::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]                                                                               9502 |                reinterpret_cast<Callback>(callback), type);                   |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                     /home/ubuntu/.cache/node-gyp/10.24.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)]’:                                                                        ../../nan/nan_object_wrap.h:65:61:   required from here                         /home/ubuntu/.cache/node-gyp/10.24.0/include/node/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<Nan::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]  CXX(target) Release/obj.target/diskusage/src/diskusage_posix.o
  SOLINK_MODULE(target) Release/obj.target/diskusage.node
  COPY Release/diskusage.node
make: Leaving directory '/home/ubuntu/flowabot/node_modules/diskusage/build'

> [email protected] install /home/ubuntu/flowabot/node_modules/highcharts-export-server
> node ./build.js


Highcharts Export Server

https://github.com/highcharts/node-export-server

In order to use this application, Highcharts needs to be downloaded and 
embedded. A license is required to use Highcharts if you're a 
for-profit, commercial, outfit. 

The license can be viewed here: https://shop.highsoft.com/media/highsoft/Standard-License-Agreement-6.0.pdf


IF THE DOWNLOAD FAILS:
----------------------

Are you behind a proxy?
See https://github.com/request/request#controlling-proxy-behaviour-using-environment-variables

Are you behind a company firewall?
Try running "npm config set strict-ssl=false" before installing

Agree to the license terms? y/n:  (no) y                                        Select your Highcharts version (e.g. 4.2.2)::  (latest)                         Include Maps? (requires Maps license):  (no)                                    Include Gantt? (requires Gantt license, and >V6.2):  (no)                       Enable styled mode? (requires Highcharts/Highstock 5+ license):  (no)           Include moment.js for date/time handling?:  (no)                                Which CDN would you like to use?:  (https://code.highcharts.com/)               Enable wordcloud support? y/n:  (no)                                            Enable annotations support? y/n:  (no)                                          Pulling Highcharts from CDN (latest)..
   https://code.highcharts.com/stock/highstock.js
   https://code.highcharts.com/highcharts-more.js
   https://code.highcharts.com/modules/exporting.js
   https://code.highcharts.com/highcharts-3d.js
   https://code.highcharts.com/modules/data.js
   https://code.highcharts.com/modules/funnel.js
   https://code.highcharts.com/modules/solid-gauge.js
   https://code.highcharts.com/modules/heatmap.js
   https://code.highcharts.com/modules/treemap.js
   https://code.highcharts.com/modules/sunburst.js
   https://code.highcharts.com/modules/xrange.js
   https://code.highcharts.com/modules/streamgraph.js
   https://code.highcharts.com/modules/sankey.js
   https://code.highcharts.com/modules/tilemap.js
   https://code.highcharts.com/modules/histogram-bellcurve.js
   https://code.highcharts.com/modules/bullet.js
   https://code.highcharts.com/modules/organization.js
   https://code.highcharts.com/modules/funnel3d.js
   https://code.highcharts.com/modules/pyramid3d.js
   https://code.highcharts.com/modules/dependency-wheel.js
   https://code.highcharts.com/modules/item-series.js
   https://code.highcharts.com/modules/timeline.js
   https://code.highcharts.com/modules/pareto.js
   https://code.highcharts.com/modules/coloraxis.js
   https://code.highcharts.com/modules/venn.js
   https://code.highcharts.com/modules/dumbbell.js
   https://code.highcharts.com/modules/lollipop.js
Creating export template export..
All done! Happy charting!
For documentation, see https://github.com/highcharts/node-export-server

> [email protected] postinstall /home/ubuntu/flowabot/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)


> [email protected] postinstall /home/ubuntu/flowabot/node_modules/highcharts-export-server
> node ./post.build.js

added 440 packages from 326 contributors and audited 441 packages in 127.76s    
17 packages are looking for funding
  run `npm fund` for details

found 19 vulnerabilities (8 low, 6 moderate, 5 high)
  run `npm audit fix` to fix them, or `npm audit` for details
ubuntu@flowabot-423651:~/flowabot$ npm run config                               
> [email protected] config /home/ubuntu/flowabot
> node generate-config


-----------------------------------------------
Welcome to the flowabot configuration wizard 🧙‍
-----------------------------------------------

If you press enter without entering anything it will choose the default value in the [brackets]‍

Command prefix [!]: -

Enable debug messages (yes/no) [yes]: 

Path where to cache .osu files [/tmp/osumaps]: 

(Optional) To enable the -pp command you need to supply a path to PerformanceCalculator.dll.
    To get it you need to compile https://github.com/ppy/osu-tools.
Path to PerformanceCalculator.dll [none]: 

(Optional) Here you could supply your own beatmap api for star rating values, just leave this as-is cause it's unfortunately not open-source yet.
Beatmap API [https://osu.lea.moe]: 

(Required) A Discord bot token is required. You can create a bot here to receive one: https://discord.com/developers/applications/.
Discord bot token [none]: <my token>
/home/ubuntu/flowabot/node_modules/discord.js/src/client/ClientDataManager.js:81
        guild.channels.set(channel.id, channel);
                                   ^

TypeError: Cannot read property 'id' of undefined
    at ClientDataManager.newChannel (/home/ubuntu/flowabot/node_modules/discord.js/src/client/ClientDataManager.js:81:36)
    at Guild.setup (/home/ubuntu/flowabot/node_modules/discord.js/src/structures/Guild.js:307:68)
    at GuildCreateHandler.handle (/home/ubuntu/flowabot/node_modules/discord.js/src/client/websocket/packets/handlers/GuildCreate.js:12:15)
    at WebSocketPacketManager.handle (/home/ubuntu/flowabot/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:108:65)
    at WebSocketConnection.onPacket (/home/ubuntu/flowabot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:336:35)
    at WebSocketConnection.onMessage (/home/ubuntu/flowabot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:299:17)
    at WebSocket.onMessage (/home/ubuntu/flowabot/node_modules/ws/lib/event-target.js:120:16)
    at WebSocket.emit (events.js:198:13)
    at Receiver.receiverOnMessage (/home/ubuntu/flowabot/node_modules/ws/lib/websocket.js:789:20)
    at Receiver.emit (events.js:198:13)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] config: `node generate-config`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] config script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ubuntu/.npm/_logs/2021-04-04T15_16_07_664Z-debug.log
ubuntu@flowabot-423651:~/flowabot$

Infinite rendering when provided negative percentage value

When rendering a beatmap, putting something like -100% as an argument will cause flowabot to infinitely render frames until either it is restarted or /tmp/frames runs out of space.

Screenshot
Screenshot2

I think either sanitizing input (only positive values) or implementing reverse playback solves the issue. Obviously, the former's easier than the latter.

Host

Hello, I would like to put the bot on hosting
I am an ordinary user, installed the bot according to the instructions
And now I would like the bot to work on the host, I tried to put it on the host "Heroku" but I did not succeed :(
I looked at different manuals, but they did not help me.
I just wanted to get some advice from you, and maybe someone else can help with that, I'm sure it's not difficult to do (probably)

(I don't know English well, so I used Google Translate xD)

a way to limit max !render length

I'm sure it's not too difficult to implement, I'm just mega stupid :( Would be great since personally I've been running this off a very low-powered web server so bandwidth is small and the bot totally hangs if people try to render more than 10 seconds.

Using !render on some maps causes the entire bot to halt.

For example, using !render 20s on https://osu.ppy.sh/b/1529760 makes the entire bot halt for a few minutes.

Maybe other maps could cause the same issue.

Possible fixes could be either excluding Aspire maps or properly implement multithreading on command handling.

Also some of the slider positions of those maps are basically going from inf pos to inf neg. Might want to add an edge case check?

Resuming: Any command that takes too much to answer causes the bot to halt for the duration of the command until it replies. Please implement command multi-threading if possible, or in this case Promise-based commands could work too.

Double time and Nightcore mods

When there was a play with DT or NC and you render it. it goes at normal speed instead of the 1.5x times speed that the mods make it go.

P.S. Haven't tried it but I'm guessing the same will be true for Half time.

Windows System Fix

After trying to get the bot to work with windows, I seem to have found a solution where everything I have tested is working.

Bot setup instructions Windows 10:

1. Install Ubuntu
Execute this command and restart PC.
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
1b. Download Ubuntu from Microsoft Store and install

Run the following commands through Ubuntu

2. Update
sudo apt-get update
sudo apt-get upgrade

3. Install NodeJS
sudo apt-get install curl python-software-properties
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install nodejs

4.Install GCC through build-tools
sudo apt install build-essential

5.Install Node-gyp
sudo npm install -g node-gyp

6.Create a discord bot
https://discordapp.com/developers/applications/

7.Create osu! API Key
https://osu.ppy.sh/p/api/

8.Install .NET SDK
wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo add-apt-repository universe
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sdk-2.2

If you are unable to locate the package:
sudo dpkg --purge packages-microsoft-prod && sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install dotnet-sdk-2.2

9.Install Node Canvas
sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
npm install canvas

10.Clone Repository and build
cd
git clone https://github.com/LeaPhant/flowabot.git

If you want PP command:
cd
git clone --recurse-submodules https://github.com/ppy/osu-tools
cd osu-tools/
sudo ./build.sh

11.Set Up Bot
cd
cd flowabot
npm i
npm run config
Set up the bot how you would like, using your discord bot info and osu! API Key.
Performance calculator dll should be located at:
/home/**YOUR USER**/osu-tools/PerformanceCalculator/bin/Release/netcoreapp2.0/PerformanceCalculator.dll

12.Set Up Emojis
Let bot join your server:
https://discordapp.com/api/oauth2/authorize?client_id=**YOUR-CLIENT-ID**&permissions=8&scope=bot
Still within flowabot directory:
npm run emojis
The server index should be 0 if the bot is only on 1 server.

13.Start Bot
npm start

If anything is not working then I will try to help, the guide is just written from memory so I may have forgotten something.
File system is located at:
C:\Users\**USER**\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs

!osu-track Command

I suggest to automate the untracking and retracking of an already tracked player for example in situations where the user wants to change the top number to be tracked, instead of just making a message appear that tells you that the players already being tracked, thus ignoring the top score change

!strains graph hard to view

it is hard to see the graph because it's being rendered with a part of the map in front of it.
IMG_20201220_075354.jpg

I'm running on Arch Linux with the nodejs-lts-dubnium package.

Incorrect path specified

When running a command sequence such as:
!top Vaxei
!render strains 20s

Video encoding fails because there is a space in path due to the windows username.

[2019-07-10T16:56:25.676Z] { Error: Command failed: C:\Users\Jouveer Naidoo\Desktop\osu!Bot\flowabot\node_modules\ffmpeg-static\bin\win32\x64\ffmpeg.exe -loop 1 -r 60 -i "C:\tmp\frames\403990016\map\bg.png" -f image2 -r 60 -s 400x300 -pix_fmt rgba -c:v rawvideo -i /tmp/frames/403990016/%d.rgba -ss 261.1 -i "C:\tmp\frames\403990016\map\audio.mp3" -filter:a "afade=t=out:st=31:d=0.5,atempo=1.5,volume=0.7" -filter_complex "overlay=(W-w)/2:shortest=1" -pix_fmt yuv420p -r 60 -c:v libx264 -b:v 2184.5333333333333k -c:a aac -shortest -preset veryfast /tmp/frames/403990016/video.mp4

'C:\Users\Jouveer' is not recognized as an internal or external command,
operable program or batch file.

Windows 10 operating system

Possible memory leak

I am running the bot on a GCP instance that has only 600mbs of ram.
The bot works for the most part and most things render fine but problems occur when rendering long death streams, the bot uses up all the ram and takes a long time to render.
this doesn't happen when rendering normal things like jumps or a regular streams and sliders.

--ziv

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.