From f15ca02dfafcc12b3a05e9a1a7024daa6f035b4f Mon Sep 17 00:00:00 2001 From: Sebastiaan Zeeff <33516116+SebastiaanZ@users.noreply.github.com> Date: Wed, 3 Jul 2019 12:44:22 +0200 Subject: Changing id of terning4 to the correct one --- bot/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bot/constants.py') diff --git a/bot/constants.py b/bot/constants.py index 67dd9328..be53a764 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -80,7 +80,7 @@ class Emojis: terning1 = "<:terning1:431249668983488527>" terning2 = "<:terning2:462339216987127808>" terning3 = "<:terning3:431249694467948544>" - terning4 = "<:terning4:431249704769290241>" + terning4 = "<:terning4:579980271475228682>" terning5 = "<:terning5:431249716328792064>" terning6 = "<:terning6:431249726705369098>" -- cgit v1.2.3 From 1b481b7c91ff1e329f7419901b939674db969c7c Mon Sep 17 00:00:00 2001 From: sco1 Date: Sun, 4 Aug 2019 10:31:12 -0400 Subject: Add new Seasonalbot channel IDs to constants Change Show Your Projects channel to an env var --- bot/constants.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bot/constants.py') diff --git a/bot/constants.py b/bot/constants.py index be53a764..c9b8f6b5 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -46,10 +46,12 @@ class Channels(NamedTuple): python = 267624335836053506 reddit = 458224812528238616 seasonalbot_chat = int(environ.get('CHANNEL_SEASONALBOT_CHAT', 542272993192050698)) + seasonalbot_commands = int(environ.get('CHANNEL_SEASONALBOT_COMMANDS', 607247579608121354)) + seasonalbot_voice = int(environ.get('CHANNEL_SEASONALBOT_VOICE', 606259004230074378)) staff_lounge = 464905259261755392 verification = 352442727016693763 python_discussion = 267624335836053506 - show_your_projects = 303934982764625920 + show_your_projects = int(environ.get('CHANNEL_SHOW_YOUR_PROJECTS', 303934982764625920)) show_your_projects_discussion = 360148304664723466 -- cgit v1.2.3 From 51a204e9d79b43f8142e01a06c2f676463165f3d Mon Sep 17 00:00:00 2001 From: sco1 Date: Sun, 4 Aug 2019 10:33:53 -0400 Subject: Unify constants file quotation use --- bot/constants.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'bot/constants.py') diff --git a/bot/constants.py b/bot/constants.py index c9b8f6b5..8902d918 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -23,12 +23,12 @@ class AdventOfCode: class Channels(NamedTuple): admins = 365960823622991872 - announcements = int(environ.get('CHANNEL_ANNOUNCEMENTS', 354619224620138496)) + announcements = int(environ.get("CHANNEL_ANNOUNCEMENTS", 354619224620138496)) big_brother_logs = 468507907357409333 bot = 267659945086812160 checkpoint_test = 422077681434099723 devalerts = 460181980097675264 - devlog = int(environ.get('CHANNEL_DEVLOG', 548438471685963776)) + devlog = int(environ.get("CHANNEL_DEVLOG", 548438471685963776)) devtest = 414574275865870337 help_0 = 303906576991780866 help_1 = 303906556754395136 @@ -45,22 +45,22 @@ class Channels(NamedTuple): off_topic_2 = 463035268514185226 python = 267624335836053506 reddit = 458224812528238616 - seasonalbot_chat = int(environ.get('CHANNEL_SEASONALBOT_CHAT', 542272993192050698)) - seasonalbot_commands = int(environ.get('CHANNEL_SEASONALBOT_COMMANDS', 607247579608121354)) - seasonalbot_voice = int(environ.get('CHANNEL_SEASONALBOT_VOICE', 606259004230074378)) + seasonalbot_chat = int(environ.get("CHANNEL_SEASONALBOT_CHAT", 542272993192050698)) + seasonalbot_commands = int(environ.get("CHANNEL_SEASONALBOT_COMMANDS", 607247579608121354)) + seasonalbot_voice = int(environ.get("CHANNEL_SEASONALBOT_VOICE", 606259004230074378)) staff_lounge = 464905259261755392 verification = 352442727016693763 python_discussion = 267624335836053506 - show_your_projects = int(environ.get('CHANNEL_SHOW_YOUR_PROJECTS', 303934982764625920)) + show_your_projects = int(environ.get("CHANNEL_SHOW_YOUR_PROJECTS", 303934982764625920)) show_your_projects_discussion = 360148304664723466 class Client(NamedTuple): - guild = int(environ.get('SEASONALBOT_GUILD', 267624335836053506)) + guild = int(environ.get("SEASONALBOT_GUILD", 267624335836053506)) prefix = environ.get("PREFIX", ".") - token = environ.get('SEASONALBOT_TOKEN') - debug = environ.get('SEASONALBOT_DEBUG', '').lower() == 'true' - season_override = environ.get('SEASON_OVERRIDE') + token = environ.get("SEASONALBOT_TOKEN") + debug = environ.get("SEASONALBOT_DEBUG", "").lower() == "true" + season_override = environ.get("SEASON_OVERRIDE") class Colours: @@ -96,7 +96,7 @@ class Hacktoberfest(NamedTuple): class Roles(NamedTuple): - admin = int(environ.get('SEASONALBOT_ADMIN_ROLE_ID', 267628507062992896)) + admin = int(environ.get("SEASONALBOT_ADMIN_ROLE_ID", 267628507062992896)) announcements = 463658397560995840 champion = 430492892331769857 contributor = 295488872404484098 -- cgit v1.2.3 From eb10679be3e53f73cf8b34789971000ec597c10a Mon Sep 17 00:00:00 2001 From: kosayoda Date: Mon, 5 Aug 2019 21:32:31 +0800 Subject: Move bot out of constants.py to bot.py --- bot/__main__.py | 3 ++- bot/bot.py | 9 ++++++--- bot/constants.py | 7 +------ bot/seasons/easter/egg_hunt/cog.py | 3 ++- bot/seasons/easter/egg_hunt/constants.py | 3 ++- bot/seasons/season.py | 3 ++- 6 files changed, 15 insertions(+), 13 deletions(-) (limited to 'bot/constants.py') diff --git a/bot/__main__.py b/bot/__main__.py index a3b68ec1..416bca35 100644 --- a/bot/__main__.py +++ b/bot/__main__.py @@ -1,6 +1,7 @@ import logging -from bot.constants import Client, bot +from bot.bot import bot +from bot.constants import Client log = logging.getLogger(__name__) diff --git a/bot/bot.py b/bot/bot.py index 24e919f2..86028838 100644 --- a/bot/bot.py +++ b/bot/bot.py @@ -7,11 +7,11 @@ from aiohttp import AsyncResolver, ClientSession, TCPConnector from discord import Embed from discord.ext import commands -from bot import constants +from bot.constants import Channels, Client log = logging.getLogger(__name__) -__all__ = ('SeasonalBot',) +__all__ = ('SeasonalBot', 'bot') class SeasonalBot(commands.Bot): @@ -42,7 +42,7 @@ class SeasonalBot(commands.Bot): async def send_log(self, title: str, details: str = None, *, icon: str = None): """Send an embed message to the devlog channel.""" - devlog = self.get_channel(constants.Channels.devlog) + devlog = self.get_channel(Channels.devlog) if not devlog: log.warning("Log failed to send. Devlog channel not found.") @@ -62,3 +62,6 @@ class SeasonalBot(commands.Bot): context.command.reset_cooldown(context) else: await super().on_command_error(context, exception) + + +bot = SeasonalBot(command_prefix=Client.prefix) diff --git a/bot/constants.py b/bot/constants.py index 8902d918..f46f21d6 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -2,11 +2,9 @@ import logging from os import environ from typing import NamedTuple -from bot.bot import SeasonalBot - __all__ = ( "AdventOfCode", "Channels", "Client", "Colours", "Emojis", "Hacktoberfest", "Roles", - "Tokens", "ERROR_REPLIES", "bot" + "Tokens", "ERROR_REPLIES", ) log = logging.getLogger(__name__) @@ -130,6 +128,3 @@ ERROR_REPLIES = [ "Noooooo!!", "I can't believe you've done this", ] - - -bot = SeasonalBot(command_prefix=Client.prefix) diff --git a/bot/seasons/easter/egg_hunt/cog.py b/bot/seasons/easter/egg_hunt/cog.py index 30fd3284..a4ad27df 100644 --- a/bot/seasons/easter/egg_hunt/cog.py +++ b/bot/seasons/easter/egg_hunt/cog.py @@ -9,7 +9,8 @@ from pathlib import Path import discord from discord.ext import commands -from bot.constants import Channels, Client, Roles as MainRoles, bot +from bot.bot import bot +from bot.constants import Channels, Client, Roles as MainRoles from bot.decorators import with_role from .constants import Colours, EggHuntSettings, Emoji, Roles diff --git a/bot/seasons/easter/egg_hunt/constants.py b/bot/seasons/easter/egg_hunt/constants.py index c7d9818b..02f6e9f2 100644 --- a/bot/seasons/easter/egg_hunt/constants.py +++ b/bot/seasons/easter/egg_hunt/constants.py @@ -2,7 +2,8 @@ import os from discord import Colour -from bot.constants import Channels, Client, bot +from bot.bot import bot +from bot.constants import Channels, Client GUILD = bot.get_guild(Client.guild) diff --git a/bot/seasons/season.py b/bot/seasons/season.py index 3b623040..c88ef2a7 100644 --- a/bot/seasons/season.py +++ b/bot/seasons/season.py @@ -12,7 +12,8 @@ import async_timeout import discord from discord.ext import commands -from bot.constants import Channels, Client, Roles, bot +from bot.bot import bot +from bot.constants import Channels, Client, Roles from bot.decorators import with_role log = logging.getLogger(__name__) -- cgit v1.2.3 From b5ceff1f6cf68c9e81dcd336dcea3fa8c67ca3cf Mon Sep 17 00:00:00 2001 From: kosayoda Date: Mon, 5 Aug 2019 23:30:02 +0800 Subject: Add constant groups to `constants.py` The following groups are added: STAFF_ROLES, MODERATION_ROLES, WHITELISTED_CHANNELS, POSITIVE_REPLIES, NEGATIVE_REPLIES --- bot/constants.py | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 2 deletions(-) (limited to 'bot/constants.py') diff --git a/bot/constants.py b/bot/constants.py index f46f21d6..dbf35754 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -3,8 +3,9 @@ from os import environ from typing import NamedTuple __all__ = ( - "AdventOfCode", "Channels", "Client", "Colours", "Emojis", "Hacktoberfest", "Roles", - "Tokens", "ERROR_REPLIES", + "AdventOfCode", "Channels", "Client", "Colours", "Emojis", "Hacktoberfest", "Roles", "Tokens", + "WHITELISTED_CHANNELS", "STAFF_ROLES", "MODERATION_ROLES", + "POSITIVE_REPLIES", "NEGATIVE_REPLIES", "ERROR_REPLIES", ) log = logging.getLogger(__name__) @@ -116,6 +117,58 @@ class Tokens(NamedTuple): youtube = environ.get("YOUTUBE_API_KEY") +# Default role combinations +MODERATION_ROLES = Roles.moderator, Roles.admin, Roles.owner +STAFF_ROLES = Roles.helpers, Roles.moderator, Roles.admin, Roles.owner + +# Whitelisted channels +WHITELISTED_CHANNELS = ( + Channels.bot, Channels.seasonalbot_commands, + Channels.off_topic_0, Channels.off_topic_1, Channels.off_topic_2, + Channels.devtest, +) + +# Bot replies +NEGATIVE_REPLIES = [ + "Noooooo!!", + "Nope.", + "I'm sorry Dave, I'm afraid I can't do that.", + "I don't think so.", + "Not gonna happen.", + "Out of the question.", + "Huh? No.", + "Nah.", + "Naw.", + "Not likely.", + "No way, José.", + "Not in a million years.", + "Fat chance.", + "Certainly not.", + "NEGATORY.", + "Nuh-uh.", + "Not in my house!", +] + +POSITIVE_REPLIES = [ + "Yep.", + "Absolutely!", + "Can do!", + "Affirmative!", + "Yeah okay.", + "Sure.", + "Sure thing!", + "You're the boss!", + "Okay.", + "No problem.", + "I got you.", + "Alright.", + "You got it!", + "ROGER THAT", + "Of course!", + "Aye aye, cap'n!", + "I'll allow it.", +] + ERROR_REPLIES = [ "Please don't do that.", "You have to stop.", -- cgit v1.2.3