Skip to content

k5342/discord-new-emoji-notifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

discord-new-emoji-notifier

A simple discord bot to notify new emojis

Example

Installation & Run

cp .env{.example,}
$EDITOR .env # issue a BOT_TOKEN from Discord Developer Portal
go mod tidy
go run main.go

An invitation link is formatted as here; using client_id you can get from Discord Developer Portal:

https://discord.com/oauth2/authorize?client_id=<client_id>&scope=bot&permissions=2048

After joining to your server, use /register command at a channel where you want the bot to notify new emojis to register as a notification channel. use /unregister command to remove from notification list.

TODO(s)

  • rename to a cool name (current: discord-new-emoji-notifier)

Design

To group notifications each polling window, this implementation follows Producer-Consumer pattern

Producer: watch gateway event and register notification queue

  1. Watch GuildEmojiUpdate sent from Gateway Event
  2. Triggers pushEmojiToQueue() to push notifyRequest

Consumer: send a notification on new emojis to a pre-defined channel

  1. Get the notifyRequest pushed by the producer
  2. Register the notifyRequest to a notifyQueue
  3. (every N minutes) Get requests from the notifyQueue and send a message to the channel

About

A simple discord bot to notify new emojis

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages