Skip to content

Commit 6417be9

Browse files
committed
Fix import order across the bot
1 parent b0d7ada commit 6417be9

15 files changed

+42
-33
lines changed

bot/__main__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
import aiohttp
88
from discord import AllowedMentions, Intents
99

10-
from . import settings
11-
from bot.bot import Friendo
1210
from bot import cogs
11+
from bot import settings
12+
from bot.bot import Friendo
1313

1414

1515
def _get_cogs() -> Iterator[str]:

bot/bot.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
import aiohttp
44
from discord.ext.commands import Bot, CommandError, Context
55

6-
from .disable import DisableApi
7-
from .graphql import GraphQLClient
8-
from .settings import API_COGS
6+
from bot.disable import DisableApi
7+
from bot.graphql import GraphQLClient
8+
from bot.settings import API_COGS
99

1010
log = logging.getLogger(__name__)
1111

bot/cogs/admin.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import json
22
import logging
3-
from pathlib import Path
43
import re
4+
from pathlib import Path
55
from typing import Callable, Optional
6-
import aiofiles
76

7+
import aiofiles
88
from discord import Member
99
from discord.ext.commands import Cog, Context, check, command
1010

bot/cogs/advent_of_code.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
from bot.bot import Friendo
1+
import logging
2+
23
from discord import errors
34
from discord.ext.commands import Cog, Context, group
5+
6+
from bot.bot import Friendo
47
from bot.settings import AOC_JOIN_CODE, AOC_LEADERBOARD_LINK, AOC_SESSION_COOKIE
58

9+
log = logging.getLogger(__name__)
10+
611

712
class AdventOfCode(Cog):
813
"""Cog for AOC 2021 for small features."""

bot/cogs/fun.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import functools
2-
from itertools import product
3-
from random import choice, randint, shuffle
42
import re
53
import string
4+
from itertools import product
5+
from random import choice, randint, shuffle
66
from typing import List
77

88
from discord.ext.commands import Cog, Context, command

bot/cogs/greetings.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
from pathlib import Path
21
import random
2+
from pathlib import Path
33

4-
from discord.ext.commands import Bot, Cog, Context, command
54
import yaml
6-
5+
from discord.ext.commands import Bot, Cog, Context, command
76

87
with open(Path.cwd() / 'bot' / 'resources' / 'greetings.yaml', 'r', encoding='utf-8') as f:
98
info = yaml.load(f, Loader=yaml.FullLoader)

bot/cogs/image_segmentation.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
from typing import List, Optional
55

66
import aiofiles
7-
from cv2 import COLOR_BGR2RGB, cvtColor, imread
87
import discord
9-
from discord.ext.commands import Cog, Context, command
108
import matplotlib.pyplot as plt
11-
from skimage.color import rgb2hsv
9+
from cv2 import COLOR_BGR2RGB, cvtColor, imread
10+
from discord.ext.commands import Cog, Context, command
1211
from numpy import ndarray
12+
from skimage.color import rgb2hsv
1313

1414
from bot.bot import Friendo
1515

bot/cogs/pixelate.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
import numpy as np
2-
from PIL import Image
3-
from io import BytesIO
4-
from bot.bot import Friendo
51
from collections import Counter
2+
from io import BytesIO
3+
4+
import numpy as np
65
from discord import Color, Embed, File, Member
76
from discord.ext.commands import Cog, Context, command
7+
from PIL import Image
8+
9+
from bot.bot import Friendo
810

911

1012
class Pixelate(Cog):

bot/cogs/timezone_tracker.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
import logging
2+
import typing as t
23
from collections import defaultdict
34
from datetime import timedelta
4-
import typing as t
55

66
import arrow
7-
from discord import Member
87
import discord
8+
from discord import Member
99
from discord.ext.commands import Cog, Context, group
1010

1111
from bot.bot import Friendo
1212

13-
1413
log = logging.getLogger(__name__)
1514

1615

bot/cogs/todo_list.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
from asyncio import sleep
21
import json
32
import logging
43
import os
4+
from asyncio import sleep
55
from pathlib import Path
66
from typing import Tuple
7-
import aiofiles
87

8+
import aiofiles
99
from discord import Colour, Embed
1010
from discord.ext import tasks
1111
from discord.ext.commands import Cog, Context, command

bot/cogs/user.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import yaml
2-
1+
from datetime import datetime, timezone
32
from pathlib import Path
43
from typing import Union
5-
from datetime import datetime, timezone
4+
5+
import yaml
66
from dateutil.relativedelta import relativedelta
77
from discord import ActivityType, Embed, Member, Spotify, Status
88
from discord.ext.commands import Cog, Context, MemberConverter, MemberNotFound, command

bot/cogs/utilities.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1+
import random
12
from asyncio import sleep
23
from pathlib import Path
3-
import random
44
from typing import Optional
55

6+
import yaml
67
from discord import Colour, Embed
78
from discord.ext import tasks
89
from discord.ext.commands import Cog, Context, command
9-
import yaml
1010

1111
from bot import settings
1212
from bot.bot import Friendo

bot/cogs/wolfram.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
import discord
21
from io import BytesIO
32
from urllib import parse
3+
4+
import discord
45
from discord.ext import commands
6+
57
from bot.settings import WOLFRAM_APPID
68

79

bot/cogs/wonder_twins.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import random
2-
import yaml
32
from pathlib import Path
3+
4+
import yaml
45
from discord.ext.commands import Bot, Cog, Context, command
56

67
with open(Path.cwd() / 'bot' / 'resources' / 'wonder_twins.yaml', 'r', encoding='utf-8') as f:

bot/meme_api/memegen.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import aiohttp
21
import json
32
import logging
43
from pathlib import Path
54
from typing import List
5+
66
import aiofiles
7+
import aiohttp
78

89
from bot.settings import MEME_PASSWORD, MEME_USERNAME
910

0 commit comments

Comments
 (0)