you can no longer remind channels you don't have access to
This commit is contained in:
		@@ -123,8 +123,19 @@ namespace NadekoBot.Modules.Utility
 | 
			
		||||
            [RequireContext(ContextType.Guild)]
 | 
			
		||||
            [RequireUserPermission(GuildPermission.ManageMessages)]
 | 
			
		||||
            [Priority(0)]
 | 
			
		||||
            public Task Remind(ITextChannel channel, string timeStr, [Remainder] string message) =>
 | 
			
		||||
                RemindInternal(channel.Id, false, timeStr, message);
 | 
			
		||||
            public async Task Remind(ITextChannel channel, string timeStr, [Remainder] string message)
 | 
			
		||||
            {
 | 
			
		||||
                var perms = ((IGuildUser)Context.User).GetPermissions((ITextChannel)channel);
 | 
			
		||||
                if (!perms.SendMessages || !perms.ReadMessages)
 | 
			
		||||
                {
 | 
			
		||||
                    await ReplyErrorLocalized("cant_read_or_send").ConfigureAwait(false);
 | 
			
		||||
                    return;
 | 
			
		||||
                }
 | 
			
		||||
                else
 | 
			
		||||
                {
 | 
			
		||||
                    var _ = RemindInternal(channel.Id, false, timeStr, message).ConfigureAwait(false);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            public async Task RemindInternal(ulong targetId, bool isPrivate, string timeStr, [Remainder] string message)
 | 
			
		||||
            {
 | 
			
		||||
 
 | 
			
		||||
@@ -2105,6 +2105,9 @@ Owner ID: {2}</value>
 | 
			
		||||
  <data name="utility_remind" xml:space="preserve">
 | 
			
		||||
    <value>I will remind {0} to {1} in {2} `({3:d.M.yyyy.} at {4:HH:mm})`</value>
 | 
			
		||||
  </data>
 | 
			
		||||
  <data name="utility_cant_read_or_send" xml:space="preserve">
 | 
			
		||||
    <value>You can't read from or send messages to that channel.</value>
 | 
			
		||||
  </data>
 | 
			
		||||
  <data name="utility_remind_invalid_format" xml:space="preserve">
 | 
			
		||||
    <value>Not a valid time format. Check the commandlist.</value>
 | 
			
		||||
  </data>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user