Skip to content
/ cfspy Public

A simple Codeforces utility bot for Discord

License

Notifications You must be signed in to change notification settings

meooow25/cfspy

Repository files navigation

CFSpy

go-badgeserver-count-badge

A simple Codeforces utility bot for Discord

Who is this for?

If you have a Discord server where you discuss Codeforces, you could use this bot.

Features

Embed previews for Codeforces links on Discord are usually not helpful, because Codeforces does not have the meta tags that Discord looks for.
You can let CFSpy watch for these links instead and respond with useful previews. Supported links include

  • Blogs: Shows the blog information and content.
  • Comments: Shows the comment information and content.
  • Problems: Shows some information about the problem.
  • Profiles: Shows some information about the user profile.
  • Submissions: Shows some information about the submission.
  • Submissions with line numbers: Shows a snippet from the submission containing the specified lines. Install this userscript to get line selection and highlighting support in your browser.

To make CFSpy ignore links wrap them in <>, this is also how Discord's default embeds work.

To answer the common question "Is Codeforces down?", there is a command to ping codeforces.com.

Sample

screenshot

Use it

Invite the bot to your server

Click here to authorize the bot. CFSpy requires the Manage messages permission to remove the default embeds.

If you get an error... It may be because the bot is already in 100 servers, and Discord does not allow a bot to be in more than 100 servers without verification. Discord requires a real-life ID of the developer to verify a bot, which is simply ridiculous. If you agree, consider showing your support on this article, but to be honest I don't expect them to do anything about it.
I'm sorry if you aren't able to add the bot because of this, but feel free to run your own instance (see below).

Or run your own instance

  1. To set up a Discord bot, follow these steps.
  2. With Go ≥1.14 installed, run
$ GO111MODULE=on go get github.com/meooow25/cfspy@latest
$ TOKEN=<your_bot_token> cfspy

Thanks

aryanc403 for the original idea 💡
git-the-lines which was the inspiration for submission snippets

About

A simple Codeforces utility bot for Discord

Topics

Resources

License

Stars

Watchers

Forks

Languages