Skip to content
This repository was archived by the owner on Feb 7, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions cogs/fun.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Imports
import discord
from discord import option, ApplicationContext
from discord.ext import commands

# Variables
color = discord.Color.random()

# Functions
class Fun(commands.Cog):
def __init__(self, bot):
self.bot = bot

@commands.slash_command(
name='stroketranslate',
description='Gives you the ability to make full words and sentences from a cluster of letters'
)
@option(name="strok", description="What do you want to translate?", type=str)
async def stroketranslate(self, ctx: ApplicationContext, strok: str):
try:
if len(strok) > 300: return await ctx.respond("Please use no more than `300` character length", ephemeral=True)
else:
with open(f"{os.getcwd()}/config/words.json", "r") as f: words = json.load(f)
var = str()
s = strok.lower()
for i, c in enumerate(s): var += random.choice(words[c])
return await ctx.respond(f"{var}")
except Exception as e: return await ctx.respond(f"{type(e).__name__}: {e}")
var = ''.join(arr)
await ctx.respond(f"{var}")

# Initialization
def setup(bot): bot.add_cog(Fun(bot))
20 changes: 1 addition & 19 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,24 +284,6 @@ async def sync(ctx: ApplicationContext):
print(e)
await ctx.respond('An error occured while resyncing. Check console.', ephemeral=True)

@client.slash_command(
name='stroketranslate',
description='Gives you the ability to make full words and sentences from a cluster of letters'
)
@option(name="strok", description="What do you want to translate?", type=str)
async def stroketranslate(ctx: ApplicationContext, strok: str):
try:
if len(strok) > 300: return await ctx.respond("Please use no more than `300` character length", ephemeral=True)
else:
with open(f"{os.getcwd()}/config/words.json", "r") as f: words = json.load(f)
var = str()
s = strok.lower()
for i, c in enumerate(s): var += random.choice(words[c])
return await ctx.respond(f"{var}")
except Exception as e: return await ctx.respond(f"{type(e).__name__}: {e}")
var = ''.join(arr)
await ctx.respond(f"{var}")

@client.slash_command(
name='prediction',
description='Randomly predicts a yes/no question.'
Expand Down Expand Up @@ -468,7 +450,7 @@ async def stats(ctx: ApplicationContext, user: discord.User):
ctx.respond("This event has been concluded! Come back to this command later for new events!", ephemeral=True)

# Initialization
active_cogs = ["economy", "maths", "moderation", "reddit", "minigames", "automod", "isobank", "levelling"]
active_cogs = ["economy", "maths", "moderation", "reddit", "minigames", "automod", "isobank", "levelling", "fun"]
i = 1
cog_errors = 0
for x in active_cogs:
Expand Down