mirror of
https://github.com/hencaric/SCNewsBot.git
synced 2026-08-16 22:46:03 +01:00
minor tweaks
This commit is contained in:
@@ -7,7 +7,6 @@ import discord
|
|||||||
from utils import can_publish_announcements
|
from utils import can_publish_announcements
|
||||||
|
|
||||||
ANNOUNCEMENT_BUILDER_TIMEOUT = 1200
|
ANNOUNCEMENT_BUILDER_TIMEOUT = 1200
|
||||||
EMBED_COLOR = 0x1ABC9C
|
|
||||||
EMBED_THUMBNAIL = "https://imgur.com/MJnM3LU.png"
|
EMBED_THUMBNAIL = "https://imgur.com/MJnM3LU.png"
|
||||||
|
|
||||||
|
|
||||||
@@ -143,7 +142,7 @@ class Announcement:
|
|||||||
|
|
||||||
async def get_embed(self, *, bot: commands.Bot) -> discord.Embed:
|
async def get_embed(self, *, bot: commands.Bot) -> discord.Embed:
|
||||||
embed = discord.Embed(
|
embed = discord.Embed(
|
||||||
color=EMBED_COLOR,
|
color=bot.config.embed_color,
|
||||||
title=self.title,
|
title=self.title,
|
||||||
url=self.url,
|
url=self.url,
|
||||||
description=self.description,
|
description=self.description,
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ from discord.ext import commands
|
|||||||
import discord
|
import discord
|
||||||
from extensions.announcements import Announcement
|
from extensions.announcements import Announcement
|
||||||
|
|
||||||
EMBED_COLOR = 0x1ABC9C
|
|
||||||
|
|
||||||
TEMPLATES: dict[str, Announcement] = {
|
TEMPLATES: dict[str, Announcement] = {
|
||||||
"isc": Announcement(title="Inside Star Citizen | [topic] - [subtopic]"),
|
"isc": Announcement(title="Inside Star Citizen | [topic] - [subtopic]"),
|
||||||
"scl": Announcement(title="Star Citizen Live | [topic] - [subtopic]"),
|
"scl": Announcement(title="Star Citizen Live | [topic] - [subtopic]"),
|
||||||
@@ -90,13 +88,17 @@ class TemplatesCog(commands.Cog, name="Templates"):
|
|||||||
@commands.command(name="previews", brief="Shows all the possible ping previews.")
|
@commands.command(name="previews", brief="Shows all the possible ping previews.")
|
||||||
async def ping_previews(self, ctx: commands.Context) -> None:
|
async def ping_previews(self, ctx: commands.Context) -> None:
|
||||||
await ctx.reply(
|
await ctx.reply(
|
||||||
embed=discord.Embed(color=EMBED_COLOR, description=PING_PREVIEWS),
|
embed=discord.Embed(
|
||||||
|
color=self.bot.config.embed_color, description=PING_PREVIEWS
|
||||||
|
),
|
||||||
allowed_mentions=discord.AllowedMentions.none(),
|
allowed_mentions=discord.AllowedMentions.none(),
|
||||||
)
|
)
|
||||||
|
|
||||||
@commands.command(brief="Shows all the channel IDs for announcements.")
|
@commands.command(brief="Shows all the channel IDs for announcements.")
|
||||||
async def channels(self, ctx: commands.Context) -> None:
|
async def channels(self, ctx: commands.Context) -> None:
|
||||||
await ctx.reply(embed=discord.Embed(color=EMBED_COLOR, description=CHANNELS))
|
await ctx.reply(
|
||||||
|
embed=discord.Embed(color=self.bot.config.embed_color, description=CHANNELS)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
async def setup(bot: commands.Bot) -> None:
|
async def setup(bot: commands.Bot) -> None:
|
||||||
|
|||||||
@@ -5,6 +5,10 @@ class Config:
|
|||||||
def __init__(self, config: dict):
|
def __init__(self, config: dict):
|
||||||
self.config = config
|
self.config = config
|
||||||
|
|
||||||
|
@property
|
||||||
|
def embed_color(self) -> int:
|
||||||
|
return 0x1ABC9C
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def debug(self) -> bool:
|
def debug(self) -> bool:
|
||||||
return self.config.get("debug", False)
|
return self.config.get("debug", False)
|
||||||
|
|||||||
Reference in New Issue
Block a user