Added all strings and added group attribute to greetcommands
This commit is contained in:
parent
840c3d86f4
commit
b313a4f1ba
@ -12,6 +12,7 @@ namespace NadekoBot.Modules.Administration
|
||||
{
|
||||
public partial class Administration
|
||||
{
|
||||
[Group]
|
||||
public class ServerGreetCommands
|
||||
{
|
||||
public static long Greeted = 0;
|
||||
@ -113,28 +114,6 @@ namespace NadekoBot.Modules.Administration
|
||||
await channel.SendMessageAsync("`Automatic deletion of greet messages has been disabled.`").ConfigureAwait(false);
|
||||
}
|
||||
|
||||
[LocalizedCommand, LocalizedDescription, LocalizedSummary]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[RequirePermission(GuildPermission.ManageGuild)]
|
||||
public async Task ByeDel(IMessage imsg)
|
||||
{
|
||||
var channel = (ITextChannel)imsg.Channel;
|
||||
|
||||
GuildConfig conf;
|
||||
using (var uow = DbHandler.UnitOfWork())
|
||||
{
|
||||
conf = uow.GuildConfigs.For(channel.Guild.Id);
|
||||
conf.AutoDeleteByeMessages = !conf.AutoDeleteByeMessages;
|
||||
uow.GuildConfigs.Update(conf);
|
||||
await uow.CompleteAsync();
|
||||
}
|
||||
|
||||
if (conf.AutoDeleteByeMessages)
|
||||
await channel.SendMessageAsync("`Automatic deletion of bye messages has been enabled.`").ConfigureAwait(false);
|
||||
else
|
||||
await channel.SendMessageAsync("`Automatic deletion of bye messages has been disabled.`").ConfigureAwait(false);
|
||||
}
|
||||
|
||||
[LocalizedCommand, LocalizedDescription, LocalizedSummary]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[RequirePermission(GuildPermission.ManageGuild)]
|
||||
@ -157,31 +136,10 @@ namespace NadekoBot.Modules.Administration
|
||||
else
|
||||
await channel.SendMessageAsync("Greet announcements disabled.").ConfigureAwait(false);
|
||||
}
|
||||
|
||||
|
||||
[LocalizedCommand, LocalizedDescription, LocalizedSummary]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[RequirePermission(GuildPermission.ManageGuild)]
|
||||
public async Task DmGreet(IMessage imsg)
|
||||
{
|
||||
var channel = (ITextChannel)imsg.Channel;
|
||||
|
||||
GuildConfig conf;
|
||||
using (var uow = DbHandler.UnitOfWork())
|
||||
{
|
||||
conf = uow.GuildConfigs.For(channel.Guild.Id);
|
||||
conf.SendDmGreetMessage = !conf.SendDmGreetMessage;
|
||||
uow.GuildConfigs.Update(conf);
|
||||
await uow.CompleteAsync();
|
||||
}
|
||||
|
||||
if (conf.SendDmGreetMessage)
|
||||
await channel.SendMessageAsync("Greet announcements enabled on this channel.").ConfigureAwait(false);
|
||||
else
|
||||
await channel.SendMessageAsync("Greet announcements disabled.").ConfigureAwait(false);
|
||||
}
|
||||
|
||||
[LocalizedCommand, LocalizedDescription, LocalizedSummary]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task GreetMsg(IMessage imsg, [Remainder] string text)
|
||||
{
|
||||
var channel = (ITextChannel)imsg.Channel;
|
||||
@ -210,7 +168,30 @@ namespace NadekoBot.Modules.Administration
|
||||
|
||||
[LocalizedCommand, LocalizedDescription, LocalizedSummary]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task DmGreetMsg(IMessage imsg, [Remainder] string text)
|
||||
[RequirePermission(GuildPermission.ManageGuild)]
|
||||
public async Task GreetDm(IMessage imsg)
|
||||
{
|
||||
var channel = (ITextChannel)imsg.Channel;
|
||||
|
||||
GuildConfig conf;
|
||||
using (var uow = DbHandler.UnitOfWork())
|
||||
{
|
||||
conf = uow.GuildConfigs.For(channel.Guild.Id);
|
||||
conf.SendDmGreetMessage = !conf.SendDmGreetMessage;
|
||||
uow.GuildConfigs.Update(conf);
|
||||
await uow.CompleteAsync();
|
||||
}
|
||||
|
||||
if (conf.SendDmGreetMessage)
|
||||
await channel.SendMessageAsync("Greet announcements enabled on this channel.").ConfigureAwait(false);
|
||||
else
|
||||
await channel.SendMessageAsync("Greet announcements disabled.").ConfigureAwait(false);
|
||||
}
|
||||
|
||||
[LocalizedCommand, LocalizedDescription, LocalizedSummary]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[RequirePermission(GuildPermission.ManageGuild)]
|
||||
public async Task GreetDmMsg(IMessage imsg, [Remainder] string text)
|
||||
{
|
||||
var channel = (ITextChannel)imsg.Channel;
|
||||
|
||||
@ -261,6 +242,7 @@ namespace NadekoBot.Modules.Administration
|
||||
|
||||
[LocalizedCommand, LocalizedDescription, LocalizedSummary]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[RequirePermission(GuildPermission.ManageGuild)]
|
||||
public async Task ByeMsg(IMessage imsg, [Remainder] string text)
|
||||
{
|
||||
var channel = (ITextChannel)imsg.Channel;
|
||||
@ -286,6 +268,29 @@ namespace NadekoBot.Modules.Administration
|
||||
if (!conf.SendChannelByeMessage)
|
||||
await channel.SendMessageAsync("Enable bye messsages by typing `.bye`").ConfigureAwait(false);
|
||||
}
|
||||
|
||||
[LocalizedCommand, LocalizedDescription, LocalizedSummary]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
[RequirePermission(GuildPermission.ManageGuild)]
|
||||
public async Task ByeDel(IMessage imsg)
|
||||
{
|
||||
var channel = (ITextChannel)imsg.Channel;
|
||||
|
||||
GuildConfig conf;
|
||||
using (var uow = DbHandler.UnitOfWork())
|
||||
{
|
||||
conf = uow.GuildConfigs.For(channel.Guild.Id);
|
||||
conf.AutoDeleteByeMessages = !conf.AutoDeleteByeMessages;
|
||||
uow.GuildConfigs.Update(conf);
|
||||
await uow.CompleteAsync();
|
||||
}
|
||||
|
||||
if (conf.AutoDeleteByeMessages)
|
||||
await channel.SendMessageAsync("`Automatic deletion of bye messages has been enabled.`").ConfigureAwait(false);
|
||||
else
|
||||
await channel.SendMessageAsync("`Automatic deletion of bye messages has been disabled.`").ConfigureAwait(false);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
191
src/NadekoBot/Resources/CommandStrings.Designer.cs
generated
191
src/NadekoBot/Resources/CommandStrings.Designer.cs
generated
@ -842,6 +842,33 @@ namespace NadekoBot.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Toggles automatic deletion of bye messages. **Needs Manage Server Permissions.**.
|
||||
/// </summary>
|
||||
public static string byedel_desc {
|
||||
get {
|
||||
return ResourceManager.GetString("byedel_desc", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to `.byedel`.
|
||||
/// </summary>
|
||||
public static string byedel_summary {
|
||||
get {
|
||||
return ResourceManager.GetString("byedel_summary", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to byedel.
|
||||
/// </summary>
|
||||
public static string byedel_text {
|
||||
get {
|
||||
return ResourceManager.GetString("byedel_text", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Sets a new leave announcement message. Type %user% if you want to mention the new member. Using it with no message will show the current bye message. **Needs Manage Server Permissions.**.
|
||||
/// </summary>
|
||||
@ -869,33 +896,6 @@ namespace NadekoBot.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Toggles whether the good bye messages will be sent in a PM or in the text channel. **Needs Manage Server Permissions.**.
|
||||
/// </summary>
|
||||
public static string byepm_desc {
|
||||
get {
|
||||
return ResourceManager.GetString("byepm_desc", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to `.byepm`.
|
||||
/// </summary>
|
||||
public static string byepm_summary {
|
||||
get {
|
||||
return ResourceManager.GetString("byepm_summary", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to byepm.
|
||||
/// </summary>
|
||||
public static string byepm_text {
|
||||
get {
|
||||
return ResourceManager.GetString("byepm_text", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Shows all available operations in .calc command.
|
||||
/// </summary>
|
||||
@ -2705,33 +2705,6 @@ namespace NadekoBot.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Toggles automatic deletion of greet and bye messages. **Needs Manage Server Permissions.**.
|
||||
/// </summary>
|
||||
public static string grdel_desc {
|
||||
get {
|
||||
return ResourceManager.GetString("grdel_desc", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to `.grdel`.
|
||||
/// </summary>
|
||||
public static string grdel_summary {
|
||||
get {
|
||||
return ResourceManager.GetString("grdel_summary", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to grdel.
|
||||
/// </summary>
|
||||
public static string grdel_text {
|
||||
get {
|
||||
return ResourceManager.GetString("grdel_text", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Toggles anouncements on the current channel when someone joins the server. **Needs Manage Server Permissions.**.
|
||||
/// </summary>
|
||||
@ -2760,7 +2733,88 @@ namespace NadekoBot.Resources {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Sets a new join announcement message. Type %user% if you want to mention the new member. Using it with no message will show the current greet message. **Needs Manage Server Permissions.**.
|
||||
/// Looks up a localized string similar to Toggles automatic deletion of greet messages. **Needs Manage Server Permissions.**.
|
||||
/// </summary>
|
||||
public static string greetdel_desc {
|
||||
get {
|
||||
return ResourceManager.GetString("greetdel_desc", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to `.greetdel`.
|
||||
/// </summary>
|
||||
public static string greetdel_summary {
|
||||
get {
|
||||
return ResourceManager.GetString("greetdel_summary", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to greetdel.
|
||||
/// </summary>
|
||||
public static string greetdel_text {
|
||||
get {
|
||||
return ResourceManager.GetString("greetdel_text", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Toggles whether the greet messages will be sent in a DM (This is separate from greet - you can have both, any or neither enabled). **Needs Manage Server Permissions.**.
|
||||
/// </summary>
|
||||
public static string greetdm_desc {
|
||||
get {
|
||||
return ResourceManager.GetString("greetdm_desc", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to `.greetdm`.
|
||||
/// </summary>
|
||||
public static string greetdm_summary {
|
||||
get {
|
||||
return ResourceManager.GetString("greetdm_summary", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to greetdm.
|
||||
/// </summary>
|
||||
public static string greetdm_text {
|
||||
get {
|
||||
return ResourceManager.GetString("greetdm_text", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Sets a new join announcement message which will be sent to the user who joined. Type %user% if you want to mention the new member. Using it with no message will show the current DM greet message. **Needs Manage Server Permissions.**.
|
||||
/// </summary>
|
||||
public static string greetdmmsg_desc {
|
||||
get {
|
||||
return ResourceManager.GetString("greetdmmsg_desc", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to `.greetdmmsg Welcome to the server, %user%`..
|
||||
/// </summary>
|
||||
public static string greetdmmsg_summary {
|
||||
get {
|
||||
return ResourceManager.GetString("greetdmmsg_summary", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to greetdmmsg.
|
||||
/// </summary>
|
||||
public static string greetdmmsg_text {
|
||||
get {
|
||||
return ResourceManager.GetString("greetdmmsg_text", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Sets a new join announcement message which will be shown in the server's channel. Type %user% if you want to mention the new member. Using it with no message will show the current greet message. **Needs Manage Server Permissions.**.
|
||||
/// </summary>
|
||||
public static string greetmsg_desc {
|
||||
get {
|
||||
@ -2786,33 +2840,6 @@ namespace NadekoBot.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Toggles whether the greet messages will be sent in a PM or in the text channel. **Needs Manage Server Permissions.**.
|
||||
/// </summary>
|
||||
public static string greetpm_desc {
|
||||
get {
|
||||
return ResourceManager.GetString("greetpm_desc", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to `.greetpm`.
|
||||
/// </summary>
|
||||
public static string greetpm_summary {
|
||||
get {
|
||||
return ResourceManager.GetString("greetpm_summary", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to greetpm.
|
||||
/// </summary>
|
||||
public static string greetpm_text {
|
||||
get {
|
||||
return ResourceManager.GetString("greetpm_text", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Sends a readme and a guide links to the channel..
|
||||
/// </summary>
|
||||
|
@ -162,14 +162,14 @@
|
||||
<data name="commands_summary" xml:space="preserve">
|
||||
<value>`-commands` or `.commands`</value>
|
||||
</data>
|
||||
<data name="grdel_text" xml:space="preserve">
|
||||
<value>grdel</value>
|
||||
<data name="greetdel_text" xml:space="preserve">
|
||||
<value>greetdel</value>
|
||||
</data>
|
||||
<data name="grdel_desc" xml:space="preserve">
|
||||
<value>Toggles automatic deletion of greet and bye messages. **Needs Manage Server Permissions.**</value>
|
||||
<data name="greetdel_desc" xml:space="preserve">
|
||||
<value>Toggles automatic deletion of greet messages. **Needs Manage Server Permissions.**</value>
|
||||
</data>
|
||||
<data name="grdel_summary" xml:space="preserve">
|
||||
<value>`.grdel`</value>
|
||||
<data name="greetdel_summary" xml:space="preserve">
|
||||
<value>`.greetdel`</value>
|
||||
</data>
|
||||
<data name="greet_text" xml:space="preserve">
|
||||
<value>greet</value>
|
||||
@ -184,7 +184,7 @@
|
||||
<value>greetmsg</value>
|
||||
</data>
|
||||
<data name="greetmsg_desc" xml:space="preserve">
|
||||
<value>Sets a new join announcement message. Type %user% if you want to mention the new member. Using it with no message will show the current greet message. **Needs Manage Server Permissions.**</value>
|
||||
<value>Sets a new join announcement message which will be shown in the server's channel. Type %user% if you want to mention the new member. Using it with no message will show the current greet message. **Needs Manage Server Permissions.**</value>
|
||||
</data>
|
||||
<data name="greetmsg_summary" xml:space="preserve">
|
||||
<value>`.greetmsg Welcome, %user%.`</value>
|
||||
@ -207,23 +207,23 @@
|
||||
<data name="byemsg_summary" xml:space="preserve">
|
||||
<value>`.byemsg %user% has left.`</value>
|
||||
</data>
|
||||
<data name="byepm_text" xml:space="preserve">
|
||||
<value>byepm</value>
|
||||
<data name="byedel_text" xml:space="preserve">
|
||||
<value>byedel</value>
|
||||
</data>
|
||||
<data name="byepm_desc" xml:space="preserve">
|
||||
<value>Toggles whether the good bye messages will be sent in a PM or in the text channel. **Needs Manage Server Permissions.**</value>
|
||||
<data name="byedel_desc" xml:space="preserve">
|
||||
<value>Toggles automatic deletion of bye messages. **Needs Manage Server Permissions.**</value>
|
||||
</data>
|
||||
<data name="byepm_summary" xml:space="preserve">
|
||||
<value>`.byepm`</value>
|
||||
<data name="byedel_summary" xml:space="preserve">
|
||||
<value>`.byedel`</value>
|
||||
</data>
|
||||
<data name="greetpm_text" xml:space="preserve">
|
||||
<value>greetpm</value>
|
||||
<data name="greetdm_text" xml:space="preserve">
|
||||
<value>greetdm</value>
|
||||
</data>
|
||||
<data name="greetpm_desc" xml:space="preserve">
|
||||
<value>Toggles whether the greet messages will be sent in a PM or in the text channel. **Needs Manage Server Permissions.**</value>
|
||||
<data name="greetdm_desc" xml:space="preserve">
|
||||
<value>Toggles whether the greet messages will be sent in a DM (This is separate from greet - you can have both, any or neither enabled). **Needs Manage Server Permissions.**</value>
|
||||
</data>
|
||||
<data name="greetpm_summary" xml:space="preserve">
|
||||
<value>`.greetpm`</value>
|
||||
<data name="greetdm_summary" xml:space="preserve">
|
||||
<value>`.greetdm`</value>
|
||||
</data>
|
||||
<data name="spmom_text" xml:space="preserve">
|
||||
<value>spmom</value>
|
||||
@ -2628,4 +2628,13 @@
|
||||
<data name="delallquotes_text" xml:space="preserve">
|
||||
<value>delallq</value>
|
||||
</data>
|
||||
<data name="greetdmmsg_text" xml:space="preserve">
|
||||
<value>greetdmmsg</value>
|
||||
</data>
|
||||
<data name="greetdmmsg_summary" xml:space="preserve">
|
||||
<value>`.greetdmmsg Welcome to the server, %user%`.</value>
|
||||
</data>
|
||||
<data name="greetdmmsg_desc" xml:space="preserve">
|
||||
<value>Sets a new join announcement message which will be sent to the user who joined. Type %user% if you want to mention the new member. Using it with no message will show the current DM greet message. **Needs Manage Server Permissions.**</value>
|
||||
</data>
|
||||
</root>
|
Loading…
Reference in New Issue
Block a user