Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/vapor/penny-bot
Browse files Browse the repository at this point in the history
  • Loading branch information
MahdiBM committed Nov 2, 2024
2 parents 3ad51e7 + e4c6244 commit d31f89f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Sources/Penny/Handlers/AuditLogHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ struct AuditLogHandler {
return
}
if targetId == Constants.botId {
logger.error(
logger.warning(
"Will not report a messageDelete because target is Penny",
metadata: [
"userId": .string(userId.rawValue),
Expand Down Expand Up @@ -86,7 +86,7 @@ struct AuditLogHandler {
return
}
if targetId == Constants.botId {
logger.error(
logger.warning(
"Will not report a messageBulkDelete because target is Penny",
metadata: [
"userId": .string(userId.rawValue),
Expand Down
6 changes: 3 additions & 3 deletions Sources/Penny/SwiftReleasesChecker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ actor SwiftReleasesChecker {
for release in newReleases {
let image = "https://opengraph.githubassets.com/\(UUID().uuidString)/swiftlang/swift/releases/tag/\(release.tag)"
await discordService.sendMessage(
channelId: Constants.Channels.release.id,
channelId: Constants.Channels.news.id,
payload: .init(embeds: [.init(
title: "Swift Release \(release.stableName)".unicodesPrefix(256),
title: "Swift \(release.stableName) Release".unicodesPrefix(256),
url: "https://github.com/swiftlang/swift/releases/tag/\(release.tag)",
color: .green(scheme: .dark),
color: .cyan,
image: .init(url: .exact(image))
)])
)
Expand Down
4 changes: 2 additions & 2 deletions Tests/PennyTests/Tests/GatewayProcessingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -388,11 +388,11 @@ extension SerializationNamespace.GatewayProcessingTests {
func swiftReleasesChecker() async throws {
context.services.swiftReleasesChecker.run()

let endpoint = APIEndpoint.createMessage(channelId: Constants.Channels.release.id)
let endpoint = APIEndpoint.createMessage(channelId: Constants.Channels.news.id)
let _message = await responseStorage.awaitResponse(at: endpoint).value
let message = try #require(_message as? Payloads.CreateMessage, "\(_message)")

#expect(message.embeds?.first?.title == "Swift Release 6.0.1")
#expect(message.embeds?.first?.title == "Swift 6.0.1 Release")

/// No more messages should be sent
let _newMessage = await responseStorage.awaitResponse(
Expand Down

0 comments on commit d31f89f

Please sign in to comment.