From 570c91eb94fac322c89357c564238d4f050dc338 Mon Sep 17 00:00:00 2001 From: Conatum Date: Thu, 20 Jan 2022 08:07:01 +0200 Subject: [PATCH] (topgg): Name and wording tweaks. --- bot/constants.py | 2 +- bot/core/data.py | 2 +- bot/modules/topgg/settings.py | 20 ++++++++++++-------- data/migration/v8-v9/migration.sql | 6 +++--- data/schema.sql | 6 +++--- 5 files changed, 20 insertions(+), 16 deletions(-) diff --git a/bot/constants.py b/bot/constants.py index 6c122bcc..b3757a74 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -1,2 +1,2 @@ CONFIG_FILE = "config/bot.conf" -DATA_VERSION = 8 +DATA_VERSION = 9 diff --git a/bot/core/data.py b/bot/core/data.py index 41836a3c..3087c8ee 100644 --- a/bot/core/data.py +++ b/bot/core/data.py @@ -14,7 +14,7 @@ meta = RowTable( user_config = RowTable( 'user_config', - ('userid', 'timezone', 'remaind_upvote'), + ('userid', 'timezone', 'topgg_vote_reminder'), 'userid', cache=TTLCache(5000, ttl=60*5) ) diff --git a/bot/modules/topgg/settings.py b/bot/modules/topgg/settings.py index 52cdcdf5..b8800f34 100644 --- a/bot/modules/topgg/settings.py +++ b/bot/modules/topgg/settings.py @@ -4,19 +4,23 @@ from settings.setting_types import Boolean from modules.reminders.reminder import Reminder from modules.reminders.data import reminders -from .utils import create_remainder, remainder_content +from .utils import create_remainder, remainder_content, topgg_upvote_link @UserSettings.attach_setting class topgg_vote_remainder(Boolean, UserSetting): attr_name = 'vote_remainder' - _data_column = 'remaind_upvote' + _data_column = 'topgg_vote_reminder' _default = True - display_name = 'Upvote Reminder' - desc = "Turn on/off DM Reminders to Upvote me." - long_desc = ("Enable or disable DM boost reminders.",) + display_name = 'vote_reminder' + desc = r"Toggle automatic reminders to support me for a 25% LionCoin boost." + long_desc = ( + "Did you know that you can [vote for me]({vote_link}) to help me help other people reach their goals? " + "And you get a **25% boost** to all LionCoin income you make across all servers!\n" + "Enable this setting if you want me to let you know when you can vote again!" + ).format(vote_link=topgg_upvote_link) @property def success_response(self): @@ -25,8 +29,8 @@ class topgg_vote_remainder(Boolean, UserSetting): create_remainder(self.id) return ( - " I will send you boost reminders.\n\n" - "`Please make sure your DMs are open.`" + "Thank you for supporting me! I will remind in your DMs when you can vote next! " + "(Please make sue your DMs are open, otherwise I can't reach you!)" ) else: # Check if reminder is already running and get its id @@ -42,5 +46,5 @@ class topgg_vote_remainder(Boolean, UserSetting): Reminder.delete(r['reminderid']) return ( - " I won't send you boost reminders." + "I will no longer send you voting reminders." ) diff --git a/data/migration/v8-v9/migration.sql b/data/migration/v8-v9/migration.sql index 3417990b..feefd5e5 100644 --- a/data/migration/v8-v9/migration.sql +++ b/data/migration/v8-v9/migration.sql @@ -1,9 +1,9 @@ ALTER TABLE user_config - ADD COLUMN remaind_upvote BOOLEAN DEFAULT TRUE + ADD COLUMN topgg_vote_reminder BOOLEAN; ALTER TABLE reminders - ADD COLUMN title TEXT DEFAULT NULL, - ADD COLUMN footer TEXT DEFAULT NULL + ADD COLUMN title TEXT, + ADD COLUMN footer TEXT; -- Topgg Data {{{ CREATE TABLE IF NOT EXISTS topgg( diff --git a/data/schema.sql b/data/schema.sql index 276179c0..2ba429d7 100644 --- a/data/schema.sql +++ b/data/schema.sql @@ -42,7 +42,7 @@ CREATE TABLE global_guild_blacklist( CREATE TABLE user_config( userid BIGINT PRIMARY KEY, timezone TEXT, - remaind_upvote BOOLEAN DEFAULT TRUE + topgg_vote_reminder ); -- }}} @@ -168,8 +168,8 @@ CREATE TABLE reminders( message_link TEXT, interval INTEGER, created_at TIMESTAMP DEFAULT (now() at time zone 'utc'), - title TEXT DEFAULT NULL, - footer TEXT DEFAULT NULL + title TEXT, + footer TEXT ); CREATE INDEX reminder_users ON reminders (userid); -- }}}