mirror of
				https://gitlab.com/Kwoth/nadekobot.git
				synced 2025-11-03 16:24:27 -05:00 
			
		
		
		
	ShmartNumber for .plant
This commit is contained in:
		@@ -8,6 +8,7 @@ using NadekoBot.Modules.Gambling.Services;
 | 
				
			|||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
using System.Threading.Tasks;
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
using NadekoBot.Modules.Gambling.Common;
 | 
					using NadekoBot.Modules.Gambling.Common;
 | 
				
			||||||
 | 
					using NadekoBot.Common;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace NadekoBot.Modules.Games
 | 
					namespace NadekoBot.Modules.Games
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@@ -53,7 +54,7 @@ namespace NadekoBot.Modules.Games
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            [NadekoCommand, Aliases]
 | 
					            [NadekoCommand, Aliases]
 | 
				
			||||||
            [RequireContext(ContextType.Guild)]
 | 
					            [RequireContext(ContextType.Guild)]
 | 
				
			||||||
            public async Task Plant(int amount = 1, string pass = null)
 | 
					            public async Task Plant(ShmartNumber amount, string pass = null)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                if (amount < 1)
 | 
					                if (amount < 1)
 | 
				
			||||||
                    return;
 | 
					                    return;
 | 
				
			||||||
@@ -63,18 +64,17 @@ namespace NadekoBot.Modules.Games
 | 
				
			|||||||
                    return;
 | 
					                    return;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                var success = await _service.PlantAsync(ctx.Guild.Id, ctx.Channel, ctx.User.Id, ctx.User.ToString(), amount, pass);
 | 
					 | 
				
			||||||
                if (!success)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    await ReplyErrorLocalizedAsync(strs.not_enough( CurrencySign));
 | 
					 | 
				
			||||||
                    return;
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                if (((SocketGuild)ctx.Guild).CurrentUser.GuildPermissions.ManageMessages)
 | 
					                if (((SocketGuild)ctx.Guild).CurrentUser.GuildPermissions.ManageMessages)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    logService.AddDeleteIgnore(ctx.Message.Id);
 | 
					                    logService.AddDeleteIgnore(ctx.Message.Id);
 | 
				
			||||||
                    await ctx.Message.DeleteAsync().ConfigureAwait(false);
 | 
					                    await ctx.Message.DeleteAsync().ConfigureAwait(false);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                var success = await _service.PlantAsync(ctx.Guild.Id, ctx.Channel, ctx.User.Id, ctx.User.ToString(), amount, pass);
 | 
				
			||||||
 | 
					                if (!success)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    await ReplyErrorLocalizedAsync(strs.not_enough( CurrencySign));
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            [NadekoCommand, Aliases]
 | 
					            [NadekoCommand, Aliases]
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user