feat: Adds Discord integration for GM Pages (#2361)

This commit is contained in:
Bohica 2026-03-12 20:42:23 -07:00 committed by GitHub
parent 217d641861
commit 76395b77ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 234 additions and 2 deletions

View file

@ -127,6 +127,7 @@ namespace Server.Engines.Help
public static void Configure()
{
CommandSystem.Register("Pages", AccessLevel.Counselor, Pages_OnCommand);
PageDiscord.Configure();
}
public static bool CheckAllowedToPage(Mobile from)
@ -174,6 +175,8 @@ namespace Server.Engines.Help
m_KeyedByHandler[value] = entry;
}
_ = PageDiscord.SendPageHandlerUpdateAsync(entry, old, value);
if (old == null || value == null)
{
return;
@ -214,6 +217,11 @@ namespace Server.Engines.Help
e.Stop();
if (e.Handler != null)
{
_ = PageDiscord.SendPageCompletedAsync(e);
}
List.Remove(e);
m_KeyedBySender.Remove(e.Sender);
@ -261,7 +269,7 @@ namespace Server.Engines.Help
if (!isStaffOnline)
{
entry.Sender.SendMessage(
"We are sorry, but no staff members are currently available to assist you. Your page will remain in the queue until one becomes available, or until you cancel it manually."
"We are sorry, but no staff members are currently available to assist you. Your page will remain in the queue until one becomes available, or until you cancel it manually."
);
}
@ -270,7 +278,9 @@ namespace Server.Engines.Help
Email.SendQueueEmail(entry, GetPageTypeName(entry.Type));
}
_ = PageDiscord.SendPageNotificationAsync(entry);
HelpEvents.InvokePageEnqueued(entry);
}
}
}
}