Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Stabilize experiments_thinking_emoji #118

Merged
merged 1 commit into from
Sep 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <me@m1sk9.dev>"]

# 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