Giter Club home page Giter Club logo

holo-bot's Introduction

Holo Bot

Table of Contents

About

A simple discord bot that help tracks events of Hololive, including YouTube stream notification, tweet updates and more.

(Edit: Thanks to Elon Musk, the support of twitter basically died.)

Usage

Discord Text Message Commands

  • >man: Display manual pages (help).
  • >holo <member> [list | schedules | live]: Shows the current stream of a specified member.
    • list to display all Hololive member ids used in this command.
    • schedules to list the schedules of today, required a running holo_schedule_api instance.
    • live to list all members that are currently streaming on youTube.
  • >ping [ls | sl]: Pong!
  • >roll <dice_size> <roll_number>: Roll a dice, old function from 1st gen Discord MP Bot.
  • >bonk <@member>: Bonk the mentioned member.
  • >about: About Holo Bot.
  • >register <user_youtube_channel_id>: Register your DiscordID and YouTube ID for YouTube member verification.
  • >member_verify: Verify YouTube's channel membership status. See member verification to enable this function and additional information for more details.

There exists some undocumented commands in the bot, will be updated or deleted in the near future.

Non-Command Functions

  • Auto Twitter URL translation: Since nowadays URL that starts with twitter.com or x.com will not have previews in Discord, the bot automatically detects whenever a user posts a twitter or x URL and translates it into vxtwitter URL to show previews.
  • Event notification: Notifies a specified @group whenever the designated Hololive member opens or starts a stream on YouTube.
  • Tweet update: Basically dead because of some guy at Twitter.

Additional Info On YouTube Membership Verification

Basically, "How does the verification works?"

This member verification system first will require to register your YouTube ID with the bot. Then you leave a message in the designated free chat. After you came back to the bot and issue the >member_verify command, the bot will search for your message and use it to check if your membership is active.

Setup

Unless otherwise stated, all configuration files need to be placed under the config directory.

Setting Up Tokens

Discord

Discord bot token needs to be placed in config.properties with the form:

token=<your disocrd bot token>
twitter=<true|false>
member_verification=<true|false>

HoloDex, YouTube, Twitter API token

HoloDex, YouTube and Twitter API tokens should be placed in /config/credentials directory with the following filename and format:

(I do know this looks like a mess, but I didn't realized until when I'm updating this readme. I promise I will do something.)

  • holodex.json
{
	"key": <your holodex api key>
}
  • youtube_api.json
{
	"youtube-api-key": <your youtube api key>
}
  • twitter4j.properties
debug=false
oauth.consumerKey=
oauth.consumerSecret=
oauth.accessToken=
oauth.accessTokenSecret=

Enabling/Disabling Some Features

YouTube member verification service and features related to Twitter could be disabled in config.properties file simply by changing the field value to false.

twitter=false
member_verification=false

Member Verification

YouTube member verification requires a MongoDB to run alone with to bot for storing user information (YouTube ID, membership status, renew date).

{
    "db_name": "name of your db",
    "discord_role_id": "your discord role id for verified member",
    "yt_live_stream_chat_id": "Cg0KC3c0ZGdxbF81UnprKicKGFVDLWhNNllKdU5ZVkFtVVd4ZUlyOUZlQRILdzRkZ3FsXzVSems",
    "db_connection": "mongodb://localhost:27017"
}

Broadcasting Twitter content

Tweet broadcasting is disabled in default, to enable the service, add twitter=true in config.properties. Edit config/broadcast.json to subscribe to twitter content and broadcast it in designated text channel.

  • query: The search query for twitter.
  • target: Target channel ID(s)

Example:

[
	{
		"query": "from:@sakuramiko25",
		"target": [757941157421645924, 757941157421645925]
	}
]

Holo Schedules

>holo schedules requires Holo Schedule API to run in local. See more at Holo Schedule API repo.

Running, Test and Build

  • Run: mvn exec:java
  • Test: mvn test
  • Build: mvn clean compile assembly:single

Contributing

You're welcomed to do so either by sending over pull requests or submitting feed backs, feature requests in issue.

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.