From baa20503e716a9ed9ab8be5f82c3456c7b4cfbb5 Mon Sep 17 00:00:00 2001 From: PureFunctor Date: Sun, 14 Jun 2020 14:20:09 +0800 Subject: Add basic caesar cipher information embed --- bot/resources/evergreen/caesar_info.json | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 bot/resources/evergreen/caesar_info.json (limited to 'bot/resources/evergreen') diff --git a/bot/resources/evergreen/caesar_info.json b/bot/resources/evergreen/caesar_info.json new file mode 100644 index 00000000..ae3a4656 --- /dev/null +++ b/bot/resources/evergreen/caesar_info.json @@ -0,0 +1,4 @@ +{ + "title": "Caesar Cipher", + "description": "**Information**\nThe Caesar Cipher, named after hte Roman General Julius Caesar is one of the simplest and most widely known encryption techniques. It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter given a specific position offset in the alphabet, with the letters wrapping around both sides.\n\n**Examples**\n1) `Hello World` <=> `Khoor Zruog` where letters are shifted forwards by `3.`\n2) `Julius Caesar` <=> `Yjaxjh Rpthpg` where letters are shifted backwards by `11.`" +} -- cgit v1.2.3 From 093a54c9acd546435c517497af409d55e0512412 Mon Sep 17 00:00:00 2001 From: PureFunctor Date: Sat, 27 Jun 2020 15:17:18 +0800 Subject: Use pathlib and fix grammar in the information embed --- bot/exts/evergreen/fun.py | 3 ++- bot/resources/evergreen/caesar_info.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'bot/resources/evergreen') diff --git a/bot/exts/evergreen/fun.py b/bot/exts/evergreen/fun.py index d1f87b6a..601ae45b 100644 --- a/bot/exts/evergreen/fun.py +++ b/bot/exts/evergreen/fun.py @@ -2,6 +2,7 @@ import functools import json import logging import random +from pathlib import Path from typing import Callable, Tuple, Union from discord import Embed, Message @@ -33,7 +34,7 @@ class Fun(Cog): def __init__(self, bot: Bot) -> None: self.bot = bot - with open("bot\\resources\\evergreen\\caesar_info.json", "r") as f: + with Path("bot/resources/evergreen/caesar_info.json").open("r") as f: self._caesar_cipher_embed = json.load(f) @commands.command() diff --git a/bot/resources/evergreen/caesar_info.json b/bot/resources/evergreen/caesar_info.json index ae3a4656..8229c4f3 100644 --- a/bot/resources/evergreen/caesar_info.json +++ b/bot/resources/evergreen/caesar_info.json @@ -1,4 +1,4 @@ { "title": "Caesar Cipher", - "description": "**Information**\nThe Caesar Cipher, named after hte Roman General Julius Caesar is one of the simplest and most widely known encryption techniques. It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter given a specific position offset in the alphabet, with the letters wrapping around both sides.\n\n**Examples**\n1) `Hello World` <=> `Khoor Zruog` where letters are shifted forwards by `3.`\n2) `Julius Caesar` <=> `Yjaxjh Rpthpg` where letters are shifted backwards by `11.`" + "description": "**Information**\nThe Caesar Cipher, named after the Roman General Julius Caesar, is one of the simplest and most widely known encryption techniques. It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter given a specific position offset in the alphabet, with the letters wrapping around both sides.\n\n**Examples**\n1) `Hello World` <=> `Khoor Zruog` where letters are shifted forwards by `3`.\n2) `Julius Caesar` <=> `Yjaxjh Rpthpg` where letters are shifted backwards by `11`." } -- cgit v1.2.3