Merge branch 'main' of https://github.com/PluralKit/PluralKit
This commit is contained in:
commit
371d677af1
14
.github/workflows/beta-bot.yml
vendored
14
.github/workflows/beta-bot.yml
vendored
@ -1,14 +0,0 @@
|
|||||||
name: "Update Beta Bot"
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [dev]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
update-bot:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: "Update Beta Bot"
|
|
||||||
uses: fjogeleit/http-request-action@master
|
|
||||||
with:
|
|
||||||
url: https://api-beta.pluralkit.me/v1/update
|
|
||||||
bearerToken: ${{ secrets.WATCHTOWER_TOKEN }}
|
|
2
.github/workflows/dashboard.yml
vendored
2
.github/workflows/dashboard.yml
vendored
@ -24,7 +24,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
# https://github.com/docker/build-push-action/issues/378
|
# https://github.com/docker/build-push-action/issues/378
|
||||||
context: .
|
context: .
|
||||||
file: Dockerfile.dashboard
|
file: dashboard/Dockerfile
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
ghcr.io/pluralkit/dashboard:${{ env.BRANCH_NAME }}
|
ghcr.io/pluralkit/dashboard:${{ env.BRANCH_NAME }}
|
||||||
|
2
.github/workflows/gateway.yml
vendored
2
.github/workflows/gateway.yml
vendored
@ -25,7 +25,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
# https://github.com/docker/build-push-action/issues/378
|
# https://github.com/docker/build-push-action/issues/378
|
||||||
context: .
|
context: .
|
||||||
file: Dockerfile.gateway
|
file: gateway/Dockerfile
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
ghcr.io/pluralkit/gateway:${{ env.BRANCH_NAME }}
|
ghcr.io/pluralkit/gateway:${{ env.BRANCH_NAME }}
|
||||||
|
3
.github/workflows/scheduled_tasks.yml
vendored
3
.github/workflows/scheduled_tasks.yml
vendored
@ -5,7 +5,6 @@ on:
|
|||||||
branches: [main]
|
branches: [main]
|
||||||
paths:
|
paths:
|
||||||
- 'scheduled_tasks/**'
|
- 'scheduled_tasks/**'
|
||||||
- 'Dockerfile.scheduled_tasks'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
@ -25,7 +24,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
# https://github.com/docker/build-push-action/issues/378
|
# https://github.com/docker/build-push-action/issues/378
|
||||||
context: .
|
context: .
|
||||||
file: Dockerfile.scheduled_tasks
|
file: scheduled_tasks/Dockerfile
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
ghcr.io/pluralkit/scheduled_tasks:${{ env.BRANCH_NAME }}
|
ghcr.io/pluralkit/scheduled_tasks:${{ env.BRANCH_NAME }}
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Google.Protobuf" Version="3.13.0"/>
|
<PackageReference Include="Google.Protobuf" Version="3.13.0"/>
|
||||||
<PackageReference Include="Grpc.Net.ClientFactory" Version="2.32.0" />
|
<PackageReference Include="Grpc.Net.ClientFactory" Version="2.32.0" />
|
||||||
<PackageReference Include="Grpc.Tools" Version="2.37.0" PrivateAssets="All"/>
|
<PackageReference Include="Grpc.Tools" Version="2.47.0" PrivateAssets="all" />
|
||||||
<PackageReference Include="Polly" Version="7.2.1"/>
|
<PackageReference Include="Polly" Version="7.2.1"/>
|
||||||
<PackageReference Include="Polly.Contrib.WaitAndRetry" Version="1.1.1"/>
|
<PackageReference Include="Polly.Contrib.WaitAndRetry" Version="1.1.1"/>
|
||||||
<PackageReference Include="Serilog" Version="2.10.0"/>
|
<PackageReference Include="Serilog" Version="2.10.0"/>
|
||||||
|
@ -24,9 +24,9 @@
|
|||||||
},
|
},
|
||||||
"Grpc.Tools": {
|
"Grpc.Tools": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[2.37.0, )",
|
"requested": "[2.47.0, )",
|
||||||
"resolved": "2.37.0",
|
"resolved": "2.47.0",
|
||||||
"contentHash": "cud/urkbw3QoQ8+kNeCy2YI0sHrh7td/1cZkVbH6hDLIXX7zzmJbV/KjYSiqiYtflQf+S5mJPLzDQWScN/QdDg=="
|
"contentHash": "nInNoLfT/zR7+0VNIC4Lu5nF8azjTz3KwHB1ckwsYUxvof4uSxIt/LlCKb/NH7GPfXfdvqDDinguPpP5t55nuA=="
|
||||||
},
|
},
|
||||||
"Polly": {
|
"Polly": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
<PackageReference Include="App.Metrics.Prometheus" Version="4.3.0" />
|
<PackageReference Include="App.Metrics.Prometheus" Version="4.3.0" />
|
||||||
<PackageReference Include="App.Metrics.Reporting.Console" Version="4.3.0" />
|
<PackageReference Include="App.Metrics.Reporting.Console" Version="4.3.0" />
|
||||||
<PackageReference Include="Google.Protobuf" Version="3.13.0" />
|
<PackageReference Include="Google.Protobuf" Version="3.13.0" />
|
||||||
<PackageReference Include="Grpc.Tools" Version="2.37.0" PrivateAssets="All" />
|
<PackageReference Include="Grpc.Tools" Version="2.47.0" PrivateAssets="all" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.0" />
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="4.2.0" />
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="4.2.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer" Version="4.2.0" />
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer" Version="4.2.0" />
|
||||||
|
@ -53,9 +53,9 @@
|
|||||||
},
|
},
|
||||||
"Grpc.Tools": {
|
"Grpc.Tools": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[2.37.0, )",
|
"requested": "[2.47.0, )",
|
||||||
"resolved": "2.37.0",
|
"resolved": "2.47.0",
|
||||||
"contentHash": "cud/urkbw3QoQ8+kNeCy2YI0sHrh7td/1cZkVbH6hDLIXX7zzmJbV/KjYSiqiYtflQf+S5mJPLzDQWScN/QdDg=="
|
"contentHash": "nInNoLfT/zR7+0VNIC4Lu5nF8azjTz3KwHB1ckwsYUxvof4uSxIt/LlCKb/NH7GPfXfdvqDDinguPpP5t55nuA=="
|
||||||
},
|
},
|
||||||
"Microsoft.AspNetCore.Mvc.NewtonsoftJson": {
|
"Microsoft.AspNetCore.Mvc.NewtonsoftJson": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Google.Protobuf" Version="3.13.0"/>
|
<PackageReference Include="Google.Protobuf" Version="3.13.0"/>
|
||||||
<PackageReference Include="Grpc.Net.ClientFactory" Version="2.32.0" />
|
<PackageReference Include="Grpc.Net.ClientFactory" Version="2.32.0" />
|
||||||
<PackageReference Include="Grpc.Tools" Version="2.37.0" PrivateAssets="All"/>
|
<PackageReference Include="Grpc.Tools" Version="2.47.0" PrivateAssets="all" />
|
||||||
<PackageReference Include="Humanizer.Core" Version="2.8.26"/>
|
<PackageReference Include="Humanizer.Core" Version="2.8.26"/>
|
||||||
<PackageReference Include="Sentry" Version="3.11.1"/>
|
<PackageReference Include="Sentry" Version="3.11.1"/>
|
||||||
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.2"/>
|
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.2"/>
|
||||||
|
@ -228,6 +228,9 @@ public class ProxyService
|
|||||||
if (!senderPermissions.HasFlag(PermissionSet.SendMessages))
|
if (!senderPermissions.HasFlag(PermissionSet.SendMessages))
|
||||||
throw new PKError("You don't have permission to send messages in the channel that message is in.");
|
throw new PKError("You don't have permission to send messages in the channel that message is in.");
|
||||||
|
|
||||||
|
// Mangle embeds (for reply embed color changing)
|
||||||
|
var mangledEmbeds = originalMsg.Embeds!.Select(embed => MangleReproxyEmbed(embed, member)).ToArray();
|
||||||
|
|
||||||
// Send the reproxied webhook
|
// Send the reproxied webhook
|
||||||
var proxyMessage = await _webhookExecutor.ExecuteWebhook(new ProxyRequest
|
var proxyMessage = await _webhookExecutor.ExecuteWebhook(new ProxyRequest
|
||||||
{
|
{
|
||||||
@ -239,7 +242,7 @@ public class ProxyService
|
|||||||
Content = match.ProxyContent!,
|
Content = match.ProxyContent!,
|
||||||
Attachments = originalMsg.Attachments!,
|
Attachments = originalMsg.Attachments!,
|
||||||
FileSizeLimit = guild.FileSizeLimit(),
|
FileSizeLimit = guild.FileSizeLimit(),
|
||||||
Embeds = originalMsg.Embeds!.ToArray(),
|
Embeds = mangledEmbeds,
|
||||||
Stickers = originalMsg.StickerItems!,
|
Stickers = originalMsg.StickerItems!,
|
||||||
AllowEveryone = allowEveryone
|
AllowEveryone = allowEveryone
|
||||||
});
|
});
|
||||||
@ -268,6 +271,28 @@ public class ProxyService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Embed MangleReproxyEmbed(Embed embed, ProxyMember member)
|
||||||
|
{
|
||||||
|
// XXX: This is a naïve implementation of detecting reply embeds: looking for the same Unicode
|
||||||
|
// characters as used in the reply embed generation, since we don't _really_ have a good way
|
||||||
|
// to detect whether an embed is a PluralKit reply embed right now, whether a message is in
|
||||||
|
// reply to another message isn't currently stored anywhere in the database.
|
||||||
|
//
|
||||||
|
// unicodes: [three-per-em space] [left arrow emoji] [force emoji presentation]
|
||||||
|
if (embed.Author != null && embed.Author!.Name.EndsWith("\u2004\u21a9\ufe0f"))
|
||||||
|
{
|
||||||
|
return new Embed
|
||||||
|
{
|
||||||
|
Type = "rich",
|
||||||
|
Author = embed.Author!,
|
||||||
|
Description = embed.Description!,
|
||||||
|
Color = member.Color?.ToDiscordColor()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return embed;
|
||||||
|
}
|
||||||
|
|
||||||
private Embed CreateReplyEmbed(ProxyMatch match, Message trigger, Message repliedTo, string? nickname,
|
private Embed CreateReplyEmbed(ProxyMatch match, Message trigger, Message repliedTo, string? nickname,
|
||||||
string? avatar)
|
string? avatar)
|
||||||
{
|
{
|
||||||
|
@ -24,9 +24,9 @@
|
|||||||
},
|
},
|
||||||
"Grpc.Tools": {
|
"Grpc.Tools": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[2.37.0, )",
|
"requested": "[2.47.0, )",
|
||||||
"resolved": "2.37.0",
|
"resolved": "2.47.0",
|
||||||
"contentHash": "cud/urkbw3QoQ8+kNeCy2YI0sHrh7td/1cZkVbH6hDLIXX7zzmJbV/KjYSiqiYtflQf+S5mJPLzDQWScN/QdDg=="
|
"contentHash": "nInNoLfT/zR7+0VNIC4Lu5nF8azjTz3KwHB1ckwsYUxvof4uSxIt/LlCKb/NH7GPfXfdvqDDinguPpP5t55nuA=="
|
||||||
},
|
},
|
||||||
"Humanizer.Core": {
|
"Humanizer.Core": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user