Skip to content

Commit c11593d

Browse files
Agent-Fenneckyb3r
authored andcommitted
A few style fixes and customisations (#342)
1 parent e0d6c07 commit c11593d

File tree

2 files changed

+42
-19
lines changed

2 files changed

+42
-19
lines changed

README.md

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,39 @@
44
<strong><i>A feature rich Modmail bot for Discord.</i></strong>
55
<br>
66
<br>
7-
7+
88
<a href="https://heroku.com/deploy?template=https://github.com/kyb3r/modmail">
9-
<img src="https://img.shields.io/badge/deploy_to-heroku-997FBC.svg?style=for-the-badge">
9+
<img src="https://img.shields.io/badge/deploy_to-heroku-997FBC.svg?style=for-the-badge&logo=Heroku">
1010
</a>
11-
<a href="https://github.com/kyb3r/modmail/">
12-
<img src="https://api.modmail.tk/badges/instances.svg" alt="Bot instances">
11+
12+
<a href="https://github.com/kyb3r/modmail/">
13+
<img src="https://api.modmail.tk/badges/instances.svg" alt="Bot instances">
1314
</a>
15+
1416
<a href="https://discord.gg/j5e9p8w">
15-
<img src="https://img.shields.io/discord/515071617815019520.svg?style=for-the-badge&colorB=7289DA" alt="Support">
17+
<img src="https://img.shields.io/discord/515071617815019520.svg?label=Discord&logo=Discord&colorB=7289da&style=for-the-badge" alt="Support">
1618
</a>
17-
19+
1820
<a href="https://patreon.com/kyber">
19-
<img src="https://img.shields.io/badge/patreon-donate-orange.svg?style=for-the-badge" alt="Python 3.7">
21+
<img src="https://img.shields.io/badge/patreon-donate-orange.svg?style=for-the-badge&logo=Patreon" alt="Python 3.7">
22+
</a>
23+
24+
<a href="https://www.python.org/downloads/">
25+
<img src="https://img.shields.io/badge/Made%20With-Python%203.7-blue.svg?style=for-the-badge&logo=Python" alt="Made with Python 3.7">
2026
</a>
21-
27+
28+
<a href="https://github.com/kyb3r/modmail/archive/master.zip">
29+
<img src="https://counter.modmail-plugins.ionadev.ml/embed/announcement">
30+
</a>
31+
32+
<a href="https://travis-ci.com/kyb3r/modmail">
33+
<img src="https://img.shields.io/travis/com/kyb3r/modmail?style=for-the-badge&logo=Travis">
34+
</a>
35+
36+
<a href="https://github.com/ambv/black">
37+
<img src="https://img.shields.io/badge/Code%20Style-Black-black?style=for-the-badge">
38+
</a>
39+
2240
<a href="https://github.com/kyb3r/modmail/blob/master/LICENSE">
2341
<img src="https://img.shields.io/badge/license-agpl-e74c3c.svg?style=for-the-badge" alt="MIT License">
2442
</a>
@@ -33,7 +51,7 @@
3351
Modmail is similar to Reddit's Modmail both in functionality and purpose. It serves as a shared inbox for server staff to communicate with their users in a seamless way.
3452

3553
## How does it work?
36-
When a member sends a direct message to the bot, a channel or "thread" is created within an isolated category for that member. This channel is where messages will be relayed and where any available staff member can respond to that user.
54+
When a member sends a direct message to the bot, a channel or "thread" is created within an isolated category for that member. This channel is where messages will be relayed and where any available staff member can respond to that user.
3755

3856
All threads are logged and you can view previous threads through the corresponding generated log link. [**Example**](https://logs.modmail.tk/example)
3957

@@ -61,7 +79,7 @@ This list is ever growing thanks to active development and our exceptional contr
6179

6280
## Installation
6381

64-
### Locally
82+
### Locally
6583
Installation locally for development reasons or otherwise is as follows, you will need `python 3.7`.
6684

6785
Clone the repo
@@ -75,15 +93,15 @@ Install dependancies
7593
$ pipenv install
7694
```
7795

78-
Rename the `.env.example` to `.env` and fill out the fields.
96+
Rename the `.env.example` to `.env` and fill out the fields.
7997
And finally, run the bot.
8098
```console
8199
$ pipenv run python3 bot.py
82100
```
83101

84102
### Hosting for patrons
85103

86-
If you don't want to go through the trouble of setting up your own bot, and want to support this project as well, we offer installation, hosting and maintainance for Modmail bots for [**Patrons**](https://patreon.com/kyber). Join the support server for more info!
104+
If you don't want to go through the trouble of setting up your own bot, and want to support this project as well, we offer installation, hosting and maintainance for Modmail bots for [**Patrons**](https://patreon.com/kyber). Join the support server for more info!
87105

88106
### Heroku
89107
This bot can be hosted on heroku. Installation via Heroku is done in your web browser. The [**installation guide**](https://github.com/kyb3r/modmail/wiki/Installation) will guide you through the entire installation process. If you run into any problems, join the [development server](https://discord.gg/etJNHCQ) for help and support.
@@ -95,8 +113,8 @@ You can also set up autoupdates. To do this, [install the Pull app in your fork]
95113

96114
Sepcial thanks to our sponsors for supporting the project.
97115

98-
<a href='https://www.youtube.com/channel/UCgSmBJD9imASmJRleycTCwQ/featured'>
99-
<img height=150 src='https://i.imgur.com/WyzaPKY.png' style='margin:10'>
116+
<a href='https://www.youtube.com/channel/UCgSmBJD9imASmJRleycTCwQ/featured'>
117+
<img height=150 src='https://i.imgur.com/WyzaPKY.png' style='margin:10'>
100118
</a>
101119

102120
Become a [sponsor](https://patreon.com/kyber).
@@ -108,6 +126,6 @@ Modmail supports the use of third party plugins to extend or add functionality t
108126

109127
## Contributing
110128

111-
Contributions to Modmail are always welcome, whether it be improvements to the documentation or new functionality, please feel free make the change. Check out our contribution [guidelines](https://github.com/kyb3r/modmail/blob/master/CONTRIBUTING.md) before you get started.
129+
Contributions to Modmail are always welcome, whether it be improvements to the documentation or new functionality, please feel free make the change. Check out our contribution [guidelines](https://github.com/kyb3r/modmail/blob/master/CONTRIBUTING.md) before you get started.
112130

113-
This bot is free for everyone and always will be. If you like this project and would like to show your appreciation, here's the link for our **[Patreon](https://www.patreon.com/kyber)**.
131+
This bot is free for everyone and always will be. If you like this project and would like to show your appreciation, here's the link for our **[Patreon](https://www.patreon.com/kyber)**.

core/thread.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,9 @@ async def _close(
316316
"{closer.mention} has closed this Modmail thread.",
317317
)
318318

319-
message = message.format(closer=closer, loglink=log_url, logkey=log_data["key"] if log_data else None)
319+
message = message.format(
320+
closer=closer, loglink=log_url, logkey=log_data["key"] if log_data else None
321+
)
320322

321323
embed.description = message
322324
footer = self.bot.config.get(
@@ -736,9 +738,12 @@ async def find(
736738
if recipient is None and channel is not None:
737739
thread = self._find_from_channel(channel)
738740
if thread is None:
739-
id, thread = next(((k, v) for k, v in self.cache.items() if v.channel == channel), (-1, None))
741+
id, thread = next(
742+
((k, v) for k, v in self.cache.items() if v.channel == channel),
743+
(-1, None),
744+
)
740745
if thread is not None:
741-
logger.debug('Found thread with tempered ID.')
746+
logger.debug("Found thread with tempered ID.")
742747
await channel.edit(topic=f"User ID: {id}")
743748
return thread
744749

0 commit comments

Comments
 (0)