mirror of
https://github.com/RPCS3/discord-bot.git
synced 2024-12-14 22:38:38 +00:00
fix potential issues with the playable status handler
This commit is contained in:
parent
90f1ba2044
commit
3b32069426
@ -61,14 +61,14 @@ namespace CompatBot.EventHandlers
|
||||
return;
|
||||
|
||||
gameTitle = CompatList.FixGameTitleSearch(gameTitle);
|
||||
if (ProductCodeLookup.ProductCode.IsMatch(args.Message.Content))
|
||||
if (!string.IsNullOrEmpty(args.Message.Content) && ProductCodeLookup.ProductCode.IsMatch(args.Message.Content))
|
||||
return;
|
||||
|
||||
var (_, info) = await LookupGameAsync(args.Channel, args.Message, gameTitle).ConfigureAwait(false);
|
||||
var botSpamChannel = await args.Client.GetChannelAsync(Config.BotSpamId).ConfigureAwait(false);
|
||||
gameTitle = info.Title.StripMarks();
|
||||
var msg = $"{args.Message.Author.Mention} {gameTitle} is {info.Status.ToLowerInvariant()} since {info.ToUpdated()}\n" +
|
||||
$"for more results please use compatibility list (<https://rpcs3.net/compatibility>) or `{Config.CommandPrefix}c` command in {botSpamChannel.Mention} (`!c {gameTitle.Sanitize()}`)";
|
||||
gameTitle = info?.Title?.StripMarks();
|
||||
var msg = $"{args.Message.Author.Mention} {gameTitle} is {info?.Status?.ToLowerInvariant()} since {info?.ToUpdated()}\n" +
|
||||
$"for more results please use compatibility list (<https://rpcs3.net/compatibility>) or `{Config.CommandPrefix}c` command in {botSpamChannel.Mention} (`!c {gameTitle?.Sanitize()}`)";
|
||||
await args.Channel.SendMessageAsync(msg).ConfigureAwait(false);
|
||||
CooldownBuckets[args.Channel.Id] = DateTime.UtcNow;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user