40
40
import re
41
41
import io
42
42
43
+ from colorama import init , Fore , Back , Style
44
+
45
+ init ()
46
+
43
47
from discord .ext import commands
44
48
import discord
45
49
import aiohttp
46
50
47
51
from utils .paginator import PaginatorSession
48
52
from utils .api import Github , ModmailApiClient
49
53
54
+
55
+
56
+ line = Fore .RED + Style .BRIGHT + '-------------------------' + Style .RESET_ALL
57
+
50
58
class Modmail (commands .Bot ):
51
59
52
60
def __init__ (self ):
@@ -58,17 +66,17 @@ def __init__(self):
58
66
def _add_commands (self ):
59
67
'''Adds commands automatically'''
60
68
self .remove_command ('help' )
61
- print ('-------------------------' )
62
- print ('┌┬┐┌─┐┌┬┐┌┬┐┌─┐┬┬' ,
69
+ print (line )
70
+ print (Fore . YELLOW + '┌┬┐┌─┐┌┬┐┌┬┐┌─┐┬┬' ,
63
71
'││││ │ │││││├─┤││' ,
64
72
'┴ ┴└─┘─┴┘┴ ┴┴ ┴┴┴─┘' , sep = '\n ' )
65
73
print (f'v{ __version__ } ' )
66
- print ('Author: kyb3r' )
74
+ print ('Author: kyb3r' + Style . RESET_ALL )
67
75
for attr in dir (self ):
68
76
cmd = getattr (self , attr )
69
77
if isinstance (cmd , commands .Command ):
70
78
self .add_command (cmd )
71
-
79
+
72
80
@property
73
81
def config (self ):
74
82
try :
@@ -113,16 +121,13 @@ async def wrapper(self, ctx, *args, **kwargs):
113
121
return wrapper
114
122
115
123
async def on_connect (self ):
116
- print ('-------------------------' )
117
- print ('Connected to gateway.' )
124
+ print (line )
125
+ print (Fore . YELLOW + 'Connected to gateway.' )
118
126
119
127
self .session = aiohttp .ClientSession ()
120
128
status = os .getenv ('STATUS' ) or self .config .get ('STATUS' )
121
129
if status :
122
- print (f'Changing presence.' )
123
130
await self .change_presence (activity = discord .Game (status ))
124
- else :
125
- print ('No status set.' )
126
131
127
132
@property
128
133
def guild_id (self ):
@@ -136,13 +141,13 @@ def guild(self):
136
141
async def on_ready (self ):
137
142
'''Bot startup, sets uptime.'''
138
143
print (textwrap .dedent (f'''
139
- -------------------------
140
- Client ready.
141
- -------------------------
142
- Logged in as: { self .user }
143
- User ID: { self .user .id }
144
- Guild ID: { self .guild .id if self .guild else 0 }
145
- -------------------------
144
+ { line }
145
+ { Fore . YELLOW } Client ready.
146
+ { line }
147
+ { Fore . YELLOW } Logged in as: { self .user }
148
+ { Fore . YELLOW } User ID: { self .user .id }
149
+ { Fore . YELLOW } Guild ID: { self .guild .id if self .guild else 0 }
150
+ { line }
146
151
''' ).strip ())
147
152
148
153
async def on_message (self , message ):
0 commit comments