Add project color to embed accent color (#522)
Closes #521 Co-authored-by: Geometrically <18202329+Geometrically@users.noreply.github.com>
This commit is contained in:
parent
2c942c8809
commit
9afdc55416
218
sqlx-data.json
218
sqlx-data.json
@ -818,6 +818,118 @@
|
||||
},
|
||||
"query": "\n INSERT INTO payouts_values (user_id, mod_id, amount, created)\n VALUES ($1, $2, $3, $4)\n "
|
||||
},
|
||||
"19a10db455e4ce793ded0d93ef7b6b69980bf7ee79a1fb2afa174a9031500da1": {
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"name": "id",
|
||||
"ordinal": 0,
|
||||
"type_info": "Int8"
|
||||
},
|
||||
{
|
||||
"name": "title",
|
||||
"ordinal": 1,
|
||||
"type_info": "Varchar"
|
||||
},
|
||||
{
|
||||
"name": "description",
|
||||
"ordinal": 2,
|
||||
"type_info": "Varchar"
|
||||
},
|
||||
{
|
||||
"name": "color",
|
||||
"ordinal": 3,
|
||||
"type_info": "Int4"
|
||||
},
|
||||
{
|
||||
"name": "icon_url",
|
||||
"ordinal": 4,
|
||||
"type_info": "Varchar"
|
||||
},
|
||||
{
|
||||
"name": "slug",
|
||||
"ordinal": 5,
|
||||
"type_info": "Varchar"
|
||||
},
|
||||
{
|
||||
"name": "client_side_type",
|
||||
"ordinal": 6,
|
||||
"type_info": "Varchar"
|
||||
},
|
||||
{
|
||||
"name": "server_side_type",
|
||||
"ordinal": 7,
|
||||
"type_info": "Varchar"
|
||||
},
|
||||
{
|
||||
"name": "project_type",
|
||||
"ordinal": 8,
|
||||
"type_info": "Varchar"
|
||||
},
|
||||
{
|
||||
"name": "username",
|
||||
"ordinal": 9,
|
||||
"type_info": "Varchar"
|
||||
},
|
||||
{
|
||||
"name": "avatar_url",
|
||||
"ordinal": 10,
|
||||
"type_info": "Varchar"
|
||||
},
|
||||
{
|
||||
"name": "categories",
|
||||
"ordinal": 11,
|
||||
"type_info": "VarcharArray"
|
||||
},
|
||||
{
|
||||
"name": "loaders",
|
||||
"ordinal": 12,
|
||||
"type_info": "VarcharArray"
|
||||
},
|
||||
{
|
||||
"name": "versions",
|
||||
"ordinal": 13,
|
||||
"type_info": "Jsonb"
|
||||
},
|
||||
{
|
||||
"name": "gallery",
|
||||
"ordinal": 14,
|
||||
"type_info": "VarcharArray"
|
||||
},
|
||||
{
|
||||
"name": "featured_gallery",
|
||||
"ordinal": 15,
|
||||
"type_info": "VarcharArray"
|
||||
}
|
||||
],
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int8",
|
||||
"TextArray",
|
||||
"Text"
|
||||
]
|
||||
}
|
||||
},
|
||||
"query": "\n SELECT m.id id, m.title title, m.description description, m.color color,\n m.icon_url icon_url, m.slug slug, cs.name client_side_type, ss.name server_side_type,\n pt.name project_type, u.username username, u.avatar_url avatar_url,\n ARRAY_AGG(DISTINCT c.category) filter (where c.category is not null) categories,\n ARRAY_AGG(DISTINCT lo.loader) filter (where lo.loader is not null) loaders,\n JSONB_AGG(DISTINCT jsonb_build_object('id', gv.id, 'version', gv.version, 'type', gv.type, 'created', gv.created, 'major', gv.major)) filter (where gv.version is not null) versions,\n ARRAY_AGG(DISTINCT mg.image_url) filter (where mg.image_url is not null and mg.featured is false) gallery,\n ARRAY_AGG(DISTINCT mg.image_url) filter (where mg.image_url is not null and mg.featured is true) featured_gallery\n FROM mods m\n LEFT OUTER JOIN mods_categories mc ON joining_mod_id = m.id AND mc.is_additional = FALSE\n LEFT OUTER JOIN categories c ON mc.joining_category_id = c.id\n LEFT OUTER JOIN versions v ON v.mod_id = m.id AND v.status != ANY($2)\n LEFT OUTER JOIN game_versions_versions gvv ON gvv.joining_version_id = v.id\n LEFT OUTER JOIN game_versions gv ON gvv.game_version_id = gv.id\n LEFT OUTER JOIN loaders_versions lv ON lv.version_id = v.id\n LEFT OUTER JOIN loaders lo ON lo.id = lv.loader_id\n LEFT OUTER JOIN mods_gallery mg ON mg.mod_id = m.id\n INNER JOIN project_types pt ON pt.id = m.project_type\n INNER JOIN side_types cs ON m.client_side = cs.id\n INNER JOIN side_types ss ON m.server_side = ss.id\n INNER JOIN team_members tm ON tm.team_id = m.team_id AND tm.role = $3 AND tm.accepted = TRUE\n INNER JOIN users u ON tm.user_id = u.id\n WHERE m.id = $1\n GROUP BY m.id, cs.id, ss.id, pt.id, u.id;\n "
|
||||
},
|
||||
"19bcfcd376172d2b293e86e9dd69ee778f7447ae708fd0c3c70239d2c8b6a419": {
|
||||
"describe": {
|
||||
"columns": [
|
||||
@ -4363,112 +4475,6 @@
|
||||
},
|
||||
"query": "\n INSERT INTO mods_gallery (\n mod_id, image_url, featured, title, description, ordering\n )\n VALUES (\n $1, $2, $3, $4, $5, $6\n )\n "
|
||||
},
|
||||
"86720f27dbb8ce88ec10603c69c15bde44d9faf203fc235f08a4840922e94a8f": {
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"name": "id",
|
||||
"ordinal": 0,
|
||||
"type_info": "Int8"
|
||||
},
|
||||
{
|
||||
"name": "title",
|
||||
"ordinal": 1,
|
||||
"type_info": "Varchar"
|
||||
},
|
||||
{
|
||||
"name": "description",
|
||||
"ordinal": 2,
|
||||
"type_info": "Varchar"
|
||||
},
|
||||
{
|
||||
"name": "icon_url",
|
||||
"ordinal": 3,
|
||||
"type_info": "Varchar"
|
||||
},
|
||||
{
|
||||
"name": "slug",
|
||||
"ordinal": 4,
|
||||
"type_info": "Varchar"
|
||||
},
|
||||
{
|
||||
"name": "client_side_type",
|
||||
"ordinal": 5,
|
||||
"type_info": "Varchar"
|
||||
},
|
||||
{
|
||||
"name": "server_side_type",
|
||||
"ordinal": 6,
|
||||
"type_info": "Varchar"
|
||||
},
|
||||
{
|
||||
"name": "project_type",
|
||||
"ordinal": 7,
|
||||
"type_info": "Varchar"
|
||||
},
|
||||
{
|
||||
"name": "username",
|
||||
"ordinal": 8,
|
||||
"type_info": "Varchar"
|
||||
},
|
||||
{
|
||||
"name": "avatar_url",
|
||||
"ordinal": 9,
|
||||
"type_info": "Varchar"
|
||||
},
|
||||
{
|
||||
"name": "categories",
|
||||
"ordinal": 10,
|
||||
"type_info": "VarcharArray"
|
||||
},
|
||||
{
|
||||
"name": "loaders",
|
||||
"ordinal": 11,
|
||||
"type_info": "VarcharArray"
|
||||
},
|
||||
{
|
||||
"name": "versions",
|
||||
"ordinal": 12,
|
||||
"type_info": "Jsonb"
|
||||
},
|
||||
{
|
||||
"name": "gallery",
|
||||
"ordinal": 13,
|
||||
"type_info": "VarcharArray"
|
||||
},
|
||||
{
|
||||
"name": "featured_gallery",
|
||||
"ordinal": 14,
|
||||
"type_info": "VarcharArray"
|
||||
}
|
||||
],
|
||||
"nullable": [
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
],
|
||||
"parameters": {
|
||||
"Left": [
|
||||
"Int8",
|
||||
"TextArray",
|
||||
"Text"
|
||||
]
|
||||
}
|
||||
},
|
||||
"query": "\n SELECT m.id id, m.title title, m.description description,\n m.icon_url icon_url, m.slug slug, cs.name client_side_type, ss.name server_side_type,\n pt.name project_type, u.username username, u.avatar_url avatar_url,\n ARRAY_AGG(DISTINCT c.category) filter (where c.category is not null) categories,\n ARRAY_AGG(DISTINCT lo.loader) filter (where lo.loader is not null) loaders,\n JSONB_AGG(DISTINCT jsonb_build_object('id', gv.id, 'version', gv.version, 'type', gv.type, 'created', gv.created, 'major', gv.major)) filter (where gv.version is not null) versions,\n ARRAY_AGG(DISTINCT mg.image_url) filter (where mg.image_url is not null and mg.featured is false) gallery,\n ARRAY_AGG(DISTINCT mg.image_url) filter (where mg.image_url is not null and mg.featured is true) featured_gallery\n FROM mods m\n LEFT OUTER JOIN mods_categories mc ON joining_mod_id = m.id AND mc.is_additional = FALSE\n LEFT OUTER JOIN categories c ON mc.joining_category_id = c.id\n LEFT OUTER JOIN versions v ON v.mod_id = m.id AND v.status != ANY($2)\n LEFT OUTER JOIN game_versions_versions gvv ON gvv.joining_version_id = v.id\n LEFT OUTER JOIN game_versions gv ON gvv.game_version_id = gv.id\n LEFT OUTER JOIN loaders_versions lv ON lv.version_id = v.id\n LEFT OUTER JOIN loaders lo ON lo.id = lv.loader_id\n LEFT OUTER JOIN mods_gallery mg ON mg.mod_id = m.id\n INNER JOIN project_types pt ON pt.id = m.project_type\n INNER JOIN side_types cs ON m.client_side = cs.id\n INNER JOIN side_types ss ON m.server_side = ss.id\n INNER JOIN team_members tm ON tm.team_id = m.team_id AND tm.role = $3 AND tm.accepted = TRUE\n INNER JOIN users u ON tm.user_id = u.id\n WHERE m.id = $1\n GROUP BY m.id, cs.id, ss.id, pt.id, u.id;\n "
|
||||
},
|
||||
"868c29019bd7e9ad71fb3515ca3489304ade3f6ebe3f77c018a8a521a96fb41f": {
|
||||
"describe": {
|
||||
"columns": [
|
||||
|
||||
@ -78,7 +78,7 @@ pub async fn send_discord_webhook(
|
||||
let row =
|
||||
sqlx::query!(
|
||||
"
|
||||
SELECT m.id id, m.title title, m.description description,
|
||||
SELECT m.id id, m.title title, m.description description, m.color color,
|
||||
m.icon_url icon_url, m.slug slug, cs.name client_side_type, ss.name server_side_type,
|
||||
pt.name project_type, u.username username, u.avatar_url avatar_url,
|
||||
ARRAY_AGG(DISTINCT c.category) filter (where c.category is not null) categories,
|
||||
@ -222,7 +222,7 @@ pub async fn send_discord_webhook(
|
||||
title: project.title,
|
||||
description: project.description,
|
||||
timestamp: Utc::now(),
|
||||
color: 0x1bd96a,
|
||||
color: project.color.unwrap_or(0x1bd96a) as u32,
|
||||
fields,
|
||||
thumbnail: DiscordEmbedThumbnail {
|
||||
url: project.icon_url,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user