Skip to content

Commit

Permalink
Fixed Mapster bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kainazzzo committed Apr 18, 2023
1 parent 0600137 commit 26812f7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Chat/Discord/DiscordBot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,17 @@ public record ChannelOptions
private readonly OpenAILogic _openAILogic;
private readonly GPTParameters _defaultParameters;
private readonly Dictionary<ulong, ChannelState> _channelBots = new();
private readonly TypeAdapterConfig _mapConfig;

public DiscordBot(DiscordSocketClient client, IConfiguration configuration, OpenAILogic openAILogic, GPTParameters defaultParameters)
{
_client = client;
_configuration = configuration;
_openAILogic = openAILogic;
_defaultParameters = defaultParameters;

_mapConfig = new TypeAdapterConfig();
_mapConfig.ForType<GPTParameters, GPTParameters>().Ignore(m => m.Stream);
}

// A method that clones GPTParameters
Expand Down Expand Up @@ -323,6 +327,8 @@ await foreach (var response in responses)
" emoji reaction on any message. Instructions are like 'sticky' chat messages that provide upfront context to the bot.")
};



public IEnumerable<ChatMessage> PrimeDirective => _defaultPrimeDirective;

private DiscordBot.ChannelState InitializeChannel(ulong channelId)
Expand Down
2 changes: 1 addition & 1 deletion Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ private static void ConfigureServices(IServiceCollection services, GPTParameters
{
var config = new DiscordSocketConfig
{
GatewayIntents = GatewayIntents.Guilds | GatewayIntents.GuildMessages | GatewayIntents.GuildMembers | GatewayIntents.GuildPresences |
GatewayIntents = GatewayIntents.Guilds | GatewayIntents.GuildMessages | GatewayIntents.GuildMembers |
GatewayIntents.MessageContent | GatewayIntents.DirectMessages | GatewayIntents.DirectMessageReactions |
GatewayIntents.GuildMessageReactions | GatewayIntents.GuildEmojis,
MessageCacheSize = 100
Expand Down

0 comments on commit 26812f7

Please sign in to comment.