Skip to content
This repository has been archived by the owner on Oct 28, 2023. It is now read-only.

Commit

Permalink
Storage fixes+requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
Xabi08YT committed Sep 2, 2023
1 parent 53ee6ea commit e8271e3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 8 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from nextcord.ext import commands, application_checks
from json import dump,load
import unidecode
#from emoji import *
from os import listdir, mkdir, getcwd, path


Expand Down Expand Up @@ -155,6 +154,7 @@ async def role(interaction: nextcord.Interaction, categorie: str = nextcord.Slas
async def rolemsg(interaction :nextcord.Interaction, message:str = nextcord.SlashOption(required=True), emotes:str = nextcord.SlashOption(required=True), roles:str = nextcord.SlashOption(required=True)):
try:
global datas
print(datas.datasets)
await interaction.send("Création...")
print(emotes, roles)
emotes = emotes.split(",")
Expand All @@ -170,17 +170,20 @@ async def rolemsg(interaction :nextcord.Interaction, message:str = nextcord.Slas
for emote,role in zip(emotes,roles):
print(emote)
await msg.add_reaction(emote)
assignTable[emote] = role
assignTable[emote] = str(role)
print(assignTable)
print(msg.guild.id)
if msg.guild.id not in datas.datasets.keys():
print(msg.id)
print()
if str(msg.guild.id) not in datas.datasets.keys():
print("coucou")
_tmp = Dataset(str(msg.guild.id))
_tmp.add_data(msg.id,assignTable)
_tmp.add_data(str(msg.id),assignTable)
_tmp.save_data(msg.guild.id)
datas.add_dataset(_tmp)
else:
_tmp = datas.datasets[str(msg.guild.id)]
_tmp.add_data(msg.id,assignTable)
_tmp.add_data(str(msg.id),assignTable)
_tmp.save_data(msg.guild.id)
except Exception as error:
print(error)
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
unidecode
nextcord

0 comments on commit e8271e3

Please sign in to comment.