Skip to content

Commit a9d2173

Browse files
committed
disable skip-string-normalization
1 parent 7c3d060 commit a9d2173

File tree

16 files changed

+245
-244
lines changed

16 files changed

+245
-244
lines changed

position5/__main__.py

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,33 @@
88

99
def get_prefix(client, message):
1010
# sets the prefixes, u can keep it as an array of only 1 item if you need only one prefix
11-
prefixes = ['.']
11+
prefixes = ["."]
1212

1313
if not message.guild:
14-
prefixes = ['=='] # Only allow '==' as a prefix when in DMs
14+
prefixes = ["=="] # Only allow '==' as a prefix when in DMs
1515

1616
# Allow users to @mention the bot instead of using a prefix when using a command.
1717
return commands.when_mentioned_or(*prefixes)(client, message)
1818

1919

2020
def setup_logging():
2121
file_handler = logging.FileHandler(
22-
filename='discord.log', encoding='utf-8', mode='w'
22+
filename="discord.log", encoding="utf-8", mode="w"
2323
)
2424
file_handler.setFormatter(
25-
logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s')
25+
logging.Formatter("%(asctime)s:%(levelname)s:%(name)s: %(message)s")
2626
)
2727

2828
stdout_handler = logging.StreamHandler(sys.stdout)
2929
stdout_handler.setFormatter(
30-
logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s')
30+
logging.Formatter("%(asctime)s:%(levelname)s:%(name)s: %(message)s")
3131
)
3232

33-
dpy_logger = logging.getLogger('discord')
33+
dpy_logger = logging.getLogger("discord")
3434
dpy_logger.setLevel(logging.INFO)
3535
dpy_logger.addHandler(file_handler)
3636

37-
position5_logger = logging.getLogger('position5')
37+
position5_logger = logging.getLogger("position5")
3838
position5_logger.setLevel(logging.DEBUG)
3939
position5_logger.addHandler(stdout_handler)
4040

@@ -45,36 +45,36 @@ def setup_logging():
4545

4646

4747
cogs = [
48-
'cogs.activity',
49-
'cogs.basic',
50-
'cogs.core',
51-
'cogs.cricket',
52-
'cogs.db',
53-
'cogs.embed',
54-
'cogs.emotes',
55-
'cogs.error_handler',
56-
'cogs.fun',
57-
'cogs.pic',
58-
'cogs.poll',
59-
'cogs.react',
60-
'cogs.stock',
48+
"cogs.activity",
49+
"cogs.basic",
50+
"cogs.core",
51+
"cogs.cricket",
52+
"cogs.db",
53+
"cogs.embed",
54+
"cogs.emotes",
55+
"cogs.error_handler",
56+
"cogs.fun",
57+
"cogs.pic",
58+
"cogs.poll",
59+
"cogs.react",
60+
"cogs.stock",
6161
]
6262

6363

6464
@bot.event
6565
async def on_ready():
66-
print('Connected to bot: {}'.format(bot.user.name))
67-
print('Bot ID: {}'.format(bot.user.id))
68-
bot.remove_command('help')
66+
print("Connected to bot: {}".format(bot.user.name))
67+
print("Bot ID: {}".format(bot.user.id))
68+
bot.remove_command("help")
6969
for cog in cogs:
7070
bot.load_extension(cog)
7171

7272

7373
def main():
7474
setup_logging()
75-
bot.run(os.getenv('DISCORD_BOT_TOKEN'), bot=True, reconnect=True)
75+
bot.run(os.getenv("DISCORD_BOT_TOKEN"), bot=True, reconnect=True)
7676

7777

78-
if __name__ == '__main__':
79-
load_dotenv('.env')
78+
if __name__ == "__main__":
79+
load_dotenv(".env")
8080
main()

position5/cogs/__init__.py

