Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bbriggs/a6b27ab8748f22cac4c53dcaa2c2a05c to your computer and use it in GitHub Desktop.
Save bbriggs/a6b27ab8748f22cac4c53dcaa2c2a05c to your computer and use it in GitHub Desktop.

Feature: Remind Users to Register if they have not already

Description

The primary channel in secops is now +R. New users may not be immediately aware that they need to register in order to join the channel. Bitbot should have a module that checks a user's registration status and prompts them to register in order to join #main (or any official channels)

Logic

This trigger should send under the following circumstances:

  1. Within 60 seconds after a new nick connects that is not in NickServ
  2. Never if a nick connects that is already in NickServ.
  3. Never if a user is logged into NickServ

Implementation

Because the trigger could be potentially blocking, the timer should be fired off as a goroutine.

go registrationReminder(irc, msg)

This goroutine would handle the waiting period before the user is reminded to register in order to join #main

Status checks would be performed by querying Nickserv for status.

	status-code is one of the following:

	    0 - no such user online or nickname not registered
	    1 - user not recognized as nickname's owner
	    2 - user recognized as owner via access list only
	    3 - user recognized as owner via password identification

Reminders should be sent for a status 0 only.

For the sake of testability, reminders and status checks should be handled in discrete functions outside of the trigger.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment