Skip to content

Commit

Permalink
rename cogmanagermixin to cogmanagermixin
Browse files Browse the repository at this point in the history
  • Loading branch information
rutgerbeltman committed Sep 4, 2022
1 parent de1447f commit b7c3126
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion clanbotjas/cogmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from discord import option

import settings
from cogManagerMixin import commandlogger
from cogmanagermixin import commandlogger


class CogManager(commands.Cog):
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion clanbotjas/cogs/autorole.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import discord
from discord.ext import commands
from discord.utils import get
from cogManagerMixin import commandlogger
from cogmanagermixin import commandlogger

import settings

Expand Down
20 changes: 15 additions & 5 deletions clanbotjas/cogs/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,45 @@
from discord.ext import commands

import settings
from cogManagerMixin import commandlogger
from cogmanagermixin import commandlogger


class SayCommandModal(discord.ui.Modal):
def __init__(self) -> None:
super().__init__(title="Modal via Slash Command")
self.add_item(discord.ui.InputText(label="Say command input", style=discord.InputTextStyle.long, max_length=2000))
self.add_item(
discord.ui.InputText(
label="Say command input",
style=discord.InputTextStyle.long,
max_length=2000,
)
)

async def callback(self, interaction: discord.Interaction):
text = self.children[0].value
for channel in interaction.client.get_all_channels():
channelName = "#" + channel.name
channelName = "#" + channel.name
if channelName in text:
text = text.replace(channelName, channel.mention)
for member in interaction.client.get_all_members():
memberName = "@" + member.name
if memberName in text:
text = text.replace(memberName, member.mention)
for role in await interaction.client.get_guild(settings.DISCORD_GUILD_ID).fetch_roles():
for role in await interaction.client.get_guild(
settings.DISCORD_GUILD_ID
).fetch_roles():
if role.name.startswith("@"):
roleName = role.name
else:
roleName = "@" + role.name

if roleName in text:
text = text.replace(roleName, role.mention)

await interaction.channel.send(text)
await interaction.response.send_message("Message was sent.", ephemeral=True)


class Commands(commands.Cog):
def __init__(self, client):
self.client = client
Expand Down
2 changes: 1 addition & 1 deletion clanbotjas/cogs/pollbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from discord import option
from discord.commands.options import OptionChoice

from cogManagerMixin import commandlogger, LogButton, LogSelect
from cogmanagermixin import commandlogger, LogButton, LogSelect
import settings


Expand Down
2 changes: 1 addition & 1 deletion clanbotjas/cogs/rolebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from discord.commands import SlashCommandGroup

import settings
from cogManagerMixin import commandlogger, LogButton
from cogmanagermixin import commandlogger, LogButton


class RoleButton(LogButton):
Expand Down

0 comments on commit b7c3126

Please sign in to comment.