Skip to content

Ryuuusuke/Sofia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sofia IRC Bot

Sofia is a lightweight IRC bot written in Go. It supports:

  • SASL authentication
  • Link title fetching (including YouTube)
  • RSS looping (modular)
  • Sending messages directly from terminal (stdin)
  • Configuration via .ini file

🔧 Configuration

Copy config.ini.example to config.ini and edit the file:

[sasl]
sasl = true
user = your-sasl-username
password = your-sasl-password

[irc]
server = irc.libera.chat:6697
nickname = sofiaaa
username = SofiaPertama
realname = Ratu Sofia
channel = `##sofia`

[github]
enabled = true
owner = Ryuuusuke
repo = Sofia

Make sure to wrap the channel value in backticks (`) so that the # character is not treated as a comment by the parser.


🚀 Running the Bot

Run directly with:

go run main.go

Or build it first:

go build -o sofia .
./sofia

🖥️ Sending Messages from Terminal

Type directly into the terminal where the bot is running to send a message to the configured IRC channel.


🌐 Link Preview Feature

  • When someone posts a link in the channel, the bot will try to fetch the page title automatically.
  • YouTube links are fetched using the YouTube oEmbed API.
  • For regular webpages, the bot uses chromedp (headless Chrome via Go) to extract the <title>.

📰 RSS Feed

You can add your own RSS modules under the rss/ folder. The bot is modular and supports custom RSS loops tailored to your needs.


🧱 Directory Structure

.
├── main.go          # Entry point
├── config.ini       # User-provided config file
├── stdin/           # Module for stdin input
├── rss/             # RSS handler module
└── go.mod           # Go module file

📦 Dependencies

  • go-ini/ini - For parsing .ini configuration files
  • chromedp - For fetching web page titles via headless Chrome
  • Go standard libraries (net, bufio, tls, regexp, etc.)

📄 License

This project is licensed under the BSD 3-Clause License. See the LICENSE file for full details.

About

Simple IRC bot written in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages