Skip to content
Open
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
15 changes: 14 additions & 1 deletion chillone/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def embed(*args, fields: Iterable[tuple[str, ...]]=(), inline: bool = False, **k

class ChillOneBot(nextcord.Client):
"""The Chill One source code."""
suggestion_count = 0

@tasks.loop(hours=24*7)
async def chill(self, ) -> None:
Expand All @@ -26,7 +27,19 @@ async def chill(self, ) -> None:
for _ in range(42):
await channel.send("".join(Space.generate(1800)))
return


@nextcord.slash_command()
async def suggest(self, interaction: nextcord.Interaction, suggestion: str) -> None:
self.suggestion_count += 1
try:
channel = await self.fetch_channel(os.environ["RULES_CHANNEL_ID"])
message = await channel.send(f"**Suggestion #{self.suggestion_count:.4}** by {interaction.user.mention}\n\n{suggestion}")
# TODO: add a reaction voting sub task.
except KeyError as err:
await interaction.send(f"```\No rules channel set in environment!\n\n{err}\n```")
except nextcord.ChannelNotFound as err:
await interaction.send(f"```Specified rules channel not found!\n\n{err}\n```")


if __name__ == "__main__":
bot = ChillOneBot()
Expand Down