Skip to content

Commit

Permalink
Merge branch 'release/1.1.0-alpha.11'
Browse files Browse the repository at this point in the history
  • Loading branch information
nekofar committed Nov 20, 2023
2 parents 3255cfa + 87f0711 commit d3d5a5d
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 18 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to this project will be documented in this file.

## [1.1.0-alpha.11] - 2023-11-20

### Revert

- Update date format to use Utc timestamp across discord handlers

## [1.1.0-alpha.10] - 2023-11-19

### Refactor
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lilnouns-bots"
version = "1.1.0-alpha.10"
version = "1.1.0-alpha.11"
authors = ["Milad Nekofar <milad@nekofar.com>"]
edition = "2021"
description = "Our bots are designed to keep the Lil Nouns DAO community informed and engaged."
Expand Down
6 changes: 3 additions & 3 deletions src/lil_nouns/handler/discord.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use async_trait::async_trait;
use chrono::Utc;
use chrono::Local;
use header::CONTENT_TYPE;
use log::{error, info};
use reqwest::{header, Client};
Expand Down Expand Up @@ -68,7 +68,7 @@ impl Handler for DiscordHandler {
info!("Handling new proposal: {}", proposal.title);

let url = format!("{}/{}", self.base_url, proposal.id);
let date = format!("<t:{}:R>", Utc::now().timestamp());
let date = Local::now().format("%m/%d/%Y %I:%M %p").to_string();
let wallet = get_domain_name(&proposal.proposer)
.await
.unwrap_or(get_short_address(&proposal.proposer));
Expand Down Expand Up @@ -111,7 +111,7 @@ impl Handler for DiscordHandler {
.clone();

let url = format!("{}/{}", self.base_url, proposal.id);
let date = format!("<t:{}:R>", Utc::now().timestamp());
let date = Local::now().format("%m/%d/%Y %I:%M %p").to_string();
let wallet = get_domain_name(&vote.voter)
.await
.unwrap_or(get_short_address(&vote.voter));
Expand Down
6 changes: 3 additions & 3 deletions src/meta_gov/handler/discord.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use async_trait::async_trait;
use chrono::Utc;
use chrono::Local;
use log::{error, info};
use regex::Regex;
use reqwest::{header, Client};
Expand Down Expand Up @@ -90,7 +90,7 @@ impl Handler for DiscordHandler {
info!("Handling new proposal: {}", proposal_title);

let url = format!("{}/{}", self.base_url, proposal_id);
let date = format!("<t:{}:R>", Utc::now().timestamp());
let date = Local::now().format("%m/%d/%Y %I:%M %p").to_string();
let description = format!(
"A new Meta Gov proposal has been created: “{}”",
proposal_title
Expand Down Expand Up @@ -134,7 +134,7 @@ impl Handler for DiscordHandler {
info!("Handling new proposal: {}", proposal_title);

let url = format!("{}/{}", self.base_url, proposal_id);
let date = format!("<t:{}:R>", Utc::now().timestamp());
let date = Local::now().format("%m/%d/%Y %I:%M %p").to_string();
let wallet = get_domain_name(&vote.voter)
.await
.unwrap_or(get_short_address(&vote.voter));
Expand Down
8 changes: 4 additions & 4 deletions src/prop_house/handler/discord.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use async_trait::async_trait;
use chrono::Utc;
use chrono::Local;
use log::{error, info};
use reqwest::{header, Client};
use serde_json::{json, Value};
Expand Down Expand Up @@ -71,7 +71,7 @@ impl Handler for DiscordHandler {
self.base_url,
auction.title.replace(' ', "-").to_lowercase()
);
let date = format!("<t:{}:R>", Utc::now().timestamp());
let date = Local::now().format("%m/%d/%Y %I:%M %p").to_string();
let description = format!(
"A new Prop House round has been created: “{}”",
auction.title
Expand Down Expand Up @@ -111,7 +111,7 @@ impl Handler for DiscordHandler {
auction.title.replace(' ', "-").to_lowercase(),
proposal.id
);
let date = format!("<t:{}:R>", Utc::now().timestamp());
let date = Local::now().format("%m/%d/%Y %I:%M %p").to_string();
let wallet = get_domain_name(&proposal.address)
.await
.unwrap_or(get_short_address(&proposal.address));
Expand Down Expand Up @@ -159,7 +159,7 @@ impl Handler for DiscordHandler {
proposal.title.replace(' ', "-").to_lowercase(),
proposal.id
);
let date = format!("<t:{}:R>", Utc::now().timestamp());
let date = Local::now().format("%m/%d/%Y %I:%M %p").to_string();
let wallet = get_domain_name(&vote.address)
.await
.unwrap_or(get_short_address(&vote.address));
Expand Down
8 changes: 4 additions & 4 deletions src/prop_lot/handler/discord.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use async_trait::async_trait;
use chrono::Utc;
use chrono::Local;
use log::{error, info};
use reqwest::{header, Client};
use serde_json::{json, Value};
Expand Down Expand Up @@ -66,7 +66,7 @@ impl Handler for DiscordHandler {
async fn handle_new_idea(&self, idea: &Idea) -> Result<()> {
info!("Handling new idea: {}", idea.title);

let date = format!("<t:{}:R>", Utc::now().timestamp());
let date = Local::now().format("%m/%d/%Y %I:%M %p").to_string();
let url = format!("{}/idea/{}", self.base_url, idea.id);
let wallet = get_domain_name(&idea.creator_id)
.await
Expand Down Expand Up @@ -109,7 +109,7 @@ impl Handler for DiscordHandler {
.unwrap()
.clone();

let date = format!("<t:{}:R>", Utc::now().timestamp());
let date = Local::now().format("%m/%d/%Y %I:%M %p").to_string();
let wallet = get_domain_name(&vote.voter_id)
.await
.unwrap_or(get_short_address(&vote.voter_id));
Expand Down Expand Up @@ -158,7 +158,7 @@ impl Handler for DiscordHandler {
.clone();

let url = format!("{}/idea/{}", self.base_url, idea.id);
let date = format!("<t:{}:R>", Utc::now().timestamp());
let date = Local::now().format("%m/%d/%Y %I:%M %p").to_string();
let wallet = get_domain_name(&comment.author_id)
.await
.unwrap_or(get_short_address(&comment.author_id));
Expand Down
4 changes: 2 additions & 2 deletions src/second_market/handler/discord.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use async_trait::async_trait;
use chrono::Utc;
use chrono::Local;
use log::{error, info};
use reqwest::{header, Client};
use serde_json::{json, Value};
Expand Down Expand Up @@ -65,7 +65,7 @@ impl Handler for DiscordHandler {
async fn handle_new_floor(&self, floor: &Floor) -> Result<()> {
info!("Handling new floor: {:?}", floor.new_price);

let date = format!("<t:{}:R>", Utc::now().timestamp());
let date = Local::now().format("%m/%d/%Y %I:%M %p").to_string();
let url = match floor.clone().source.unwrap_or_else(String::new).as_str() {
"blur.io" => format!("https://blur.io/collection/{}", self.collection),
_ => format!("https://opensea.io/assets/ethereum/{}", self.collection),
Expand Down

0 comments on commit d3d5a5d

Please sign in to comment.