Skip to content

Commit

Permalink
Crafatar no longer likes Discord — use Minotar instead
Browse files Browse the repository at this point in the history
  • Loading branch information
fenhl committed Dec 19, 2023
1 parent cdd05d6 commit 92e127e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion crate/wurstminebot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ pub const DEV: ChannelId = ChannelId::new(506905544901001228);

/// The directory where all Wurstmineberg-related files are located: `/opt/wurstmineberg`.
pub fn base_path() -> &'static Path { //TODO make this a constant when stable
Path::new("/opt/wurstmineberg")
#[cfg(unix)] { Path::new("/opt/wurstmineberg") }
#[cfg(windows)] { Path::new("C:/Users/fenhl/games/minecraft/srv/wmb") } // for testing
}

/// Errors that may occur in this crate.
Expand Down
4 changes: 2 additions & 2 deletions crate/wurstminebot/src/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ pub async fn handle(ctx_fut: RwFuture<Context>) -> Result<Never, Error> { //TODO
async fn handle_world(ctx_fut: RwFuture<Context>, world: World) -> Result<Never, Error> {
let follower = follow(&world);
pin_mut!(follower);
let mut player_uuids = HashMap::new(); //TODO persist across wurstminebot restarts?
let mut player_uuids = HashMap::<_, Uuid>::default(); //TODO persist across wurstminebot restarts?
while let Some(line) = follower.try_next().await? {
match line {
Line::Regular { content, .. } => match content {
Expand All @@ -253,7 +253,7 @@ async fn handle_world(ctx_fut: RwFuture<Context>, world: World) -> Result<Never,
webhook.execute(&*ctx, false, {
let mut w = ExecuteWebhook::new();
if let Some(uuid) = player_uuids.get(&sender) {
w = w.avatar_url(format!("https://crafatar.com/renders/head/{}", uuid));
w = w.avatar_url(format!("https://minotar.net/armor/bust/{}/1024.png", uuid.simple()));
}
w.content(if is_action {
let mut builder = MessageBuilder::default();
Expand Down

0 comments on commit 92e127e

Please sign in to comment.