Skip to content

Repository files navigation

Glyfi Bot

Discord bot for the Glyphs & Alphabets server.

The goal of this project is to encourage very collaborative development on this bot.

Current functionality:

  • /emoji: See which emoji marks something as a submission in this channel.

  • /set-emoji submission: Set the emoji for this channel that will mark something as a submission.

    • Leave empty to remove the emoji for this channel.
    • With no submission emoji configured, the selectors cannot select!
    • Only Administrators can run this command, by default.
  • /set-emoji disqualification: Set the emoji for this channel that will mark something as disqualified in this channel.

    • Leave empty to remove the emoji for this channel.
    • With no disqualification emoji configured, the selectors will still select!
    • Only Administrators can run this command, by default.
  • /set-dupe-notif-channel: Set up in which channel the Moderation Notifications for the Duplicate Message Cleaner will be sent.

    • If unset, it will notify (without any details) in the first channel that has "general" in the name.
    • Leave empty to unset the notification channel. It will go back to being like ↑
    • Only Administrators can run this command, by default.
    • If /set-mod-ping is set, it will ping the mods when a duplicate message is found.
  • /set-mod-ping: Set up a pingable role (or user) who may be pinged whenever there's something that the mods should look at ASAP.

    • If unset, no mods can be pinged at critical moments, so it is highly recommended that this is set up!
    • Leave empty to unset the pingable role. It will go back to being like ↑
    • Only Administrators can run this command, by default.
  • /set-rules-channel: Set up in which channel the rules will be posted and updated.

    • It will check for updates every hour.
    • Leave empty to unset the rules channel. It will delete all its messages from that channel as cleanup.
    • Only Administrators can run this command, by default
  • /typst announcement: Generates an announcement image with our Typst script.

    • challenge_type: Which challenge this image is for.
    • input: The "content" of the challenge; the glyph for the Glyph Challenge, and the ambigram for the Ambigram Challenge.
    • current_week: The week number to generate this image for. (Last week plus one)
    • start_date: (Optional) The start date of this challenge. (Format: YYYY-MM-DD)
      • Default: Uses the Typst Script's default (Today)
    • end_date: (Optional) The end date of this challenge. (Format: YYYY-MM-DD)
      • Default: Uses the Typst Script's default (Today + 7 days)
    • output_format: (Optional) Whether the output as PNG, PDF, or both.
      • Default: Generates only a PNG
    • ppi: (Optional) The PPI of the generated PNG.
      • Default: Uses Typst's own default (144).
    • Only Administrators can run this command, by default.
  • /typst showcase: Generates a showcase image with our Typst script.

    • challenge_type: Which challenge this image is for.
    • input: The "content" of the challenge; the glyph for the Glyph Challenge, and the ambigram for the Ambigram Challenge.
    • current_week: The week number to generate this image for. (Last week plus one)
    • start: The Message ID of the message from where to start looking for submissions.
      Only messages that have been reacted to with the emoji set with /set-emoji by their authors will be counted.
    • end: (Optional) The Message ID of the message from where to stop looking for submissions.
      • Default: "Now"; the command will look from start until the bottom.
    • columns: (Optional) In how many columns to split the submission images.
      • Default: Uses the Typst Script's default (3).
    • start_date: (Optional) The start date of this challenge. (Format: YYYY-MM-DD)
      • Default: Uses the Typst Script's default (Today - 7 days)
    • end_date: (Optional) The end date of this challenge. (Format: YYYY-MM-DD)
      • Default: Uses the Typst Script's default (Today)
    • output_format: (Optional) Whether the output as PNG, PDF, or both.
      • Default: Generates only a PNG
    • ppi: (Optional) The PPI of the generated PNG.
      • Default: Uses Typst's own default (144).
    • Only Administrators can run this command, by default.
  • /typst winners: Generates a winners image with our Typst script.

    • challenge_type: Which challenge this image is for.
    • current_week: The week number to generate this image for. (Last week plus one)
    • first_place: The Message ID of the winning submission.
    • second_place: (Optional) The Message ID of the second place submission.
    • third_place: (Optional) The Message ID of the third place submission.
    • first_place_name_override: (Optional) If the automatically collected username does not look good, you can override it with this option.
    • second_place_name_override: (Optional) ↑ditto
    • third_place_name_override: (Optional) ↑ditto
    • output_format: (Optional) Whether the output as PNG, PDF, or both.
      • Default: Generates only a PNG
    • ppi: (Optional) The PPI of the generated PNG.
      • Default: Uses Typst's own default (144).
    • Only Administrators can run this command, by default.
  • /vote-react: Automatically adds voting reactions to a message.

    • messages: The message(s) to add the reactions to. If multiple, separate with spaces.
    • amount: The amount of voting reactions to add
    • Only Administrators can run this command, by default.
  • /sticky: Sets a sticky message for this channel. This message will always be visible at the bottom of the channel.

    • Leave empty to remove the sticky message for this channel.
    • Only Administrators can run this command, by default.
  • /pfps: Get the profile pictures of one or multiple users in bulk.

    • Only Administrators can run this command, by default.
  • /select: Provide the IDs of two messages in the channel between where to look for submissions.
    Submissions will be collected and provided in one message, for extra easy downloading!

    • Only messages that have been reacted to with the emoji set with /set-emoji by their authors will be counted.
    • Only Administrators can run this command, by default.

Command Permissions

To allow a specific role to run these commands instead of just Administrators, go to your Server Settings > APPS: Integrations > GlyfiBot: Manage.
In here, choose each the command you wish to assign a role to, and then click Add roles or members.

Click to see these steps in screenshots

Running

  1. Create a new Bot in the Discord Developer Panel (You can follow the Step 1 from here)
  2. Download a build from GitHub Releases OR Clone this repository and build it
  3. Optionally set the token with the GLYFI_TOKEN environment variable.
    If you do not do this, the bot will ask you to paste in the key, which it will then store in its data folder for the subsequent runs.
  4. Run the bot executable (double-click or $ ./GlyfiBot)

Tech Stack

For the Programming Language, I chose C#, because it is relatively accessible for any programmer.

For the Discord Library, I chose Netcord, because it looked pretty good.

Building locally

Due to using the SixLabors.ImageSharp library for generating some of the images, building is more difficult than normal.
We have received a licence file, but we cannot safely provide this publicly, so if you want to build it locally, you will have to acquire one for yourself.
Sorry for this inconvenicence.

For members of the glyphs-fi organization, please clone this repository recursively, to get the licences repository with the licence file in it.

About

Discord bot for the Glyphs & Alphabets server.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages