Skip to content

Commit

Permalink
give_role command fixed!! overall typechecking improvement, new chat …
Browse files Browse the repository at this point in the history
…module with added chat memory!!
  • Loading branch information
Hunter87ff committed Aug 1, 2024
1 parent de6e78b commit a74f6ff
Show file tree
Hide file tree
Showing 13 changed files with 323 additions and 437 deletions.
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM python:3.10-slim
WORKDIR /app
COPY . .
# COPY requirements.txt requirements.txt
RUN pip install -r src/requirements.txt
EXPOSE 8787
RUN python src/runner.py
17 changes: 0 additions & 17 deletions src/Dockerfile

This file was deleted.

73 changes: 37 additions & 36 deletions src/core/channel.py
Original file line number Diff line number Diff line change
@@ -1,49 +1,47 @@
import discord
from discord.ext import commands
from asyncio import sleep
cmd = commands
from discord.ui import Button, View
from modules import config




class Channel(commands.Cog):
def __init__(self, bot):
self.bot = bot
@cmd.command(aliases=['chm'])
self.bot:commands.Bot = bot


@commands.command(aliases=['chm'])
@commands.has_permissions(manage_channels=True)
@commands.bot_has_permissions(manage_channels=True)
async def channel_make(self, ctx, *names):
if ctx.author.bot:
return
if not await config.voted(ctx, bot=self.bot):
return await config.vtm(ctx)
try:
ms = await ctx.send("Processing...")
except:
pass
async def channel_make(self, ctx:commands.Context, *names):
if ctx.author.bot:return
if not await config.voted(ctx, bot=self.bot):return await config.vtm(ctx)
ms = await ctx.send("Processing...")
for name in names:
await ctx.guild.create_text_channel(name, reason=f"created by : {ctx.author}")
await sleep(1)
if ms:
await ms.edit(content=f'**<:vf:947194381172084767> All channels Created.**')
@cmd.command(aliases=['chd'])
await ms.edit(content=f'**{config.tick} | All channels Created.**')


@commands.command(aliases=['chd'])
@commands.has_permissions(manage_channels=True)
@commands.bot_has_permissions(manage_channels=True)
async def channel_del(self, ctx, *channels: discord.TextChannel):
try:
ms = await ctx.send("Processing...")
except:
pass
@commands.bot_has_permissions(manage_channels=True, send_messages=True)
async def channel_del(self, ctx:commands.Context, *channels: discord.TextChannel):
ms =await ctx.send("Processing...")
for ch in channels:
await ch.delete(reason=f"deleted by: {ctx.author}")
await sleep(1)
if ms:
await ms.edit(content=f'**<:vf:947194381172084767>`Channels deleted Successfully**')
@cmd.hybrid_command(with_app_commands=True, aliases=['dc'])
await ms.edit(content=f'**{config.tick} | Channels deleted Successfully**')


@commands.hybrid_command(with_app_commands=True, aliases=['dc'])
@commands.has_permissions(administrator=True)
@commands.bot_has_permissions(manage_channels=True)
async def delete_category(self, ctx, category: discord.CategoryChannel):
async def delete_category(self, ctx:commands.Context, category: discord.CategoryChannel):
await ctx.defer()
if ctx.author.bot:
return
if ctx.author.bot:return
if not await config.voted(ctx, bot=self.bot):
return await config.vtm(ctx)
bt11 = Button(label="Confirm", style=discord.ButtonStyle.danger, custom_id="dcd_btn")
Expand All @@ -52,11 +50,10 @@ async def delete_category(self, ctx, category: discord.CategoryChannel):
for i in [bt11, bt12]:
view.add_item(i)
del_t_con = await ctx.reply(f"**Are You Sure To Delete `{category.name}`?**", view=view)
async def dc_confirmed(interaction):
async def dc_confirmed(interaction:discord.Interaction):
if not interaction.user.bot:
emb = discord.Embed(color=0x00ff00, description=f"**{config.loading} | Deleting `{category.name}` Category**")
await del_t_con.edit(content=None, embed=emb, view=None)
#await interaction.message.delete()
for channel in category.channels:
await channel.delete(reason=f'Deleted by {ctx.author.name}')
await sleep(1)
Expand All @@ -67,16 +64,20 @@ async def del_msg(interaction):
await interaction.message.delete()
bt11.callback = dc_confirmed
bt12.callback = del_msg
@cmd.command(aliases=["cch"])


@commands.command(aliases=["cch"])
@commands.has_permissions(manage_channels=True)
@commands.bot_has_permissions(manage_channels=True)
async def create_channel(self, ctx, category:discord.CategoryChannel, *names:str):
#await ctx.defer(ephemeral=True)
if ctx.author.bot:
return
async def create_channel(self, ctx:commands.Context, category:discord.CategoryChannel, *names:str):
if ctx.author.bot:return
ms = await ctx.send(embed=discord.Embed(description=f"**{config.loading} | Creating Channels...**"))
for name in names:
await ctx.guild.create_text_channel(name, category=category, reason=f"{ctx.author} created")
for name in names:await ctx.guild.create_text_channel(name, category=category, reason=f"{ctx.author} created")
await ms.edit(embed=discord.Embed(description=f"**{config.default_tick} | All Channels Created**", color=0x00ff00))





async def setup(bot):
await bot.add_cog(Channel(bot))
4 changes: 2 additions & 2 deletions src/core/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ async def dbupdate(self, ctx, key:str, *, value:Any):
await ctx.reply(e)


@cmd.hybrid_command(with_app_command=True)
@cmd.command()
@config.dev()
async def get_guild(self, ctx, id:discord.Guild):
async def get_guild(self, ctx:commands.Context, id:discord.Guild):
if ctx.author.bot: return
await ctx.defer()
guild = id #self.bot.get_guild(id)
Expand Down
Loading

0 comments on commit a74f6ff

Please sign in to comment.