Lines changed: 75 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,108 @@
1-
'''
1+
"""
22
This file contains all constants to be used by cogs
3-
'''
3+
"""
44
import logging
55
import functools
66
from discord.ext.commands import Context
77

88

9-
log = logging.getLogger('position5')
9+
log = logging.getLogger("position5")
1010

1111

12-
EMOTES_PATH = 'assets/emotes/'
13-
PIC_PATH = 'assets/pic/'
12+
EMOTES_PATH = "assets/emotes/"
13+
PIC_PATH = "assets/pic/"
1414

15-
DISCLAIMER = '''
15+
DISCLAIMER = """
1616
I am NOT a SEBI registered advisor or a financial adviser.
1717
1818
Any post associated with this IP is satire and should be treated as such. At no point has anyone associated with this IP ever condoned, encouraged, committed or abated acts of violence or threats of violence against any persons, regardless of racial, ethnic, religious or cultural background.
1919
2020
In case of an investigation by any federal entity or similar, I do not have any involvement with this group or with the people in it, I do not know how I am here, probably added by a third party, I do not support any actions by the member of this group.
2121
2222
Any of my investment or trades I share here are provided for educational purposes only and do not constitute specific financial, trading or investment advice. The statements are intended to provide educational information only and do not attempt to give you advice that relates to your specific circumstances. You should discuss your specific requirements and situation with a qualified financial adviser. I do share details and numbers available in the public domain for any company or on the websites of NSE, BSE, YahooFinance and TradingView.
23-
'''
23+
"""
2424

25-
WHY_NIFTY = '''
25+
WHY_NIFTY = """
2626
1. It is diversified
2727
2. Hard to manipulate
2828
3. Highly liquid
2929
4. Lesser margins
3030
5. Broader economic call
3131
6. Application of technical analysis
3232
7. Less volatile
33-
'''
33+
"""
3434

