mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-04-20 00:43:36 +03:00
Mention the event notification role when an event is created
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
parent
0bee68af8a
commit
b89e557e48
1 changed files with 5 additions and 1 deletions
|
@ -320,6 +320,10 @@ public class GuildScheduledEventCreateResponder : IResponder<IGuildScheduledEven
|
||||||
.Build();
|
.Build();
|
||||||
if (!embed.IsDefined(out var built)) return Result.FromError(embed);
|
if (!embed.IsDefined(out var built)) return Result.FromError(embed);
|
||||||
|
|
||||||
|
var roleMention = guildConfiguration.EventNotificationRole is not 0
|
||||||
|
? Mention.Role(guildConfiguration.EventNotificationRole.ToDiscordSnowflake())
|
||||||
|
: string.Empty;
|
||||||
|
|
||||||
var button = new ButtonComponent(
|
var button = new ButtonComponent(
|
||||||
ButtonComponentStyle.Primary,
|
ButtonComponentStyle.Primary,
|
||||||
Messages.EventDetailsButton,
|
Messages.EventDetailsButton,
|
||||||
|
@ -329,7 +333,7 @@ public class GuildScheduledEventCreateResponder : IResponder<IGuildScheduledEven
|
||||||
);
|
);
|
||||||
|
|
||||||
return (Result)await _channelApi.CreateMessageAsync(
|
return (Result)await _channelApi.CreateMessageAsync(
|
||||||
guildConfiguration.EventNotificationChannel.ToDiscordSnowflake(), embeds: new[] { built },
|
guildConfiguration.EventNotificationChannel.ToDiscordSnowflake(), roleMention, embeds: new[] { built },
|
||||||
components: new[] { new ActionRowComponent(new[] { button }) }, ct: ct);
|
components: new[] { new ActionRowComponent(new[] { button }) }, ct: ct);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue