Help me in python sdk idk why this error occured but it was not before 2 days it occured today even if the data is not None it says none and am also providing the same data type as in attribute.
Codes.
@commands.command(name="addofficial", aliases=['addstaff', 'aoff'], help="Adds an user as official to DB.")
@commands.is_owner()
async def addofficial(self, ctx: commands.Context, user: discord.Member):
if not user:
await ctx.send("Please mention/send an userId")
else:
await addOfficialToDB(id=str(user.id))
await ctx.send("Done!")
addOfficialToDB func,
async def addOfficialToDB(id: str):
try:
databases.create_document(
database_id=os.environ.get("DB_ID"),
collection_id=os.environ.get("DB_OFFC_COLLECTION_ID"),
document_id=ID.unique(),
data={
"id": str(id)
}
)
await WebLog(f"Added official {id} to database.")
except AppwriteException as e:
print(e.message)
Error:
unsupported operand type(s) for +: 'NoneType' and 'str'
Maybe the environment variables aren't set
Btw, I suggest you don't wrap stuff with str because you're forcing things to be strings which can mask problems
let me try this if it can fix
huh everything is fine
in .env
Recommended threads
- Issue with Custom SMTP
Hey everyone, I'm facing an issue when updating my Custom SMTP settings on Appwrite Cloud. The UI fails silently (no visual errors), but when checking the cons...
- Function running for more than 2 hours i...
This is my projectID: 669fe01b003800dd0503 Cloud functionID is 696ea05400147eb8eb3b I hope this doesn't count against my GB-hours?
- Session not found. Please run appwrite l...
I have encounter an issue with appwrite CLI They asking for a login session but in the doc, itβs mention that only setup client with endpoint / api key is enou...