mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-01-31 09:09:00 +03:00
Add WelcomeMessagesChannel setting (#269)
Closes #232 Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
This commit is contained in:
parent
62709d927b
commit
5105b43eff
8 changed files with 25 additions and 2 deletions
|
@ -657,4 +657,7 @@
|
||||||
<data name="TimeSpanExample" xml:space="preserve">
|
<data name="TimeSpanExample" xml:space="preserve">
|
||||||
<value>Example of a valid input: `1h30m`</value>
|
<value>Example of a valid input: `1h30m`</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="SettingsWelcomeMessagesChannel" xml:space="preserve">
|
||||||
|
<value>Welcome messages channel</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
|
|
|
@ -657,4 +657,7 @@
|
||||||
<data name="TimeSpanExample" xml:space="preserve">
|
<data name="TimeSpanExample" xml:space="preserve">
|
||||||
<value>Пример правильного ввода: `1ч30м`</value>
|
<value>Пример правильного ввода: `1ч30м`</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="SettingsWelcomeMessagesChannel" xml:space="preserve">
|
||||||
|
<value>Канал для приветствий</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
|
|
|
@ -657,4 +657,7 @@
|
||||||
<data name="TimeSpanExample" xml:space="preserve">
|
<data name="TimeSpanExample" xml:space="preserve">
|
||||||
<value>правильно пишут так: `1h30m`</value>
|
<value>правильно пишут так: `1h30m`</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="SettingsWelcomeMessagesChannel" xml:space="preserve">
|
||||||
|
<value>канал куда говорить здравствуйте</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
|
|
|
@ -46,6 +46,7 @@ public class SettingsCommandGroup : CommandGroup
|
||||||
GuildSettings.RenameHoistedUsers,
|
GuildSettings.RenameHoistedUsers,
|
||||||
GuildSettings.PublicFeedbackChannel,
|
GuildSettings.PublicFeedbackChannel,
|
||||||
GuildSettings.PrivateFeedbackChannel,
|
GuildSettings.PrivateFeedbackChannel,
|
||||||
|
GuildSettings.WelcomeMessagesChannel,
|
||||||
GuildSettings.EventNotificationChannel,
|
GuildSettings.EventNotificationChannel,
|
||||||
GuildSettings.DefaultRole,
|
GuildSettings.DefaultRole,
|
||||||
GuildSettings.MuteRole,
|
GuildSettings.MuteRole,
|
||||||
|
|
|
@ -56,6 +56,11 @@ public static class GuildSettings
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly SnowflakeOption PrivateFeedbackChannel = new("PrivateFeedbackChannel");
|
public static readonly SnowflakeOption PrivateFeedbackChannel = new("PrivateFeedbackChannel");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Controls what channel should welcome messages be sent to.
|
||||||
|
/// </summary>
|
||||||
|
public static readonly SnowflakeOption WelcomeMessagesChannel = new("WelcomeMessagesChannel");
|
||||||
|
|
||||||
public static readonly SnowflakeOption EventNotificationChannel = new("EventNotificationChannel");
|
public static readonly SnowflakeOption EventNotificationChannel = new("EventNotificationChannel");
|
||||||
public static readonly SnowflakeOption DefaultRole = new("DefaultRole");
|
public static readonly SnowflakeOption DefaultRole = new("DefaultRole");
|
||||||
public static readonly SnowflakeOption MuteRole = new("MuteRole");
|
public static readonly SnowflakeOption MuteRole = new("MuteRole");
|
||||||
|
|
|
@ -21,6 +21,7 @@ public enum AllOptionsEnum
|
||||||
[UsedImplicitly] RenameHoistedUsers,
|
[UsedImplicitly] RenameHoistedUsers,
|
||||||
[UsedImplicitly] PublicFeedbackChannel,
|
[UsedImplicitly] PublicFeedbackChannel,
|
||||||
[UsedImplicitly] PrivateFeedbackChannel,
|
[UsedImplicitly] PrivateFeedbackChannel,
|
||||||
|
[UsedImplicitly] WelcomeMessagesChannel,
|
||||||
[UsedImplicitly] EventNotificationChannel,
|
[UsedImplicitly] EventNotificationChannel,
|
||||||
[UsedImplicitly] DefaultRole,
|
[UsedImplicitly] DefaultRole,
|
||||||
[UsedImplicitly] MuteRole,
|
[UsedImplicitly] MuteRole,
|
||||||
|
|
7
src/Messages.Designer.cs
generated
7
src/Messages.Designer.cs
generated
|
@ -1184,5 +1184,12 @@ namespace Octobot {
|
||||||
return ResourceManager.GetString("TimeSpanExample", resourceCulture);
|
return ResourceManager.GetString("TimeSpanExample", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal static string SettingsWelcomeMessagesChannel
|
||||||
|
{
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("SettingsWelcomeMessagesChannel", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ public class GuildMemberJoinedResponder : IResponder<IGuildMemberAdd>
|
||||||
return Result.FromError(returnRolesResult.Error);
|
return Result.FromError(returnRolesResult.Error);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GuildSettings.PublicFeedbackChannel.Get(cfg).Empty()
|
if (GuildSettings.WelcomeMessagesChannel.Get(cfg).Empty()
|
||||||
|| GuildSettings.WelcomeMessage.Get(cfg) is "off" or "disable" or "disabled")
|
|| GuildSettings.WelcomeMessage.Get(cfg) is "off" or "disable" or "disabled")
|
||||||
{
|
{
|
||||||
return Result.FromSuccess();
|
return Result.FromSuccess();
|
||||||
|
@ -76,7 +76,7 @@ public class GuildMemberJoinedResponder : IResponder<IGuildMemberAdd>
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
return await _channelApi.CreateMessageWithEmbedResultAsync(
|
return await _channelApi.CreateMessageWithEmbedResultAsync(
|
||||||
GuildSettings.PublicFeedbackChannel.Get(cfg), embedResult: embed,
|
GuildSettings.WelcomeMessagesChannel.Get(cfg), embedResult: embed,
|
||||||
allowedMentions: Octobot.NoMentions, ct: ct);
|
allowedMentions: Octobot.NoMentions, ct: ct);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue