Coder Social home page Coder Social logo

discord-playtime's Introduction

discord-playtime

A discord bot intended to track playtime. Written for nodejs and based on discord.js.

Build Status Dependency status Coverage Status

Overview

This bot allows you and your guild to track which games are most popular and who plays the most. It allows you to view a overview of your guilds statistics as well as fetch stats per game or player.

Available commands are:

  • Overview: Prints a summary of your guilds statistics
  • UserStats : Prints detailed stats on the player with the given display name
  • GameStats : Prints detailed stats on the given game
  • Help

All commands are prefixed by your configured COMMAND_PREFIX

Setup

  • clone the repo
  • run yarn install
  • copy config.json.default to config.json and fill in your options
  • start the bot with yarn start and use the generated link to add the bot to your server

Running on Docker

  • Use the following environment variables to configure the bot: DISCORD_TOKEN, MONGO_URL, COMMAND_PREFIX, mashapeKey, HEALTHCHECK, HEALTHCHECK_PORT

discord-playtime's People

Contributors

thiemok avatar zgrav avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

discord-playtime's Issues

Fix flow libdefs for discrod.js and express

Libdefs for discord.js and express are incomplete, corresponding errors are for now supressed using // $FlowIssue but should be fixed in the future by either updating flow-typed or providing a fixed version go flow-typed

Add placeholder images to embeds

Embed size varies between having an image set or not. A placeholder should be set if a command might set an image, but could fail to do so. For example when a user has no avatar set, or a games cover was not found.

Handle Stream titles

Stream titles will replace game names when a player is streaming, this needs to be considered

Graphing

A user should be able to generate and view a graph for his data

Also track afk users while in game

Discord does not track gamepad inputs as activity for its away mechanism. This results in players using gamepads switching to away while still playing. Maybe those should also be tracked, on the other hand this would include legit away players with running games in the tracking

Use node logging

logging code should be refactored to use node logging facilities

Documentation Clarification

Can you clarify some details relating to how to properly setup the mongodb for this as well the processes relating to mashape API for IGDB?

If you can summarize, I'd be more than willing to submit a pull request with those steps more fleshed out in your readme.

Thanks!

Is this even still maintained? - Quite a lot of issues/requests

Issues such as:

(node:8980) UnhandledPromiseRejectionWarning: RangeError: RichEmbed field values may not be empty.
at RichEmbed.addField (/home/skyrider/discord/playtime/node_modules/discord.js/src/structures/RichEmbed.js:158:34)
at addFieldsToEmbed (/home/skyrider/discord/playtime/app/util/embedHelpers.js:122:16)
at /home/skyrider/discord/playtime/app/util/embedHelpers.js:149:12
at new Promise ()
at new F (/home/skyrider/discord/playtime/node_modules/core-js/library/modules/_export.js:36:28)
at generateEmbeds (/home/skyrider/discord/playtime/app/util/embedHelpers.js:135:17)
at /home/skyrider/discord/playtime/app/commands/gameStats.js:72:7
at
at process._tickCallback (internal/process/next_tick.js:188:7)
(node:8980) 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: 70)

Commands are required to be capitalized. (Eg, !overview doesn't work while !Overview does).

You can't use userstats on a userID, a clear copy/paste of his name is required. EG:

!UserStats @ Skyrider

Shows up:

: I could not find <@!133631162894516225> please use an existing username

Also an ignore feature would be nice. Spotify for example isn't a game.

Kind Regards,
Skyrider

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.