-
-
Notifications
You must be signed in to change notification settings - Fork 0
New haracho message monitor #137
New haracho message monitor #137
Conversation
|
どうして同じコミットが2つあるんですか? |
isso0424
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
よくない
src/on_message/modify/delete.py
Outdated
| """.replace(" ", "") | ||
|
|
||
|
|
||
| async def delete_notify(message: discord.Message): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete_notifyはnotify_message_deleteでよくね
src/on_message/modify/edit.py
Outdated
| HORIZONTAL_LINE = "------------------------------\n" | ||
|
|
||
|
|
||
| async def edit_notify( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deleteと同様にnotify_message_editで良いと思う
src/on_message/modify/edit.py
Outdated
| after_lines: List[str] | ||
| ): | ||
| raw_diff = list(difflib.Differ().compare(before_lines, after_lines)) | ||
| modified_diff = [x for x in raw_diff if x[:1] in "+-"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"+-"は["+", "-"]で良いと思う
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
てか+, -をkeyとするdictにすればstepが要らなくなります
src/on_message/modify/delete.py
Outdated
| ``` | ||
| {} | ||
| ``` | ||
| """.replace(" ", "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
このインデントいる...?
|
|
||
| async def on_guild_role_create(self, role): | ||
| pass | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
け す な
| message.author.display_name, | ||
| message.content | ||
| ) | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
世界なぜ改行しない
| HORIZONTAL_LINE if (i * 2) != len(modified_diff) - 2 else "" | ||
| ) | ||
|
|
||
| return generated_diff_text.strip() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
世界なぜk(ry
src/message_edit/edit.py
Outdated
| } | ||
|
|
||
| generated_diff_text = "" | ||
| for i in range(len(modified_diff) // 2): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これはlen(diff_dict["+"])すればマジックナンバーが要らなくなる
src/message_edit/edit.py
Outdated
| after_lines: List[str] | ||
| ): | ||
| raw_diff = list(difflib.Differ().compare(before_lines, after_lines)) | ||
| modified_diff = [x for x in raw_diff if x[:1] in "+-"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
この変数いらなくね
src/message_edit/edit.py
Outdated
| generated_diff_text += DIFF_PAIR_TEMPLATE.format( | ||
| diff_dict["-"][i], | ||
| diff_dict["+"][i], | ||
| HORIZONTAL_LINE if (i * 2) != len(modified_diff) - 2 else "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここmodified_diffをdiff_dict["+"]にすればi * 2である意味が無いと思われ
isso0424
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(多分)問題ない
|
やったぜ。 |
いろいろガバってコミット履歴ぐっちゃぐちゃなのでRequest Change投げてくれたらRebaseして投げ直します
し ん ど い