mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
feat: beta bot patches
This commit is contained in:
parent
997458c9dc
commit
99a9ec7928
4 changed files with 32 additions and 6 deletions
|
|
@ -14,11 +14,13 @@ public class Api
|
|||
private static readonly Regex _webhookRegex =
|
||||
new("https://(?:\\w+.)?discord(?:app)?.com/api(?:/v.*)?/webhooks/(.*)");
|
||||
|
||||
private readonly BotConfig _botConfig;
|
||||
private readonly DispatchService _dispatch;
|
||||
private readonly ModelRepository _repo;
|
||||
|
||||
public Api(ModelRepository repo, DispatchService dispatch)
|
||||
public Api(BotConfig botConfig, ModelRepository repo, DispatchService dispatch)
|
||||
{
|
||||
_botConfig = botConfig;
|
||||
_repo = repo;
|
||||
_dispatch = dispatch;
|
||||
}
|
||||
|
|
@ -42,6 +44,13 @@ public class Api
|
|||
});
|
||||
await ctx.Rest.CreateMessage(dm.Id, new MessageRequest { Content = token });
|
||||
|
||||
if (_botConfig.IsBetaBot)
|
||||
await ctx.Rest.CreateMessage(dm.Id, new MessageRequest
|
||||
{
|
||||
Content = $"{Emojis.Note} The beta bot's API base URL is currently <{_botConfig.BetaBotAPIUrl}>."
|
||||
+ " You need to use this URL instead of the base URL listed on the documentation website."
|
||||
});
|
||||
|
||||
// If we're not already in a DM, reply with a reminder to check
|
||||
if (ctx.Channel.Type != Channel.ChannelType.Dm)
|
||||
await ctx.Reply($"{Emojis.Success} Check your DMs!");
|
||||
|
|
@ -87,6 +96,13 @@ public class Api
|
|||
var token = await MakeAndSetNewToken(ctx.System);
|
||||
await ctx.Rest.CreateMessage(dm.Id, new MessageRequest { Content = token });
|
||||
|
||||
if (_botConfig.IsBetaBot)
|
||||
await ctx.Rest.CreateMessage(dm.Id, new MessageRequest
|
||||
{
|
||||
Content = $"{Emojis.Note} The beta bot's API base URL is currently <{_botConfig.BetaBotAPIUrl}>."
|
||||
+ " You need to use this URL instead of the base URL listed on the documentation website."
|
||||
});
|
||||
|
||||
// If we're not already in a DM, reply with a reminder to check
|
||||
if (ctx.Channel.Type != Channel.ChannelType.Dm)
|
||||
await ctx.Reply($"{Emojis.Success} Check your DMs!");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue