Parameterize the redis url

This commit is contained in:
Gabriel Simmer 2024-06-20 20:48:50 +01:00
parent 08bd8a6fd1
commit 178ca616d1
Signed by: arch
SSH key fingerprint: SHA256:m3OEcdtrnBpMX+2BDGh/byv3hrCekCLzDYMdvGEKPPQ
2 changed files with 3 additions and 4 deletions

View file

@ -49,7 +49,6 @@
config = {
Cmd = [ "${my-crate}/bin/duplikate" ];
};
architecture = system;
};
in
{
@ -74,7 +73,7 @@
docker push $amd64
docker push $arm64
docker manifest create --amend git.gmem.ca/arch/duplikate:latest $arm64 $amd64
docker manifest push git.gmem.ca/arch/duplikate:latest
docker manifest push git.gmem.ca/arch/duplikate:latest --purge
'');
};

View file

@ -155,14 +155,14 @@ impl EventHandler for Handler {
#[tokio::main]
async fn main() {
dotenv().ok();
// Login with a bot token from the environment
let redis_url = env::var("REDIS_URL").expect("Expected a Redis instance URL");
let token = env::var("DISCORD_TOKEN").expect("Expected a token in the environment");
// Set gateway intents, which decides what events the bot will be notified about
let intents = GatewayIntents::GUILD_MESSAGES
| GatewayIntents::DIRECT_MESSAGES
| GatewayIntents::MESSAGE_CONTENT;
let client = redis::Client::open("redis://127.0.0.1/").unwrap();
let client = redis::Client::open(redis_url).unwrap();
let handler = Handler { redis: client };
// Create a new instance of the Client, logging in as a bot.