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