3535
EMOJIS_DICT = {
36-
'a': ['\U0001f1e6', '🅰️'], # jeans
37-
'b': ['🅱️', '\U0001f1e7'],
38-
'c': ['\U0001f1e8', '©️', '\U0001f318'],
39-
'd': ['\U0001f1e9'], # leftwards_arrow_with_hook
40-
'e': ['\U0001f1ea', '\U0001f4e7'],
41-
'f': ['\U0001f1eb'],
42-
'g': ['\U0001f1ec'], # compression
43-
'h': ['\U0001f1ed', '♓'],
44-
'i': ['\U0001f1ee', 'ℹ️'],
45-
'j': ['\U0001f1ef'],
46-
'k': ['\U0001f1f0'],
47-
'l': ['\U0001f1f1'],
48-
'm': ['\U0001f1f2', 'Ⓜ️', '♏', '♍'],
49-
'n': ['\U0001f1f3', '♑'],
36+
"a": ["\U0001f1e6", "🅰️"], # jeans
37+
"b": ["🅱️", "\U0001f1e7"],
38+
"c": ["\U0001f1e8", "©️", "\U0001f318"],
39+
"d": ["\U0001f1e9"], # leftwards_arrow_with_hook
40+
"e": ["\U0001f1ea", "\U0001f4e7"],
41+
"f": ["\U0001f1eb"],
42+
"g": ["\U0001f1ec"], # compression
43+
"h": ["\U0001f1ed", "♓"],
44+
"i": ["\U0001f1ee", "ℹ️"],
45+
"j": ["\U0001f1ef"],
46+
"k": ["\U0001f1f0"],
47+
"l": ["\U0001f1f1"],
48+
"m": ["\U0001f1f2", "Ⓜ️", "♏", "♍"],
49+
"n": ["\U0001f1f3", "♑"],
5050
# '⚪️',record_button, doughnut, nazar_amulet
51-
'o': ['\U0001f1f4', '🅾️', '⭕'],
52-
'p': ['\U0001f1f5', '🅿'],
53-
'q': ['\U0001f1f6'],
54-
'r': ['\U0001f1f7', '®'],
55-
's': ['\U0001f1f8', '\U0001f4b2'],
56-
't': ['\U0001f1f9', '✝️'],
57-
'u': ['\U0001f1fa', '⛎'],
58-
'v': ['\U0001f1fb'], # v, vs
59-
'w': ['\U0001f1fc'], # wc
60-
'x': ['\U0001f1fd', '❌', '❎', '✖️'],
61-
'y': ['\U0001f1fe'],
62-
'z': ['\U0001f1ff'],
63-
'0': ['0️⃣'],
64-
'1': ['1️⃣', '\U0001f947'],
65-
'2': ['2️⃣', '\U0001f948'],
66-
'3': ['3️⃣', '\U0001f949'],
67-
'4': ['4️⃣'],
68-
'5': ['5️⃣'],
69-
'6': ['6️⃣'],
70-
'7': ['7️⃣'],
71-
'8': ['8️⃣', '\U0001f3b1'],
72-
'9': ['9️⃣'],
73-
'!': ['❗', '❕'],
74-
'?': ['❓', '❔'],
75-
'*': ['*️⃣'],
76-
'#': ['#️⃣'],
77-
'+': ['➕'],
78-
'-': ['➖'],
79-
'$': ['\U0001f4b2'],
51+
"o": ["\U0001f1f4", "🅾️", "⭕"],
52+
"p": ["\U0001f1f5", "🅿"],
53+
"q": ["\U0001f1f6"],
54+
"r": ["\U0001f1f7", "®"],
55+
"s": ["\U0001f1f8", "\U0001f4b2"],
56+
"t": ["\U0001f1f9", "✝️"],
57+
"u": ["\U0001f1fa", "⛎"],
58+
"v": ["\U0001f1fb"], # v, vs
59+
"w": ["\U0001f1fc"], # wc
60+
"x": ["\U0001f1fd", "❌", "❎", "✖️"],
61+
"y": ["\U0001f1fe"],
62+
"z": ["\U0001f1ff"],
63+
"0": ["0️⃣"],
64+
"1": ["1️⃣", "\U0001f947"],
65+
"2": ["2️⃣", "\U0001f948"],
66+
"3": ["3️⃣", "\U0001f949"],
67+
"4": ["4️⃣"],
68+
"5": ["5️⃣"],
69+
"6": ["6️⃣"],
70+
"7": ["7️⃣"],
71+
"8": ["8️⃣", "\U0001f3b1"],
72+
"9": ["9️⃣"],
73+
"!": ["❗", "❕"],
74+
"?": ["❓", "❔"],
75+
"*": ["*️⃣"],
76+
"#": ["#️⃣"],
77+
"+": ["➕"],
78+
"-": ["➖"],
79+
"$": ["\U0001f4b2"],
8080
# added for possible future use
81-
'10': ['🔟'],
82-
'100': ['💯'],
83-
'ab': ['🆎'],
84-
'abc': ['🔤'],
85-
'abcd': ['🔠', '🔡'],
86-
'cl': ['🆑'],
87-
'id': ['🆔'],
88-
'vs': ['🆚'],
89-
'ng': ['🆖'],
90-
'ok': ['🆗'],
91-
'up!': ['🆙'],
92-
'cool': ['🆒'],
93-
'new': ['🆕'],
94-
'free': ['🆓'],
95-
'wc': ['🚾'],
96-
'<3': ['❤️'],
97-
'!!': ['‼'],
98-
'!?': ['⁉'],
81+
"10": ["🔟"],
82+
"100": ["💯"],
83+
"ab": ["🆎"],
84+
"abc": ["🔤"],
85+
"abcd": ["🔠", "🔡"],
86+
"cl": ["🆑"],
87+
"id": ["🆔"],
88+
"vs": ["🆚"],
89+
"ng": ["🆖"],
90+
"ok": ["🆗"],
91+
"up!": ["🆙"],
92+
"cool": ["🆒"],
93+
"new": ["🆕"],
94+
"free": ["🆓"],
95+
"wc": ["🚾"],
96+
"<3": ["❤️"],
97+
"!!": ["‼"],
98+
"!?": ["⁉"],
9999
}
100100

101101
# List of urls
102-
AGIFY = 'https://api.agify.io'
103-
GENDERIFY = 'https://api.genderize.io'
104-
NSE_FII_DII = 'https://www.nseindia.com/reports/fii-dii'
105-
NSE_FII_DII_TRADE_REACT = 'https://www.nseindia.com/api/fiidiiTradeReact'
102+
AGIFY = "https://api.agify.io"
103+
GENDERIFY = "https://api.genderize.io"
104+
NSE_FII_DII = "https://www.nseindia.com/reports/fii-dii"
105+
NSE_FII_DII_TRADE_REACT = "https://www.nseindia.com/api/fiidiiTradeReact"
106106

107107

