Skip to content
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
32 changes: 32 additions & 0 deletions .github/workflows/check_formatting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: check_formatting.yml

on:
push:
branches: [main]
pull_request:

jobs:
rust:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Rust (nightly)
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt, clippy

- name: Cache cargo
uses: Swatinem/rust-cache@v2

- name: Format check
run: cargo fmt -- --check

- name: Clippy
run: cargo clippy --all-targets --all-features -- -D warnings

- name: Test
run: cargo test --all-features
Comment on lines +10 to +32
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.env
.zed
Cargo.lock
target
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ authors = ["LTurret <a0919329@gmail.com>"]
edition = "2024"

[dependencies]
async-trait = "0.1.89"
dotenv = "0.15.0"
html-escape = "0.2.13"
regex = "1.12.2"
reqwest = "0.12.24"
reqwest = { version = "0.12.24", features = ["cookies", "json"] }
serde_json = "1.0.145"
serenity = { version = "0.12.4", default-features = false, features = ["client", "gateway", "rustls_backend", "model"] }
tokio = { version = "1.48.0", features = ["macros", "rt-multi-thread"] }
43 changes: 12 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# ArisaMatsuda

English|[繁體中文](./README_zh-TW.md)

A discord bot for private server management.
A discord bot for help domain content embedding.

## Configuration

Expand All @@ -12,12 +10,20 @@ Before hosting this bot directly from this repo, There are few steps need to do,

```plain
ArisaMatsuda/
├── src
│   └── main.rs
.
├── Cargo.toml
├── LICENSE
├── README.md
└── README_zh-TW.md
├── rustfmt.toml
└── src
├── main.rs
└── commands
├── author.rs
├── embed.rs
├── instagram.rs
├── mod.rs
├── threads.rs
└── twitter.rs
```

### Secrets
Expand Down Expand Up @@ -53,31 +59,6 @@ cargo build --release
./target/release/arisa_rust &
```

- Docker:

```sh
wip
```

## Roadmap

> [!NOTE]
> Some of features are removed from the list since the last Python build.
> Please refer to the main branch for more information.

There would be more tracks in the project tab!

| **File** | **Status** |
|------------------|------------------|
| **tweet_fix.py** | Work in Progress |
| _emotes.py_ | Not implemented |
| _goods.py_ | Not implemented |
| _ping.py_ | Not implemented |
| fun.py | Not implemented |
| tweet_subscribe | Not implemented |
| ~~delete.py~~ | Despreated |
| ~~join.py~~ | Despreated |

## License

Licensed under [MIT](LICENSE).
83 changes: 0 additions & 83 deletions README_zh-TW.md

This file was deleted.

4 changes: 4 additions & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
max_width = 80
tab_spaces = 4
use_small_heuristics = "Max"
reorder_imports = true
18 changes: 16 additions & 2 deletions src/commands/author.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pub struct Author {
pub url: String,
pub name: String,
pub screen_name: String,
pub icon_url: String,
pub icon_url: Option<String>,
}

impl Author {
Expand All @@ -18,7 +18,21 @@ impl Author {
url: get_string(json_data, "url"),
name: get_string(json_data, "name"),
screen_name: get_string(json_data, "screen_name"),
icon_url: get_string(json_data, "avatar_url"),
icon_url: json_data["avatar_url"].as_str().map(|s| s.to_string()),
}
}

pub fn from_str(
url: &String,
name: &String,
screen_name: &String,
icon_url: Option<String>,
) -> Self {
Self {
url: String::from(url),
name: String::from(name),
screen_name: String::from(screen_name),
icon_url,
}
}
}
Loading
Loading