Removed unneeded print calls and unfinished functions #TBD

This commit is contained in:
Entarno54 2025-05-11 17:42:51 +07:00
parent e6de109214
commit b6cd28e4a0
5 changed files with 4 additions and 21 deletions

View File

@ -10,8 +10,6 @@ class LogCommands(commands.Cog):
@commands.command(description="Set a log channel for this server.", usage={"#channel"}) @commands.command(description="Set a log channel for this server.", usage={"#channel"})
@commands.has_permissions(administrator = True) @commands.has_permissions(administrator = True)
async def setlogchannel(self, ctx: nextcord.Message, channel: nextcord.TextChannel): async def setlogchannel(self, ctx: nextcord.Message, channel: nextcord.TextChannel):
print(ctx.author, channel)
guildInfo = await parsedinfo.find("guild", "id", ctx.guild.id) guildInfo = await parsedinfo.find("guild", "id", ctx.guild.id)
if not guildInfo: if not guildInfo:

View File

@ -31,7 +31,6 @@ class Voice(commands.Cog):
@commands.command(description="Join the voice channel.") @commands.command(description="Join the voice channel.")
async def join(self, ctx: nextcord.Message): async def join(self, ctx: nextcord.Message):
print("Joining")
if not ctx.guild.voice_client: if not ctx.guild.voice_client:
if ctx.author.voice: if ctx.author.voice:
await ctx.author.voice.channel.connect() await ctx.author.voice.channel.connect()
@ -43,7 +42,6 @@ class Voice(commands.Cog):
@commands.command(description="Leaves the voice channel.") @commands.command(description="Leaves the voice channel.")
async def leave(self, ctx: nextcord.Message): async def leave(self, ctx: nextcord.Message):
print("Leaving")
if ctx.guild.voice_client: if ctx.guild.voice_client:
await ctx.guild.voice_client.disconnect(force=True) await ctx.guild.voice_client.disconnect(force=True)
await ctx.reply("Left.") await ctx.reply("Left.")
@ -110,9 +108,7 @@ class Voice(commands.Cog):
@client.event @client.event
async def on_voice_state_update(member: nextcord.Member, before: nextcord.VoiceState, after: nextcord.VoiceState): async def on_voice_state_update(member: nextcord.Member, before: nextcord.VoiceState, after: nextcord.VoiceState):
print(member, before, after)
if before.channel and not after.channel: if before.channel and not after.channel:
print(f'{member} left a vc.')
if before.channel.members.__len__() == 1 and member.guild.voice_client and member.guild.voice_client.channel == before.channel: if before.channel.members.__len__() == 1 and member.guild.voice_client and member.guild.voice_client.channel == before.channel:
await before.channel.guild.voice_client.disconnect(force=True) await before.channel.guild.voice_client.disconnect(force=True)

View File

@ -20,10 +20,9 @@ async def getResponse(SquogMessageList):
SquogResponse = SquogAI.chat.completions.create(messages=SquogMessageList, model="gpt-4o", temperature=0.9) SquogResponse = SquogAI.chat.completions.create(messages=SquogMessageList, model="gpt-4o", temperature=0.9)
return json.loads(SquogResponse.model_dump_json()) return json.loads(SquogResponse.model_dump_json())
async def find(list: list, param: str, value: any): async def find(listIterate: list, param: str, value: any):
found = None found = None
for g in list: for g in listIterate:
print(g)
if g[param] == value: if g[param] == value:
found = g found = g
return found return found
@ -66,8 +65,6 @@ class AI(commands.Cog):
SquogResponse = await getResponse(SquogUser["messages"]) SquogResponse = await getResponse(SquogUser["messages"])
print(SquogResponse)
SquogUser["messages"].append(SquogResponse["choices"][0]["message"]) SquogUser["messages"].append(SquogResponse["choices"][0]["message"])
await message.reply(SquogResponse["choices"][0]["message"]["content"]) await message.reply(SquogResponse["choices"][0]["message"]["content"])

View File

@ -43,11 +43,5 @@ class Logger(commands.Cog):
channel = ctx.guild.get_channel(guild["log-channel"]) channel = ctx.guild.get_channel(guild["log-channel"])
await channel.send(embed=embed) await channel.send(embed=embed)
@commands.Cog.listener()
async def on_ready(self):
print("Bot logged")
# self.mod = self.client.get_channel(1356577069068324986)
def setup(bot): def setup(bot):
bot.add_cog(Logger(bot)) bot.add_cog(Logger(bot))

View File

@ -7,13 +7,11 @@ class Members(commands.Cog):
@commands.Cog.listener() @commands.Cog.listener()
async def on_member_join(self, member: nextcord.Member): async def on_member_join(self, member: nextcord.Member):
print(f"Member {member.display_name} joined")
if member.guild.id == 1356433463854497944: # Only for the squog server if member.guild.id == 1356433463854497944: # Only for the squog server
await member.add_roles(nextcord.utils.get(member.guild.roles, name="Squog")) await member.add_roles(nextcord.utils.get(member.guild.roles, name="Squog"))
@commands.Cog.listener() #@commands.Cog.listener() #This is to be added yet
async def on_member_remove(self, member: nextcord.Member): #async def on_member_remove(self, member: nextcord.Member):
print(f"Member {member.display_name} left")
def setup(bot): def setup(bot):
bot.add_cog(Members(bot)) bot.add_cog(Members(bot))