Coder Social home page Coder Social logo

trevorcow / discord_photo_bot Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 106 KB

A discord bot for my photography class that pulls all the images from the discord and displays them in a easier to view gallery.

JavaScript 13.68% HTML 4.06% CSS 5.69% Rust 75.29% Python 1.28%

discord_photo_bot's Introduction

Photo Gallery Building Discord Bot

This project is a Discord bot built in Rust. It was created as a project for my photography class and as a way to practice the Rust programming language.

Features

  • The bot allows users to build a image gallery website by sending commands.
  • The bot will build a static website that can be hosted by any basic webserver. (Includes a super simple python webserver)
  • Downloads and scales images into local cache for faster page loading.

Getting Started

To run this project, you will need to have Rust and Cargo installed on your machine. You will also need to create a Discord bot and get its API token.

  1. Invite your bot to your Discord server.

    1. The discord bot expects your server to be set up like my photography class. (See example below)
  2. Clone the repository: git clone https://github.com/trevorcow/discord_photo_bot

  3. Set the following environment variables: DISCORD_TOKEN=YOUR_DISCORD_BOT_TOKEN

  4. Start the discord bot run: cargo run --release

  5. You should now see your discord bot online, you can type /collectphotos in any channel that belongs to a channel category and it will build the website files.

Discord server setup example

In order for this bot to correctly build websites, it need the server to be set up similar to my photography class.

Note that the names do not matter, and the command can be run from assignment-1 or any of the photographers channels, but I recommend running it from the main assignment channel. Gallery names are parsed from the channel names, so firstname-lastname will parse into Firstname Lastname

Example Discord Setup

Built With

  • Rust - The programming language used
  • Cargo - The package manager for Rust
  • Main libraries (crates)
    • serenity - For the discord bot
    • handlebars - For dynamically building the webpages
    • reqwest - For downloading the images for thumbnails
    • image - For compressing and resizing the thumbnail images

Contributing

If you are interested in contributing to this project, please feel free to open a pull request or issue.

Acknowledgments

  • Photography class for providing the inspiration for this project
  • Rust community for providing helpful resources and support.
  • ChatGPT for writing README.md file. Yes it wrote almost the whole thing, I just cleaned it up and fixed some links

discord_photo_bot's People

Contributors

trevorcow avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.