added don't join servers in order to prevent the bot from spreading if needed

This commit is contained in:
Master Kwoth
2016-02-19 06:23:02 +01:00
parent 891cc408ff
commit 21c1e95515
3 changed files with 28 additions and 21 deletions

View File

@ -74,7 +74,7 @@ namespace NadekoBot.Modules {
Stopwatch randServerSW = new Stopwatch();
randServerSW.Start();
cgb.CreateCommand("randserver")
.Description("Generates an invite to a random server and prints some stats.")
.Do(async e => {
@ -264,18 +264,21 @@ namespace NadekoBot.Modules {
text = usr?.Name;
await e.Channel.SendFile("ripzor_m8.png", RipName(text, e.GetArg("year") == "" ? null : e.GetArg("year")));
});
cgb.CreateCommand("j")
.Description("Joins a server using a code.")
.Parameter("id", ParameterType.Required)
.Do(async e => {
try {
await (await client.GetInvite(e.Args[0])).Accept();
await e.Send("I got in!");
} catch {
await e.Send("Invalid code.");
}
});
if (!NadekoBot.creds.DontJoinServers) {
cgb.CreateCommand("j")
.Description("Joins a server using a code.")
.Parameter("id", ParameterType.Required)
.Do(async e => {
try {
await (await client.GetInvite(e.Args[0])).Accept();
await e.Send("I got in!");
}
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 => {