Skip to content

Commit

Permalink
Changes tempacts to use guild ID for storage instead of guild owner ID
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Bereza committed Apr 2, 2020
1 parent b61ffa7 commit d7ba5ed
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions BotCatMaxy/Data.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,8 @@ public static IMongoCollection<BsonDocument> GetInfractionsCollection(this IGuil
public static IMongoCollection<BsonDocument> GetActHistoryCollection(this IGuild guild, bool createDir = true) {
var db = MainClass.dbClient.GetDatabase("ActHistory");
var guildCollection = db.GetCollection<BsonDocument>(guild.Id.ToString());
var ownerCollection = db.GetCollection<BsonDocument>(guild.OwnerId.ToString());
if (guildCollection.CountDocuments(new BsonDocument()) > 0) {
if (guildCollection.CountDocuments(new BsonDocument()) > 0 || createDir) {
return guildCollection;
} else if (ownerCollection.CountDocuments(new BsonDocument()) > 0 || createDir) {
return ownerCollection;
}

return null;
Expand Down

0 comments on commit d7ba5ed

Please sign in to comment.