108108
def delete_message():
@@ -124,7 +124,7 @@ def wrapper(func):
124124
async def wrapped(*args, **kwargs):
125125
assert isinstance(ctx := args[1], Context)
126126
log.info(
127-
'Author: %s | Message: %s | Method: %s | Params: %s',
127+
"Author: %s | Message: %s | Method: %s | Params: %s",
128128
ctx.author.name,
129129
ctx.message.content,
130130
func.__name__,

position5/cogs/activity.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ async def before_change_activity(self):
2929
await self.bot.wait_until_ready()
3030

3131
@commands.command(
32-
name='activity',
33-
description='check activities of user',
34-
usage='<user>',
35-
aliases=['act', 'spotify'],
32+
name="activity",
33+
description="check activities of user",
34+
usage="<user>",
35+
aliases=["act", "spotify"],
3636
)
3737
@delete_message()
3838
@log_params()
@@ -83,25 +83,26 @@ async def user_activity(self, ctx, user: discord.Member = None):
8383
content=f'Status: {activity.emoji or ""} {activity.name}'
8484
)
8585
else:
86-
await ctx.send(content=f'{activity.type.name.title()} {activity.name}')
86+
await ctx.send(content=f"{activity.type.name.title()} {activity.name}")
8787

8888
@commands.command(
89-
name='info',
90-
description='info of user',
91-
usage='<user>',
89+
name="info",
90+
description="info of user",
91+
usage="<user>",
9292
)
9393
@delete_message()
9494
@log_params()
9595
async def user_info(self, ctx, user: discord.Member = None):
9696
if user is None:
9797
user = ctx.author
98-
description = ''
98+
description = ""
9999
description += f"Joined {user.guild} on {user.joined_at.date()}\n"
100100
description += f"Account created on {user.created_at.date()}\n"
101101
description += (
102102
user.premium_since and f"Premium since {user.premium_since.date()}\n" or ""
103103
)
104-
description += user.is_on_mobile() and "Currently on Mobile\n" or ""
104+
description += f"Currently {user.status}"
105+
description += user.is_on_mobile() and " on Mobile\n" or "\n"
105106
description += f"Top role: {user.top_role}\n"
106107
description += (
107108
user.voice

position5/cogs/basic.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@ class Basic(commands.Cog):
77
def __init__(self, bot):
88
self.bot = bot
99

10-
@commands.command(name='ping', description='The ping command', aliases=['p'])
10+
@commands.command(name="ping", description="The ping command", aliases=["p"])
1111
@log_params()
1212
async def ping(self, ctx):
1313
start = dt.timestamp(dt.now())
14-
msg = await ctx.send(content='Pinging')
14+
msg = await ctx.send(content="Pinging")
1515

1616
await msg.edit(
17-
content=f'Pong!\nOne message round-trip took {(dt.timestamp(dt.now())-start) * 1000}ms.'
17+
content=f"Pong!\nOne message round-trip took {(dt.timestamp(dt.now())-start) * 1000}ms."
1818
)
1919

2020
@commands.command(
21-
name='say',
22-
description='The say command',
23-
aliases=['repeat', 'parrot'],
24-
usage='<text>',
21+
name="say",
22+
description="The say command",
23+
aliases=["repeat", "parrot"],
24+
usage="<text>",
2525
)
2626
@delete_message()
2727
@log_params()
@@ -31,8 +31,8 @@ async def say(self, ctx):
3131
alias_used = ctx.invoked_with
3232
text = msg[len(prefix_used) + len(alias_used) :].strip()
3333

34-
if text == '':
35-
await ctx.send(content='You need to specify the text!')
34+
if text == "":
35+
await ctx.send(content="You need to specify the text!")
3636
else:
3737
await ctx.send(content=text)
3838

position5/cogs/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ class Core(commands.Cog):
66
def __init__(self, bot):
77
self.bot = bot
88

9-
@commands.command(name='logout')
9+
@commands.command(name="logout")
1010
@commands.has_permissions(administrator=True)
1111
@delete_message()
1212
@log_params()
1313
async def close(self, ctx):
14-
await ctx.send('Logging off')
14+
await ctx.send("Logging off")
1515
await self.bot.close()
1616

1717

0 commit comments

Comments
 (0)