Skip to content

This is a simple and easy to configure golang bot for connecting and bidirectionally syncing the topic of a single IRC channel to a single Discord channel.

License

Notifications You must be signed in to change notification settings

CoordSpace/topicsync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LinkedIn


Topic Sync

Low-latency IRC<->Discord Channel Topic Syncing

Written in Go

Table of Contents

About The Project

[Short Topic Sync Demo]

This is a simple, small, and easy to configure golang bot for connecting and bidirectionally syncing a single IRC channel's topic to the topic of a single Discord channel.

Any topic updates in those channels will be synced with the other nearly instantly and a topic change alert will be posted in Discord to mirror the alert normally shown in IRC.

It was made to compliment an existing kubernetes cluster of chat and site services for an independent game streaming community spread out over two chat networks. Since matterbridge doesn't support topic syncing for the time being, this was developed to fill in the feature gap.

If there is demand, this project could be extended to support multiple channels, networks, or other configuration needs so feel free to request a feature!

Built With

Getting Started

To get a local copy compiled and running follow these simple steps.

Prerequisites

  • A working Go install with a functional GOPATH
  • A Q/Nickserv account registered for the bot with auto-op/half-op set for its account in the desired IRC channel
  • Lastly, a bot account must be created in Discord and added to your Discord server with the Manage Channels permission (to be able to edit the topic)

Installation

Download the latest code into your Go directory:

cd $GOPATH
go get github.com/CoordSpace/topicsync

Once that's done, you should have a compiled binary in your /bin directory all ready to go!

Now open up a new yaml file called config.yaml and paste the contents of the config-sample.yaml file from this repo into it and edit to meet your needs.

The edited config.yaml file must be stored in one of three valid directories in order for this program to find and use it:

  • /etc/topicsync/
  • $HOME/.topicsync
  • ./ (The same directory as the binary)

Example Config.yaml

---
irc:
  server: irc.coolnetwork.chat
  port: 6667
  user: TopicBot
  nick: TopicBot
  name: A Topic Sync Bot
  # IRC channel to join (e.g. '#TopicBotTest')
  channel: '#CoolChatroom'
  # Optional - Bot name and command to auth with IRC services
  auth:
    bot: NickServ@coolnetwork.chat
    cmd: IDENTIFY foo password
discord:
  token: 'a-big-string-from-the-discord-dev-portal-bot-settings'
  # The ID of the channel to track, found using discord dev-mode 
  # and right-clicking on the channel
  channelID: '38104041843693923425'
# Topic update message formatting string for Discord
# [Emoji] Topic Updated: [This is the topic message.]
updateFormat: "%s Topic Updated: %s"
# Optional - Random Emojis for added topic update flair in Discord
emojis:
  - ⚠️
  - 🔔
...

Lastly, just run the binary. It will automatically find your config file and start connecting to the servers and channels of your choice. By default, the existing channel topics in the pair will not sync immediately upon joining. So issue a new topic on either side to get the process started.

Docker

A hyper-minimal, statically-linked Docker image is also available for fast integration into existing containerized stacks.

Just create your local config.yaml configuration from the repo's sample template and mount it to the latest Docker build with:

docker run -ti -v /path/to/config.yaml:/etc/topicsync/config.yaml coordspace/topicsync

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Chris Earley - @CoordSpace - chris@coord.space

Project Link: https://github.com/CoordSpace/topicsync

About

This is a simple and easy to configure golang bot for connecting and bidirectionally syncing the topic of a single IRC channel to a single Discord channel.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published