Skip to content

Roout/chatterfinity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chatterfinity

Linux

This Twitch Chat Bot provides an information about TBC Arena Leaderboard, Realm Status, etc. Bot uses Blizzard WOW API.
Bot is in development so some functionality will be added later.

Remote services

Dependencies

  • OpenSSL 1.1.1L
  • Rapidjson 1.1.0
  • Boost.Asio 1.72.0

Quick Start

  1. Clone https://github.com/Roout/chatterfinity.git
  2. Create secret/services.json file
  3. Build Project with CMake 3.12 or higher

Configuration

Commands

Commands can be invoked within either Console either Twitch chat. Chat messages can be russian.
Commands which have already been implemented are quite crude without any customization and flexibility because they are used to test core of the bot now.
Bot sends messages in the chat using PRIVMSG IRC command.

Bot supports UTF8 charset:

  • Windows (can not print characters which required more than 2 code units (bytes) for encoding)
  • Linux (should work even with encoding which uses 4 code units (bytes))

Twitch chat

For now you can invoke the following custom commands within channel chat:

Name Params Description
!realm-status Show flamegor server status and queue information
!arena Show current top 1 of the EU region
!arena -player "nick" Show team name, rank, rating of the given player

You also can call alias within chat. But you can add alias only within console

# call already added beforehand alias
!exodus
# the output for alias above will be equal to output of the following arena command
!arena -player "Шаркии"

Console

For now you can invoke the following custom commands within console:

Name Params Description
!realm-status Show flamegor server status and queue
information to console only
!realm-id Show flamegor server id to console only
!arena Show current top 1 EU to console only
!login Login to the irc.chat.twitch.tv:6697
!join -channel "chatroom" Join the chatroom
!chat -channel "chatroom" -message "message" Send message to provided chat (message in "")
!leave -channel "chatroom" Leave a chatroom
!pong Send pong to the irc.chat.twitch.tv:6697
!validate Validate the current twitch token
!alias -alias "alias_name" -command "command"
-k1 v1 -k2 v2 ... (other params)
Add alias

Alias can be added only within console.

# add alias for displaying arena team data
!alias -alias exodus -command arena -player "Шаркии"
# call alias within console or within twitch chat
!exodus
# the output for alias above will be equal to output of the following arena command
!arena -player "Шаркии"

Aliases are being saved in alias.txt with executable. So they can be saved/soaded between sessions. You also can add alias manually there. But this may lead to errors e.g., coincidence of alias name and existing command name. If you do the same within console it won't add such alias.

Not implemented:

  • remove alias
  • print existing aliases

Future features

Chat bot commands

  • choose creature for user (customized !dice roll)
  • arena leaderboard:
    • top 1 team of the provided realm
    • top 1 team of the provided region
    • rating for the team by player name from EU regin
    • win-lose statistics for the team by player name
  • auction (don't know whether it will be usefull)

Arena leaderboard is one of the most interesting thing for WOW community so it will be the most important part of the bot.

Restrictions

There are several very imporatant restriction on the communication in twitch chat. They depend on MODE and Bot authority. Bot doesn't consider some twitch restrictions yet.

NOT implemented yet:

  • Minimum 1 second delay between messages via IRC connection. For slow mode it can be greater.
  • Authority e.g., subscriber mode, etc

ALREADY implemented:

  • Rate Limit is used for PRIVMSG, JOIN, PASS.
    Only 2 buckets with the strictest restrictions supported now: general bucket(JOIN, PASS), channel bucket(PRIVMSG). Buckets doesn't take into account users authority and assuming this is simple account. Now you're neither moderator neither subscriber. Authority support is not implemented. Buckets doesn't take into account bans, slowmodes, etc. These features will be implemented later.

If IRC or HTTPS connection fails to connect/read/write it will try to reconnect 3 times with 2s, 4s, 8s timeouts.

Certificate Authorities

The following certificates are downloaded for application to be able to work with several APIs. They are used by application when connection is trying to complete a handshake. Connection needs a CA information to verify if the certificate is "valid" or not. Connection uses (loads for SSL Context) root CA to verify a service.

Blizzard

Source: DigiCert list Root certificate is DigiCert High Assurance EV Root CA;
Used by eu.battle.net (Blizzard Auth)

Source: DigiCert list Root certificate is DigiCert Global Root CA
Used by eu.api.blizzard.com (Blizzard API)

Twitch

Source: Amazon CA Distinguished Name:

CN=Starfield Services Root Certificate Authority - G2,
O=Starfield Technologies, Inc.,
L=Scottsdale,
ST=Arizona,
C=US

About

Twitch bot based on WOW Blizzard and Twich APIs.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published