aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/evergreen/stackoverflow.py
diff options
context:
space:
mode:
authorGravatar Vivaan Parashar <[email protected]>2021-02-11 12:09:29 +0530
committerGravatar Vivaan Parashar <[email protected]>2021-02-11 12:09:29 +0530
commit42594929d611f0e9f0de3e3e5ddfae3ae8805628 (patch)
treef24ab445fbca341d3230c9c3c157beb5fba0a2aa /bot/exts/evergreen/stackoverflow.py
parentUse sir-lancebot's format. Just import discord.ext.commands (diff)
use discord's orange colour
Diffstat (limited to 'bot/exts/evergreen/stackoverflow.py')
-rw-r--r--bot/exts/evergreen/stackoverflow.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/bot/exts/evergreen/stackoverflow.py b/bot/exts/evergreen/stackoverflow.py
index f272bcda..f5bcba20 100644
--- a/bot/exts/evergreen/stackoverflow.py
+++ b/bot/exts/evergreen/stackoverflow.py
@@ -1,12 +1,11 @@
from html import unescape
from urllib.parse import quote_plus
-from discord import Embed
+from discord import Colour, Embed
from discord.ext import commands
BASE_URL = "https://api.stackexchange.com/2.2/search/advanced?order=desc&sort=activity&site=stackoverflow&q={query}"
SEARCH_URL = "https://stackoverflow.com/search?q={query}"
-SO_COLOR = 0xF98036
class Stackoverflow(commands.Cog):
@@ -26,7 +25,7 @@ class Stackoverflow(commands.Cog):
embed = Embed(title=f"Search results for {search_query!r} - Stackoverflow",
url=SEARCH_URL.format(query=quote_plus(search_query)),
description=f"Here are the top {len(top5)} results:",
- color=SO_COLOR)
+ color=Colour.orange)
for item in top5:
embed.add_field(
name=f"{unescape(item['title'])}",