Remove need to supply webhook avatar
This commit is contained in:
parent
734a39a001
commit
4416e5d175
2
.gitignore
vendored
2
.gitignore
vendored
@ -2,6 +2,4 @@
|
|||||||
.env
|
.env
|
||||||
/venv
|
/venv
|
||||||
.cargo
|
.cargo
|
||||||
assets
|
|
||||||
out.json
|
|
||||||
/.idea
|
/.idea
|
||||||
|
@ -17,7 +17,6 @@ You'll need rustc and cargo for compilation. To run, you'll need Python 3 still
|
|||||||
6. Run migrations: `sqlx migrate run`.
|
6. Run migrations: `sqlx migrate run`.
|
||||||
7. Set environment variables:
|
7. Set environment variables:
|
||||||
* `DATABASE_URL` - the URL of your MySQL database (`mysql://user[:password]@domain/database`)
|
* `DATABASE_URL` - the URL of your MySQL database (`mysql://user[:password]@domain/database`)
|
||||||
* `WEBHOOK_AVATAR` - accepts the name of an image file located in `$CARGO_MANIFEST_DIR/assets/` to be used as the avatar when creating webhooks. **IMPORTANT: image file must be 128x128 or smaller in size**
|
|
||||||
8. Build: `cargo build --release`
|
8. Build: `cargo build --release`
|
||||||
|
|
||||||
### Compiling for other target
|
### Compiling for other target
|
||||||
|
BIN
assets/webhook.jpg
Normal file
BIN
assets/webhook.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
@ -17,12 +17,8 @@ use regex::Regex;
|
|||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
pub static ref DEFAULT_AVATAR: AttachmentType<'static> = (
|
pub static ref DEFAULT_AVATAR: AttachmentType<'static> = (
|
||||||
include_bytes!(concat!(
|
include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/assets/webhook.jpg")) as &[u8],
|
||||||
env!("CARGO_MANIFEST_DIR"),
|
"webhook.jpg",
|
||||||
"/assets/",
|
|
||||||
env!("WEBHOOK_AVATAR", "WEBHOOK_AVATAR not provided for compilation")
|
|
||||||
)) as &[u8],
|
|
||||||
env!("WEBHOOK_AVATAR"),
|
|
||||||
)
|
)
|
||||||
.into();
|
.into();
|
||||||
pub static ref REGEX_CHANNEL_USER: Regex = Regex::new(r#"\s*<(#|@)(?:!)?(\d+)>\s*"#).unwrap();
|
pub static ref REGEX_CHANNEL_USER: Regex = Regex::new(r#"\s*<(#|@)(?:!)?(\d+)>\s*"#).unwrap();
|
||||||
|
Loading…
Reference in New Issue
Block a user