Skip to content

Commit

Permalink
feat: Stabilize experiments_thinking_emoji (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
m1sk9 authored Sep 1, 2024
1 parent 377aff6 commit cbb7f4e
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 22 deletions.
5 changes: 0 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ edition = "2021"
description = "アイデア投稿履歴のリアクションを制限する Discord Bot"
authors = ["m1sk9 <[email protected]>"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
experiments_thinking_emoji = []

[dependencies]
anyhow = { version = "1.0.82" }
dotenvy = { version = "0.15.7" }
Expand Down
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ FROM rust:1.80.1-bullseye as Builder
WORKDIR /root/app
COPY --chown=root:root . .

# https://github.com/GiganticMinecraft/idea-reaction/issues/107
RUN cargo build --release --bin idea-reaction --features experiments_thinking_emoji
RUN cargo build --release --bin idea-reaction

FROM debian:bullseye-slim as Runner

Expand Down
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,3 @@
| `TARGET_CHANNEL_ID` | 監視対象チャンネルのID |
| `TARGET_WEBHOOK_ID` | 監視対象WebhookのID |
| `TARGET_GUILD_ID` | 監視対象ギルドのID |

## Feature Flags

| Feature Flag | Description |
|------------------------------|-------------------------|
| `experiments_thinking_emoji` | 付与されるリアクションに "🤔" を追加する |
4 changes: 0 additions & 4 deletions src/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@ use serenity::client::Context;
use serenity::model::channel::Message;
use typed_builder::TypedBuilder;

#[cfg(feature = "experiments_thinking_emoji")]
const REACTION_EMOJIS: [&str; 3] = ["👍", "👎", "🤔"];

#[cfg(not(feature = "experiments_thinking_emoji"))]
const REACTION_EMOJIS: [&str; 2] = ["👍", "👎"];

#[derive(TypedBuilder)]
pub struct IdeaReactionAction {
pub ctx: Context,
Expand Down
5 changes: 0 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ async fn main() -> anyhow::Result<()> {
.await
.context("Failed to create Discord client")?;

// https://github.com/GiganticMinecraft/idea-reaction/issues/107
if cfg!(feature = "experiments_thinking_emoji") {
tracing::info!("[experiments_thinking_emoji] が有効になっています. 🤔");
}

if let Err(why) = client.start().await {
println!("Failed run discord client: {:?}", why);
}
Expand Down

0 comments on commit cbb7f4e

Please sign in to comment.