Skip to content

Commit

Permalink
changed color scheme + tweak to model
Browse files Browse the repository at this point in the history
  • Loading branch information
Inspirateur committed Jan 22, 2023
1 parent 5ddc9c2 commit 20f477c
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 5 deletions.
22 changes: 20 additions & 2 deletions Cargo.lock

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

19 changes: 17 additions & 2 deletions src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ impl Handler {
trace!(target: "wordy", "/cloud: retrieved {} tokens for {}", tokens.len(), member.user.name);
let wc_tokens = self.to_wc_tokens(tokens, &ctx.http).await;
let image = WordCloud::new()
.colors(Colors::DoubleSplitCompl(convert_color(color))).generate(wc_tokens);
.colors(Colors::BiaisedRainbow {
anchor: convert_color(color),
variance: 50.
}).generate(wc_tokens);
let mut img_file = Cursor::new(Vec::new());
write_buffer_with_format(
&mut img_file,
Expand Down Expand Up @@ -138,7 +141,19 @@ impl Handler {
}

pub async fn info(&self, ctx: Context, command: ApplicationCommandInteraction) {
todo!()
if let Err(why) = command
.create_interaction_response(&ctx.http, |response| {
response
.kind(ChannelMessageWithSource)
.interaction_response_data(
|message| message.content(
"Made with ❤️ by Inspi#8989\n
Repository: <https://github.com/Inspirateur/wordy>"
)
)
}).await {
warn!(target: "wordy", "/info: Response failed with `{}`", why);
};
}

pub async fn register_guild(&self, http: Arc<Http>, guild: Guild) {
Expand Down
2 changes: 1 addition & 1 deletion src/idiom/idiom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl<P: Hash+Eq, U: Hash+Eq> Idioms<P, U> {
}
};
place_voc.add(idx, 1.);
let inctx_value = (-place_voc.get(&idx)).exp()*20.;
let inctx_value = (-place_voc.get(&idx)).exp()*10.;
user_voc.add(idx, inctx_value);
}
}
Expand Down

0 comments on commit 20f477c

Please sign in to comment.