Skip to content

Commit 64e99b0

Browse files
committed
Change all reference of to
As deemed by all modern dictionary, self-hosted is two words seperated by a hyphen
1 parent 2077e33 commit 64e99b0

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

bot.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,9 @@ def __init__(self):
6161
self.threads = ThreadManager(self)
6262
self.session = ClientSession(loop=self.loop)
6363
self.config = ConfigManager(self)
64-
# TODO: rename selfhosted -> self_hosting, as it's not a word.
65-
self.selfhosted = self.config.get('mongo_uri') is not None
64+
self.self_hosted = self.config.get('mongo_uri') is not None
6665

67-
if self.selfhosted:
66+
if self.self_hosted:
6867
self.db = AsyncIOMotorClient(self.config.mongo_uri).modmail_bot
6968
self.modmail_api = SelfHostedClient(self)
7069
else:
@@ -205,7 +204,7 @@ def recipient_color(self):
205204
async def on_connect(self):
206205
print(line)
207206
print(Fore.CYAN, end='')
208-
if not self.selfhosted:
207+
if not self.self_hosted:
209208
print('MODE: Using the Modmail API')
210209
print(line)
211210
await self.validate_api_token()
@@ -510,7 +509,8 @@ async def data_loop(self):
510509
self.start_time).total_seconds(),
511510
"latency": f'{self.ws.latency * 1000:.4f}',
512511
"version": self.version,
513-
"selfhosted": self.selfhosted,
512+
# TODO: change to `self_hosted`
513+
"selfhosted": self.self_hosted,
514514
"last_updated": str(datetime.utcnow())
515515
}
516516

@@ -525,7 +525,7 @@ async def autoupdate_loop(self):
525525
print('Autoupdates disabled.')
526526
return
527527

528-
if self.selfhosted and not self.config.get('github_access_token'):
528+
if self.self_hosted and not self.config.get('github_access_token'):
529529
print('Github access token not found.')
530530
print('Autoupdates disabled.')
531531
return

cogs/modmail.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ async def logs(self, ctx, *,
387387
key = entry['key']
388388
closer = entry['closer']['name']
389389

390-
if not self.bot.selfhosted:
390+
if not self.bot.self_hosted:
391391
log_url = f"https://logs.modmail.tk/{key}"
392392
else:
393393
log_url = self.bot.config.log_url.strip('/') + f'/logs/{key}'

core/decorators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ async def wrapper(self, ctx, *args, **kwargs):
1616
def auth_required(func):
1717
@functools.wraps(func)
1818
async def wrapper(self, ctx, *args, **kwargs):
19-
if (self.bot.selfhosted and
19+
if (self.bot.self_hosted and
2020
self.bot.config.get('github_access_token')) or \
2121
self.bot.config.get('modmail_api_token'):
2222
return await func(self, ctx, *args, **kwargs)
2323

24-
if not self.bot.selfhosted:
24+
if not self.bot.self_hosted:
2525
desc = ('You can only use this command if you have a '
2626
'configured `MODMAIL_API_TOKEN`. Get your '
2727
'token from https://dashboard.modmail.tk')

core/thread.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ async def _close(self, closer, silent=False, delete_channel=True,
104104
})
105105

106106
if log_data is not None and isinstance(log_data, dict):
107-
if self.bot.selfhosted:
107+
if self.bot.self_hosted:
108108
log_url = f"{self.bot.config.log_url.strip('/')}/" \
109109
f"logs/{log_data['key']}"
110110
else:

0 commit comments

Comments
 (0)