mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
fix: crash when no prefixes in config file
This commit is contained in:
parent
d0515645d0
commit
4bfee8a090
3 changed files with 3 additions and 3 deletions
|
|
@ -44,7 +44,7 @@ public class InteractionCreated: IEventHandler<InteractionCreateEvent>
|
||||||
if (customId == null) return;
|
if (customId == null) return;
|
||||||
|
|
||||||
if (customId.Contains("help-menu"))
|
if (customId.Contains("help-menu"))
|
||||||
await Help.ButtonClick(ctx, (_config.Prefixes[0] ?? BotConfig.DefaultPrefixes[0]));
|
await Help.ButtonClick(ctx, (_config.Prefixes?[0] ?? BotConfig.DefaultPrefixes[0]));
|
||||||
else
|
else
|
||||||
await _interactionDispatch.Dispatch(customId, ctx);
|
await _interactionDispatch.Dispatch(customId, ctx);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -174,7 +174,7 @@ public class MessageCreated: IEventHandler<MessageCreateEvent>
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return await _proxy.HandleIncomingMessage(evt, ctx, guild, channel, true, botPermissions, (_config.Prefixes[0] ?? BotConfig.DefaultPrefixes[0]));
|
return await _proxy.HandleIncomingMessage(evt, ctx, guild, channel, true, botPermissions, (_config.Prefixes?[0] ?? BotConfig.DefaultPrefixes[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Catch any failed proxy checks so they get ignored in the global error handler
|
// Catch any failed proxy checks so they get ignored in the global error handler
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ public class MessageEdited: IEventHandler<MessageUpdateEvent>
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await _proxy.HandleIncomingMessage(equivalentEvt, ctx, allowAutoproxy: false, guild: guild,
|
await _proxy.HandleIncomingMessage(equivalentEvt, ctx, allowAutoproxy: false, guild: guild,
|
||||||
channel: channel, botPermissions: botPermissions, prefix: (_config.Prefixes[0] ?? BotConfig.DefaultPrefixes[0]));
|
channel: channel, botPermissions: botPermissions, prefix: (_config.Prefixes?[0] ?? BotConfig.DefaultPrefixes[0]));
|
||||||
}
|
}
|
||||||
// Catch any failed proxy checks so they get ignored in the global error handler
|
// Catch any failed proxy checks so they get ignored in the global error handler
|
||||||
catch (ProxyService.ProxyChecksFailedException) { }
|
catch (ProxyService.ProxyChecksFailedException) { }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue