added don't join servers in order to prevent the bot from spreading if needed
This commit is contained in:
		| @@ -11,6 +11,8 @@ | |||||||
|         public bool? ForwardMessages; |         public bool? ForwardMessages; | ||||||
|         public string SoundCloudClientID; |         public string SoundCloudClientID; | ||||||
|         public string MashapeKey; |         public string MashapeKey; | ||||||
|  |         public string LOLAPIKey; | ||||||
|  |         public bool DontJoinServers = false; | ||||||
|     } |     } | ||||||
|     public class AnimeResult |     public class AnimeResult | ||||||
|     { |     { | ||||||
|   | |||||||
| @@ -264,7 +264,7 @@ namespace NadekoBot.Modules { | |||||||
|                         text = usr?.Name; |                         text = usr?.Name; | ||||||
|                         await e.Channel.SendFile("ripzor_m8.png", RipName(text, e.GetArg("year") == "" ? null : e.GetArg("year"))); |                         await e.Channel.SendFile("ripzor_m8.png", RipName(text, e.GetArg("year") == "" ? null : e.GetArg("year"))); | ||||||
|                     }); |                     }); | ||||||
|  |                 if (!NadekoBot.creds.DontJoinServers) { | ||||||
|                     cgb.CreateCommand("j") |                     cgb.CreateCommand("j") | ||||||
|                         .Description("Joins a server using a code.") |                         .Description("Joins a server using a code.") | ||||||
|                         .Parameter("id", ParameterType.Required) |                         .Parameter("id", ParameterType.Required) | ||||||
| @@ -272,10 +272,13 @@ namespace NadekoBot.Modules { | |||||||
|                             try { |                             try { | ||||||
|                                 await (await client.GetInvite(e.Args[0])).Accept(); |                                 await (await client.GetInvite(e.Args[0])).Accept(); | ||||||
|                                 await e.Send("I got in!"); |                                 await e.Send("I got in!"); | ||||||
|                         } catch  { |                             } | ||||||
|  |                             catch { | ||||||
|                                 await e.Send("Invalid code."); |                                 await e.Send("Invalid code."); | ||||||
|                             } |                             } | ||||||
|                         }); |                         }); | ||||||
|  |                 } | ||||||
|  |                  | ||||||
|                 cgb.CreateCommand("slm") |                 cgb.CreateCommand("slm") | ||||||
|                     .Description("Shows the message where you were last mentioned in this channel (checks last 10k messages)") |                     .Description("Shows the message where you were last mentioned in this channel (checks last 10k messages)") | ||||||
|                     .Do(async e => { |                     .Do(async e => { | ||||||
|   | |||||||
| @@ -156,6 +156,7 @@ namespace NadekoBot { | |||||||
|                 e.User.Id == 143515953525817344) |                 e.User.Id == 143515953525817344) | ||||||
|                 return; // FU |                 return; // FU | ||||||
|  |  | ||||||
|  |             if (!NadekoBot.creds.DontJoinServers) { | ||||||
|                 try { |                 try { | ||||||
|                     await (await client.GetInvite(e.Message.Text)).Accept(); |                     await (await client.GetInvite(e.Message.Text)).Accept(); | ||||||
|                     await e.Send("I got in!"); |                     await e.Send("I got in!"); | ||||||
| @@ -167,6 +168,7 @@ namespace NadekoBot { | |||||||
|                         return; |                         return; | ||||||
|                     } |                     } | ||||||
|                 } |                 } | ||||||
|  |             } | ||||||
|  |  | ||||||
|             if (ForwardMessages && OwnerPrivateChannel != null) |             if (ForwardMessages && OwnerPrivateChannel != null) | ||||||
|                 await OwnerPrivateChannel.SendMessage(e.User + ": ```\n" + e.Message.Text + "\n```"); |                 await OwnerPrivateChannel.SendMessage(e.User + ": ```\n" + e.Message.Text + "\n```"); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user