nillagoober_tv
is a Go project running in Azure that serves as nillagoober's personal hype-man. It's purpose is to post to social media when nillagoober
goes live on Twitch and generally promote the streamer at least once a day. It currently is being purposed as a bot on Discord, but will branch to also use social media as a platform for promotion in the near future.
All commands in this list are to be preceeded by !!
. At some point I'd like to have this to be paramaterized so it can be customized.
help
- Prints a message directing a user to this GitHub project for command references.pepega
- Printspepega clap
to a Discord channel. Good for Chiddy.viewers
- This command interacts with the Twitch API to gather the amount of current viewers watching the stream, and sends the number to a Discord channel. Note: This command will crash the bot if the stream isn't running. Working on better handling of the Twitch HTTP response.
Lots more coming soon.
In a real world scenario, I'm running this project in Azure, provisioning a single server instance with Terraform. This is obviously not required, but if running like I'm running it is desired, then follow the steps in this section.
- Terraform is installed
- Azure cloud shell is installed
- An Azure account (you need to put a subscription ID from your account in
main.tf
)
After cloning this repository to your system (make sure you are logged into your Azure account with az login
before attempting):
- In this repo's directory on your system, run
terraform init
. This command will create a.terraform
directory using context from themain.tf
file and store information such as plugins. - Next, run
terraform plan
. This will prompt Terraform to create and show you what it intends to do on the Azure side to provision your infrasture. You can optionally save this plan to a file using the-out
flag. - Once a plan is generated by Terraform, all that is left is to apply it which actually executes the generated plan from the previous step.
terraform apply
will provision the infrastructure as it has presented it to you. Optionally set-auto-approve
to not have to answer yes at the prompt.
At this point, Terraform has created everything up to and including a virtual machine. What's next is getting go
installed and configured for the project to run successfully.
Since I have Azure setup to install Ubuntu as the OS on my VM that will host the project, I will only be covering install and configuring go
on Ubuntu systems. If you are using a different distribution of Linux, please see this page.
-
Install
go
by runningsudo apt install golang-go -y
. -
For Go to work properly, one must set the
go
executable path:export PATH=$PATH:/usr/local/go/bin
This can either be run as a separate command, though it won't be persistent across sessions, or it can be added to your
~/.profile
for persistency. Test thego
installation withgo version
. If the system complains about not having a proper path set, see this document. -
Now that
go
is installed and configured for execution, rungo get github.com/serverislife/nillagoober
to havego
pull this repository and put it in your$GOPATH
. -
Navigate to the newly pulled project in your
$GOPATH
. This directory should be$GOPATH/src/github.com/serverislife/nillagoober
. -
Compile an executable by running
go build
. This will create an executable in the project directory with the same name as the project itself,nillagoober
. -
At this point, all that is left is to run the bot.
nillagoober -t <token>
. The-t
flag allows you to pass a Discord bot token as an argument to the command. This means that to run this bot, you will need to have registered a bot with discord, given it permissions, and invited it to your server (see the TODO section for more details).
- Write more Twitch interactive functions
- Update README with Go information
- Parameterize input in
main.tf
- Write documentation on how to simply invite the bot and have it run from my infrastructure (so no
go
orAzure
knowledge is required). - Write section on how to create a Discord bot/get bot token.