mirror of
https://github.com/hencaric/SCNewsBot.git
synced 2026-08-16 22:46:03 +01:00
Updating to source code match
This commit is contained in:
@@ -5,7 +5,7 @@ import discord
|
|||||||
import datetime
|
import datetime
|
||||||
from utils import Config
|
from utils import Config
|
||||||
|
|
||||||
VERSION = "1.0.3"
|
VERSION = "1.0.4"
|
||||||
INTENTS = discord.Intents.default()
|
INTENTS = discord.Intents.default()
|
||||||
INTENTS.message_content = True
|
INTENTS.message_content = True
|
||||||
INTENTS.members = True
|
INTENTS.members = True
|
||||||
@@ -46,10 +46,10 @@ class CoreCog(commands.Cog, name="Core"):
|
|||||||
@commands.Cog.listener()
|
@commands.Cog.listener()
|
||||||
async def on_ready(self) -> None:
|
async def on_ready(self) -> None:
|
||||||
print("The News Bot is now ready.")
|
print("The News Bot is now ready.")
|
||||||
channel = self.bot.get_channel(611922107345141760)
|
# channel = self.bot.get_channel(611922107345141760)
|
||||||
embed=discord.Embed(title=f"The News Bot is now online!",description="Hello! Please use the below command to summon the embed editor. ```&embed create```", color=0x00FFFF)
|
# embed=discord.Embed(title=f"The News Bot is now online!",description="Hello! Please use the below command to summon the embed editor. ```&embed create```", color=0x00FFFF)
|
||||||
embed.timestamp = datetime.datetime.now()
|
# embed.timestamp = datetime.datetime.now()
|
||||||
await channel.send(embed=embed)
|
# await channel.send(embed=embed)
|
||||||
|
|
||||||
@commands.Cog.listener()
|
@commands.Cog.listener()
|
||||||
async def on_message(self, message: discord.Message) -> None:
|
async def on_message(self, message: discord.Message) -> None:
|
||||||
@@ -77,7 +77,7 @@ class CoreCog(commands.Cog, name="Core"):
|
|||||||
)
|
)
|
||||||
embed.add_field(
|
embed.add_field(
|
||||||
name="Authors",
|
name="Authors",
|
||||||
value=f"Ian (<@1088892000348151839>), and mudkip (<@998070081709932654>)",
|
value=f"<@288522211164160010> and <@998070081709932654>",
|
||||||
)
|
)
|
||||||
view = discord.ui.View()
|
view = discord.ui.View()
|
||||||
view.add_item(
|
view.add_item(
|
||||||
|
|||||||
34
scnewsbot/extensions/rstarcitizen.py
Normal file
34
scnewsbot/extensions/rstarcitizen.py
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
import discord
|
||||||
|
import asyncio
|
||||||
|
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
|
||||||
|
self._last_member = None
|
||||||
|
|
||||||
|
@commands.Cog.listener()
|
||||||
|
async def on_ready(self) -> None:
|
||||||
|
for channel_id in MEMBER_COUNT_CHANNELS:
|
||||||
|
await asyncio.sleep(3)
|
||||||
|
self.update_member_count.start(channel_id)
|
||||||
|
|
||||||
|
@tasks.loop(minutes = 30)
|
||||||
|
async def update_member_count(self, channel_id: int) -> None:
|
||||||
|
channel = self.bot.get_channel(channel_id)
|
||||||
|
member_count = channel.guild.member_count
|
||||||
|
await channel.edit(name=f"Members: {member_count}")
|
||||||
|
|
||||||
|
@commands.command(description='Modmail Close Message')
|
||||||
|
async def mmc(self, ctx):
|
||||||
|
await ctx.reply("```=aclose Situation resolved, please only reply if there is something else.```")
|
||||||
|
|
||||||
|
async def setup(bot):
|
||||||
|
await bot.add_cog(RStarCitizen(bot))
|
||||||
Reference in New Issue
Block a user