Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.
/ vxbot_shuttle Public archive

Unfortunately, this Discord bot would not have been created if it weren't for Elon Musk's wrongdoings, so I have complicated feelings about Shuttle, Serenity, and PostgreSQL being able to convert links embedded in Discord to Fx/Vx bots.

Notifications You must be signed in to change notification settings

raiga0310/vxbot_shuttle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord Bot

This is a Discord bot built using Serenity and PostgreSQL. It has the following features:

Commands

  • get - Get the user's current mode (fx or vx)
  • set <mode> - Set the user's mode to either fx or vx
  • help - Display help text

Modes

The bot supports two modes:

  • fx - Links will unfurl to fxtwitter.com
  • vx - Links will unfurl to vxtwitter.com

The default mode is vx.

Database

The bot uses PostgreSQL to store user modes. It has a simple modes table with guild_id, user_id, and mode columns. Configuration

The bot requires a DISCORD_TOKEN environment variable or secret containing a valid Discord bot token.

Running

cargo run

This will run the migrations before starting the bot.

Deployment

The bot is set up to deploy easily on Shuttle. Just push to Shuttle and it will run the migrations and start the bot automatically.

Secrets

Before you deploy, you must set discord token in Secrets.toml:

DISCORD_TOKEN="You can get discord_token from your dashboard on discord developer portal"

Deploy!!

You required install cargo-shuttle

$ cargo install cargo-shuttle

and deploy

$ cargo shuttle deploy

Disable idling

The shuttle project will be idled if the project has no request for the recent 30 minutes (According to site). So, you can avoid project idling to be disabled timeout-minutes.

# on your shuttle project already has deployed
$ cargo shuttle project restart --timeout-minutes 0

if you want to confirm timeout-minutes, do this:

$ cargo shuttle project status

About

Unfortunately, this Discord bot would not have been created if it weren't for Elon Musk's wrongdoings, so I have complicated feelings about Shuttle, Serenity, and PostgreSQL being able to convert links embedded in Discord to Fx/Vx bots.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages