Skip to content

Commit

Permalink
merge plsrge branch 'main' of https://github.com/makayla-moster/Hamme…
Browse files Browse the repository at this point in the history
  • Loading branch information
EC2 Default User committed Sep 16, 2023
2 parents 6681d26 + 4754f06 commit b501b29
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 2 additions & 3 deletions cog_modules/random/cog.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import asyncio
import os
import pickle
import random

import discord
Expand All @@ -10,8 +11,6 @@
from gizmopics import *
from resources import gizmoResources

import pickle

load_dotenv()
CATS = os.getenv("x-api-key")
botDMs = int(os.getenv("DMChannel"))
Expand Down Expand Up @@ -44,7 +43,7 @@ async def gizmo(self, ctx: commands.Context):
info = f"Gizmo #{num + 1} of {len(gizmoPics)}."
pic = gizmoPics[num]
gizmoResources[pic] += 1
with open('gizmoResources','wb') as f:
with open("gizmoResources", "wb") as f:
pickle.dump(gizmoResources, f)
most_common = gizmoResources.most_common(1)
if pic == most_common[0][0]:
Expand Down
5 changes: 3 additions & 2 deletions resources.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from collections import Counter
import pickle
from collections import Counter

serverResources = {
"quela": {"Food": "-1068", "Wood": "449", "Gold": "-826", "Stone": "12"},
"bshammer": {"Food": "-1250", "Wood": "-622", "Gold": "-850", "Stone": "1942"},
Expand All @@ -8,7 +9,7 @@
".harristotle": {"Food": "-2241", "Wood": "560", "Gold": "-986", "Stone": "-706"},
}
try:
with open('gizmoResources','rb') as f:
with open("gizmoResources", "rb") as f:
gizmoResources = pickle.load(f)
except FileNotFoundError:
gizmoResources = Counter()

0 comments on commit b501b29

Please sign in to comment.