Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added basic boost message Re-direction #8

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
12 changes: 12 additions & 0 deletions src/extensions/boosts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import interactions as discord
import main

class boosts(discord.Extension):
def __init__(self, client):
self.client: discord.Client = client

@discord.listen()
async def on_message(self, event: discord.events.MessageCreate):
if event.message.type == 8:
channel = await self.client.fetch_channel(627542044390457350)
await channel.send(event.message.content)
4 changes: 3 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
logger.debug(f"Debug mode is {DEBUG}; You can safely ignore this.")

# Initialize the client
intents = discord.Intents.DEFAULT | discord.Intents.MESSAGE_CONTENT
client = discord.Client(
token=TOKEN,
intents=intents,
activity=discord.Activity(
name="Webgroup issues", type=discord.ActivityType.WATCHING
),
Expand All @@ -36,7 +38,7 @@
# Load custom extensions

logger.debug("Working directory: " + str(Path.cwd()))
extensions = [Path(f).stem for f in glob.iglob("/app/src/extensions/*.py")]
extensions = [Path(f).stem for f in glob.iglob("./src/extensions/*.py")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tested that the command is properly loaded with this glob in a container environment?

logger.debug(f"Found extensions: {extensions}")

for extension in extensions:
Expand Down