mirror of
https://github.com/hencaric/SCNewsBot.git
synced 2026-08-16 22:46:03 +01:00
Updated defaults and added membercount function
This commit is contained in:
@@ -545,7 +545,8 @@ class AnnouncementBuilderView(discord.ui.View):
|
||||
|
||||
await interaction.response.send_message(
|
||||
f"Your announcement was posted! 🎉 ({message.jump_url})"
|
||||
+ "\nhttps://i.imgur.com/HRoxTzg.gif"
|
||||
+ "\nhttps://i.postimg.cc/J48Vk8my/meme-8-1.gif"
|
||||
+ "\n<@288522211164160010> tweet this shit brotha"
|
||||
)
|
||||
|
||||
for channel_id in bot.config.repost_channels:
|
||||
|
||||
@@ -4,11 +4,6 @@ from discord.ext import commands, tasks
|
||||
from utils import Config
|
||||
from typing import Union
|
||||
|
||||
MEMBER_COUNT_CHANNELS: tuple[int] = (
|
||||
1223778123472965755,
|
||||
1225449497124012134,
|
||||
)
|
||||
|
||||
class RStarCitizen(commands.Cog):
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
@@ -18,39 +13,18 @@ class RStarCitizen(commands.Cog):
|
||||
async def mmc(self, ctx):
|
||||
await ctx.reply("```=aclose Situation resolved, please only reply if there is something else.```")
|
||||
|
||||
# @commands.Cog.listener()
|
||||
# async def on_message(self, message):
|
||||
# if message.channel.id == 649390966259580929 and message.author.id != 1091116499936223252:
|
||||
# if message.embeds:
|
||||
# for embed in message.embeds:
|
||||
# reply_channel = self.bot.get_channel(611922107345141760)
|
||||
# if "Patch Notes" in embed.title:
|
||||
# await reply_channel.send(f"<@&159107041896562688> CIG has published new [Patch Notes](<{embed.url}>).")
|
||||
# elif "Galactapedia" in embed.title:
|
||||
# await reply_channel.send(f"<@&159107041896562688> CIG has published a new [Galactapedia update](<{embed.url}>).")
|
||||
# elif "This Week in Star Citizen" in embed.title:
|
||||
# await reply_channel.send(f"<@&159107041896562688> CIG has published a new [TWISC](<{embed.url}>).")
|
||||
# elif "Monthly Report" in embed.title:
|
||||
# await reply_channel.send(f"<@&159107041896562688> CIG has published a new [Monthly Report](<{embed.url}>).")
|
||||
@tasks.loop(hours=1)
|
||||
async def update_member_count(self):
|
||||
guild = self.bot.get_guild(82210263440306176) # Replace YOUR_GUILD_ID with your actual guild ID
|
||||
channel = guild.get_channel(1223778123472965755) # Replace YOUR_CHANNEL_ID with your actual channel ID
|
||||
|
||||
# @commands.Cog.listener()
|
||||
# async def on_ready(self) -> None:
|
||||
# for channel_id in MEMBER_COUNT_CHANNELS:
|
||||
# self.update_member_count.start(channel_id)
|
||||
member_count = len(guild.members)
|
||||
await channel.edit(name=f'Members: {member_count}')
|
||||
|
||||
# @tasks.loop(hours = 12)
|
||||
# async def update_member_count(self, channel_id: int) -> None:
|
||||
# for channel_id in MEMBER_COUNT_CHANNELS:
|
||||
# channel = self.bot.get_channel(channel_id)
|
||||
# member_count = channel.guild.member_count
|
||||
# await channel.edit(name=f"Members: {member_count}")
|
||||
|
||||
# @commands.command(description='Update Member Count Channel')
|
||||
# async def mc(self, channel_id: int):
|
||||
# for channel_id in MEMBER_COUNT_CHANNELS:
|
||||
# channel = self.bot.get_channel(channel_id)
|
||||
# member_count = channel.guild.member_count
|
||||
# await channel.edit(name=f"Members: {member_count}")
|
||||
@commands.Cog.listener()
|
||||
async def on_ready(self):
|
||||
print('MemberCount cog is ready.')
|
||||
self.update_member_count.start()
|
||||
|
||||
async def setup(bot):
|
||||
await bot.add_cog(RStarCitizen(bot))
|
||||
@@ -61,7 +61,6 @@ __**Posting Locations:**__
|
||||
[Check here](https://discord.com/channels/82210263440306176/611922107345141760/1113905662217441330) for a guide on what post types go where.
|
||||
"""
|
||||
|
||||
|
||||
class TemplatesCog(commands.Cog, name="Templates"):
|
||||
def __init__(self, bot: commands.Bot) -> None:
|
||||
self.bot = bot
|
||||
|
||||
Reference in New Issue
Block a user