Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions conf.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
##conf.py
import os
path = os.path.dirname(__file__)
vaultPath = path + "\\vault\\"
meaningsPath = [path + "\\meanings\\tarotMeanings.tsv"]
imgPath = path + "\\images\\tarot\\"
deckPrefsPath = path + "\\settings\\deckPrefs"
talkingChannelsPath = path + "\\settings\\talkingChannels"
layoutsPath = path + "\\meanings\\layouts"
sigilImagesPath = path + "\\images\\"
vaultPath = path + "/vault/"
meaningsPath = [path + "/meanings/tarotMeanings.tsv"]
imgPath = path + "/images/tarot/"
deckPrefsPath = path + "/settings/deckPrefs"
talkingChannelsPath = path + "/settings/talkingChannels"
layoutsPath = path + "/meanings/layouts"
sigilImagesPath = path + "/images/"


defaultDeck = "Biddy"
Expand Down
19 changes: 10 additions & 9 deletions newGaia.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
#### variables
test_guild_id = 572854786513174529
guilds=[]#727652231419002880, 775449492232208404, 572854786513174529, 923448242107207720, 1149038131673309324]
prefix="!g"
prefix="!t"
intents = nextcord.Intents.default()
intents.messages = True
intents.reactions = True
intents.message_content = True
callAt = "<@1024094680968855663>"
talkChance = 100 ##higher is less probable
talkChance = 120#100 ##higher is less probable
##### filepaths


Expand Down Expand Up @@ -79,7 +79,7 @@ async def on_message(message):
ctx = await bot.get_context(message)
if(message.content.startswith(prefix) or callAt in message.content): ##are we in a command? checking for prefix or callAt
print(f"##################\nCommand Recieved:\n\"{message.content}\"\n{message} ")
messageAuthor = str(message.author.name) #message author
messageAuthor = str(message.author) #message author
prefs = await getPrefs(deckPrefsPath, messageAuthor)
sendDeck = decks[prefs[0]]
sendArt = prefs[1]
Expand Down Expand Up @@ -120,12 +120,12 @@ async def on_message(message):
print(f"talking! count is {current['count']}, was bigger than {chance}")
with open("talkingChanceData.csv", "a") as myfile:
myfile.write(f"{current['count']},")
current['count'] = 0
current['count'] = -5
prefArt = random.choice(artChoices)
prefDeck = decks['Biddy']
s.close()
await drawCard(message, prefDeck, prefArt, message.content, ctx)
print(f"Chance: {str(chance)} Count: {str(current['count'])} \n")
# print(f"Chance: {str(chance)} Count: {str(current['count'])} \n")

# # Drawing cards
# @bot.command()
Expand All @@ -134,8 +134,8 @@ async def on_message(message):
# await drawCard(mess, deck, art, prompt, ctx)

## deck prefences
@bot.slash_command(description="Sets which deck you want Gaia to use for you!", guild_ids=guilds)
async def choosedeck(
@bot.slash_command(description="Sets which art you want Gaia to use for you!", guild_ids=guilds)
async def chooseart(
ctx,
# deck: str = SlashOption(name="deck", choices=deckChoices, required=False, default=defaultDeck),
art: str = SlashOption(name="art", choices=artChoices, required=True, default=defaultArt)
Expand All @@ -146,13 +146,14 @@ async def choosedeck(
await savePrefs(deckPrefsPath, messageAuthor, deck, art)
await ctx.send(f'Saved your preferences with art: {art} and meanings: {deck}')


@bot.slash_command(description="Lets Gaia talk in this channel freely (has a small chance to respond to a message with a card)", guild_ids=guilds)
async def gaiatalking(
ctx,
talks: bool = SlashOption(name="talks", required=False, default=True),
everywhere: bool = SlashOption(name="everywhere", required=False, default=False)
):
messageAuthor = str(ctx.user.name)
messageAuthor = str(ctx.user)
cID = str(ctx.channel.id)
guildID = str(ctx.channel.guild.id)
print(f"##################\nLetting Gaia talk in channel:{cID} in guild:{guildID} for {messageAuthor} ")
Expand All @@ -166,7 +167,7 @@ async def gaiatalking(
s[guildID][cID]['chance'] = talkChance
s[guildID][cID]['count'] = 0
print(f"s[guildID][cID] = {s[guildID][cID]}")
await ctx.send(f"Gaia can talk in this channel: {talks}")
await ctx.send(f"Gaia can talk in this channel: {talks}\nGaia can talk everywhere: {everywhere}")



Expand Down
Binary file modified settings/deckPrefs.dat
Binary file not shown.
Binary file modified settings/talkingChannels.dat
Binary file not shown.
1 change: 1 addition & 0 deletions settings/talkingChannels.dir
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'572854786513174529', (0, 140)
'775449492232208404', (512, 70)
'1149038131673309324', (1024, 71)
'1090392935746502746', (1536, 310)
2 changes: 1 addition & 1 deletion talkingChanceData.csv
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16,27,9,17,13,20,10,16,14,10,12,19,6,14,
16,27,9,17,13,20,10,16,14,10,12,19,6,14,5,19,25,5,21,
6 changes: 3 additions & 3 deletions tarotFuncs.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ async def drawCard(mess, deck, art, prompt, ctx):
# {message, card, art, ctx} -> DISPLAY -> {msg{embed}} {fullButton}

async def dispCard(mess, card, art, ctx):
print(f'displaying card: {card.name}, with art {art}')
cardIcon = imgPath + art + "\\" + card.icon
print(f'displaying card: {card.name}, art: {art}')
cardIcon = imgPath + art.lower() + "/" + card.icon
msg = nextcord.Embed(title=card.name, description=(card.upright), color=mess.author.color)
file = nextcord.File(cardIcon, filename="image.png")
msg.set_image(url=f"attachment://image.png")
Expand Down Expand Up @@ -90,4 +90,4 @@ async def getPrefs(deckPrefsPath, name):