Skip to content

Twitch bot to save API information from chat messages and more in a database.

License

Notifications You must be signed in to change notification settings

tomaarsen/TwitchSaveMessages

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TwitchSaveMessages

Twitch bot to save API information from chat messages and more in a database.


Explanation

When the bot has started, it will start listening to chat messages in the channel listed in the settings.txt file. Beyond that, it listens to all other data Twitch sends us, and depending on our settings, stores it into a .db file. This is meant for debugging purposes only. Data is not stored efficiently.


Database structure

Column Meaning
full_message Raw data from Twitch.
tags All tags. These give information about a user, generally. Potentially empty
command The full command.
user The user connected to the command. Optional.
type The type of command. Important.
params Parameters sent along with the command. Optional.
channel The channel this command is sent in. Optional
message The message sent along. Optional.
time (Unix Epoch) Time at which the message was generated.
time_since_last Time since previous message.

More information on the database structure here, in the Output section.


Settings

This bot is controlled by a settings.txt file, which looks like:

{
    "Host": "irc.chat.twitch.tv",
    "Port": 6667,
    "Channel": "#<channel>",
    "Nickname": "<name>",
    "Authentication": "oauth:<auth>",
    "MessagesOnly": false
}
Parameter Meaning Example
Host The URL that will be used. Do not change. "irc.chat.twitch.tv"
Port The Port that will be used. Do not change. 6667
Channel The Channel that will be connected to. "#CubieDev"
Nickname The Username of the bot account. "CubieB0T"
Authentication The OAuth token for the bot account. "oauth:pivogip8ybletucqdz4pkhag6itbax"
MessagesOnly Whether only chat messages should be stored. If false, messages like subscriptions, hosts, joins, parts, etc. will also be stored. false

Note that the example OAuth token is not an actual token, but merely a generated string to give an indication what it might look like.

I got my real OAuth token from https://twitchapps.com/tmi/.


Requirements

Among these modules is my own TwitchWebsocket wrapper, which makes making a Twitch chat bot a lot easier. This repository can be seen as an implementation using this wrapper.


Other Twitch Bots

About

Twitch bot to save API information from chat messages and more in a database.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages