added don't join servers in order to prevent the bot from spreading if needed
This commit is contained in:
parent
891cc408ff
commit
21c1e95515
@ -11,6 +11,8 @@
|
||||
public bool? ForwardMessages;
|
||||
public string SoundCloudClientID;
|
||||
public string MashapeKey;
|
||||
public string LOLAPIKey;
|
||||
public bool DontJoinServers = false;
|
||||
}
|
||||
public class AnimeResult
|
||||
{
|
||||
|
@ -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 => {
|
||||
|
@ -156,16 +156,18 @@ namespace NadekoBot {
|
||||
e.User.Id == 143515953525817344)
|
||||
return; // FU
|
||||
|
||||
try {
|
||||
await (await client.GetInvite(e.Message.Text)).Accept();
|
||||
await e.Send("I got in!");
|
||||
return;
|
||||
}
|
||||
catch {
|
||||
if (e.User.Id == 109338686889476096) { //carbonitex invite
|
||||
await e.Send("Failed to join the server.");
|
||||
if (!NadekoBot.creds.DontJoinServers) {
|
||||
try {
|
||||
await (await client.GetInvite(e.Message.Text)).Accept();
|
||||
await e.Send("I got in!");
|
||||
return;
|
||||
}
|
||||
catch {
|
||||
if (e.User.Id == 109338686889476096) { //carbonitex invite
|
||||
await e.Send("Failed to join the server.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ForwardMessages && OwnerPrivateChannel != null)
|
||||
|
Loading…
Reference in New Issue
Block a user