Fixed userpresence and logserver
This commit is contained in:
parent
1cbb213706
commit
a4810308a1
@ -238,7 +238,7 @@ $@"🕔`{prettyCurrentTime}` **Message** 📝 `#{e.Channel.Name}`
|
|||||||
var config = SpecificConfigurations.Default.Of(e.Server.Id);
|
var config = SpecificConfigurations.Default.Of(e.Server.Id);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var chId = config.LogServerChannel;
|
var chId = config.LogPresenceChannel;
|
||||||
if (chId != null)
|
if (chId != null)
|
||||||
{
|
{
|
||||||
Channel ch;
|
Channel ch;
|
||||||
@ -365,6 +365,8 @@ $@"🕔`{prettyCurrentTime}` **Message** 📝 `#{e.Channel.Name}`
|
|||||||
Channel ch;
|
Channel ch;
|
||||||
if ((ch = e.Server.TextChannels.Where(tc => tc.Id == chId).FirstOrDefault()) == null)
|
if ((ch = e.Server.TextChannels.Where(tc => tc.Id == chId).FirstOrDefault()) == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
SpecificConfigurations.Default.Of (e.Server.Id).LogServerChannel = null;
|
||||||
await e.Channel.SendMessage($"❗**NO LONGER LOGGING IN {ch.Mention} CHANNEL**❗").ConfigureAwait(false);
|
await e.Channel.SendMessage($"❗**NO LONGER LOGGING IN {ch.Mention} CHANNEL**❗").ConfigureAwait(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -373,14 +375,14 @@ $@"🕔`{prettyCurrentTime}` **Message** 📝 `#{e.Channel.Name}`
|
|||||||
.AddCheck(SimpleCheckers.ManageServer())
|
.AddCheck(SimpleCheckers.ManageServer())
|
||||||
.Do(async e =>
|
.Do(async e =>
|
||||||
{
|
{
|
||||||
var chId = SpecificConfigurations.Default.Of(e.Server.Id).LogServerChannel;
|
var chId = SpecificConfigurations.Default.Of(e.Server.Id).LogPresenceChannel;
|
||||||
if (chId == null)
|
if (chId == null)
|
||||||
{
|
{
|
||||||
SpecificConfigurations.Default.Of(e.Server.Id).LogServerChannel = e.Channel.Id;
|
SpecificConfigurations.Default.Of(e.Server.Id).LogPresenceChannel = e.Channel.Id;
|
||||||
await e.Channel.SendMessage($"**User presence notifications enabled.**").ConfigureAwait(false);
|
await e.Channel.SendMessage($"**User presence notifications enabled.**").ConfigureAwait(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SpecificConfigurations.Default.Of(e.Server.Id).LogServerChannel = null;
|
SpecificConfigurations.Default.Of(e.Server.Id).LogPresenceChannel = null;
|
||||||
await e.Channel.SendMessage($"**User presence notifications disabled.**").ConfigureAwait(false);
|
await e.Channel.SendMessage($"**User presence notifications disabled.**").ConfigureAwait(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user