#Here it inits a new guild specific config in storage.db like all the commands enabled, events, or some specific storage like reputation.
defsql_guild_init(self,serverid):
# Define the SQL statement to create a table
conn=self.bot.api.db_api.connection
cursor=self.bot.api.db_api.cursor
sql="""
CREATETABLEessentials_server_serverid(
command_pingTEXT(1,1)DEFAULT(TRUE),
command_sayTEXT(1,1)DEFAULT(TRUE),
command_serverinfoTEXT(1,1)DEFAULT(TRUE),
command_avatarTEXT(1,1)DEFAULT(TRUE),
command_whoisTEXT(1,1)DEFAULT(TRUE),
command_embedTEXT(1,1)DEFAULT(TRUE),
command_cleanTEXT(1,1)DEFAULT(TRUE),
command_lockTEXT(1,1)DEFAULT(TRUE),
command_unlockTEXT(1,1)DEFAULT(TRUE),
command_lockdownTEXT(1,1)DEFAULT(FALSE),
command_unlockdownTEXT(1,1)DEFAULT(FALSE),
event_goodbye_enabledTEXT(1,1)DEFAULT(TRUE),
event_goodbye_titleTEXT(1,1)DEFAULT'Goodbye',
event_goodbye_messageTEXT(1,1)DEFAULT'{member.display_name} has left the server.',
event_goodbye_channelidTEXT(1,1)DEFAULT'INSERT THE CHANNEL ID OF THE CHANNEL TO SEND THE GOODBYE MEESAGE HERE',
event_welcome_enabledTEXT(1,1)DEFAULT(TRUE),
event_welcome_titleTEXT(1,1)DEFAULT'Welcome',
event_welcome_messageTEXT(1,1)DEFAULT'Welcome to the server {member.mention} :wave:',
event_welcome_channelidTEXT(1,1)DEFAULT'INSERT THE CHANNEL ID OF THE GOODBYE CHANNEL CAN BE THE SAME AS THE WELCOME CHANNEL'
);"""
sql=sql.replace("serverid",str(serverid))
#return sql
# Execute the SQL statement
cursor.execute(sql)
# Commit the transaction
conn.commit()
defsql_init(self):
pass
@discord.Cog.listener()
asyncdefon_member_join(self,member):
@ -110,7 +148,7 @@ class EssentialCommands(commands.Cog):
embed=discord.Embed(description=f"You have given {reputation_type} reputation to {user.mention} with the comment: {comment}",title="You have given reputation.")
awaitmessage.channel.send(embed=embed)
@commands.slash_command()
@commands.slash_command(guild_ids=guild_ids)
asyncdefreputation(self,ctx,user:discord.User):
# load the reputation data from the TOML file
try:
@ -158,6 +196,10 @@ class EssentialCommands(commands.Cog):