Skip to content

Commit

Permalink
delete astro and json files
Browse files Browse the repository at this point in the history
  • Loading branch information
rtk-rnjn committed Jul 30, 2023
1 parent c43e6a3 commit 3952ace
Show file tree
Hide file tree
Showing 81 changed files with 30 additions and 58,006 deletions.
6 changes: 5 additions & 1 deletion cogs/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ def __init__(self, bot: Parrot) -> None:
self.token = os.environ["GITHUB_TOKEN"]

self.__internal_token_caching = set()

@property
def internal_token_cache(self) -> set[str]:
return self.__internal_token_caching

async def github_request(self, method, url, *, params=None, data=None, headers=None, repo=None):
hdrs = {
Expand Down Expand Up @@ -122,7 +126,7 @@ async def on_message(self, message: discord.Message) -> None:

if tokens and message.author.id != self.bot.user.id:
url = await self.create_gist("\n".join(tokens), description="Discord tokens detected")
msg = f"{message.author.mention}, I have found tokens and sent them to <{url}> to be invalidated for you."
msg = f"{message.author.mention}, found tokens and sent them to <{url}> to be invalidated for you."
self.__internal_token_caching.update(set(tokens))
with suppress(discord.HTTPException):
await message.channel.send(msg)
Expand Down
37 changes: 24 additions & 13 deletions cogs/roadmap_sh/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async def roadmap(self, interaction: discord.Interaction, button: discord.ui.But
self.link_groups.disabled = True
self.videos.disabled = True

await interaction.response.edit_message(embed=discord.Embed(description="Select a folder..."), view=self)
await interaction.response.edit_message(embed=self.embed.set_footer(text="Select a folder..."), view=self)

@discord.ui.button(label="Best Practices", style=discord.ButtonStyle.blurple)
async def best_practices(self, interaction: discord.Interaction, button: discord.ui.Button) -> None:
Expand All @@ -54,7 +54,7 @@ async def best_practices(self, interaction: discord.Interaction, button: discord
self.link_groups.disabled = True
self.videos.disabled = True

await interaction.response.edit_message(embed=discord.Embed(description="Select a folder..."), view=self)
await interaction.response.edit_message(embed=self.embed.set_footer(text="Select a folder..."), view=self)

@discord.ui.button(label="Link Groups", style=discord.ButtonStyle.blurple)
async def link_groups(self, interaction: discord.Interaction, button: discord.ui.Button) -> None:
Expand All @@ -72,7 +72,7 @@ async def link_groups(self, interaction: discord.Interaction, button: discord.ui
self.best_practices.disabled = True
self.videos.disabled = True

await interaction.response.edit_message(embed=discord.Embed(description="Select a folder..."), view=self)
await interaction.response.edit_message(embed=self.embed.set_footer(text="Select a folder..."), view=self)

@discord.ui.button(label="Videos", style=discord.ButtonStyle.blurple)
async def videos(self, interaction: discord.Interaction, button: discord.ui.Button) -> None:
Expand All @@ -89,16 +89,17 @@ async def videos(self, interaction: discord.Interaction, button: discord.ui.Butt
self.best_practices.disabled = True
self.link_groups.disabled = True

await interaction.response.edit_message(embed=discord.Embed(description="Select a folder..."), view=self)
await interaction.response.edit_message(embed=self.embed.set_footer(text="Select a folder..."), view=self)

async def start(self, ctx: Context) -> None:
self.ctx = ctx
self.embed = discord.Embed(
title="Developer Roadmaps",
description="[roadmap.sh](https://roadmap.sh) is a community effort to create roadmaps, guides and other educational content to help guide developers in picking up a path and guide their learnings.",
url="https://roadmap.sh/",
)
self.message = await ctx.send(
embed=discord.Embed(
title="Developer Roadmaps",
description="[roadmap.sh](https://roadmap.sh) is a community effort to create roadmaps, guides and other educational content to help guide developers in picking up a path and guide their learnings.",
url="https://roadmap.sh/",
),
embed=self.embed,
view=self,
)

Expand Down Expand Up @@ -129,7 +130,7 @@ async def send_file_embed(self, path: str, interaction: discord.Interaction) ->
async with aiofiles.open(path, mode="r", encoding="utf-8") as f:
content = await f.read()

page = commands.Paginator(prefix="", suffix="")
page = commands.Paginator(prefix="", suffix="", max_size=1990)
_ADD_LINE = True

for line in content.splitlines():
Expand All @@ -141,8 +142,11 @@ async def send_file_embed(self, path: str, interaction: discord.Interaction) ->
new_line = self.replace_partial_links(new_line)
page.add_line(new_line)

interference = PaginatorEmbedInterface(self.view.ctx, page, owner=self.view.ctx.author)
await interference.send_to(interaction.followup) # type: ignore
if page.pages:
interference = PaginatorEmbedInterface(self.view.ctx, page, owner=self.view.ctx.author)
await interference.send_to(interaction.followup) # type: ignore
else:
await interaction.followup.send("No content found.")

async def callback(self, interaction: discord.Interaction) -> None:
await interaction.response.defer()
Expand All @@ -157,4 +161,11 @@ async def callback(self, interaction: discord.Interaction) -> None:
select = ContentView(folders=[f"{folder}/{i}" for i in files])
self.view.add_item(select)

await interaction.followup.send(embed=discord.Embed(description="Select a file..."), view=self.view)
await interaction.followup.send(
embed=discord.Embed(
title="Developer Roadmaps",
description="[roadmap.sh](https://roadmap.sh) is a community effort to create roadmaps, guides and other educational content to help guide developers in picking up a path and guide their learnings.",
url="https://roadmap.sh/",
).set_footer(text="Select a file..."),
view=self.view,
)

This file was deleted.

1 change: 0 additions & 1 deletion extra/tutorials/best-practices/aws/aws.json

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion extra/tutorials/roadmaps/android/android.json

This file was deleted.

Empty file.
1 change: 0 additions & 1 deletion extra/tutorials/roadmaps/angular/angular.json

This file was deleted.

Empty file.
1 change: 0 additions & 1 deletion extra/tutorials/roadmaps/aspnet-core/aspnet-core.json

This file was deleted.

Empty file.
1 change: 0 additions & 1 deletion extra/tutorials/roadmaps/backend/backend.json

This file was deleted.

43 changes: 0 additions & 43 deletions extra/tutorials/roadmaps/backend/faqs.astro

This file was deleted.

1 change: 0 additions & 1 deletion extra/tutorials/roadmaps/blockchain/blockchain.json

This file was deleted.

Empty file.
1 change: 0 additions & 1 deletion extra/tutorials/roadmaps/code-review/code-review.json

This file was deleted.

Empty file.
Loading

0 comments on commit 3952ace

Please sign in to comment.