Skip to content
This repository was archived by the owner on Apr 27, 2022. It is now read-only.

New haracho message monitor - #137

Merged
loxygenK merged 11 commits into
approvers:newHarachofrom
loxygenK:newHaracho-message-monitor
Jun 10, 2020
Merged

New haracho message monitor#137
loxygenK merged 11 commits into
approvers:newHarachofrom
loxygenK:newHaracho-message-monitor

Conversation

@loxygenK

Copy link
Copy Markdown
Contributor

いろいろガバってコミット履歴ぐっちゃぐちゃなのでRequest Change投げてくれたらRebaseして投げ直します
し ん ど い

@loxygenK
loxygenK requested a review from isso0424June 8, 2020 11:58
@loxygenK

Copy link
Copy Markdown
ContributorAuthor

どうして同じコミットが2つあるんですか?

@isso0424isso0424 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

よくない

Comment threadsrc/on_message/modify/delete.py Outdated
""".replace(" ", "")


async def delete_notify(message: discord.Message):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete_notifynotify_message_deleteでよくね

Comment threadsrc/on_message/modify/edit.py Outdated
HORIZONTAL_LINE = "------------------------------\n"


async def edit_notify(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deleteと同様にnotify_message_editで良いと思う

Comment threadsrc/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 "+-"]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"+-"["+", "-"]で良いと思う

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

てか+, -をkeyとするdictにすればstepが要らなくなります

Comment threadsrc/on_message/modify/delete.py Outdated
```
{}
```
""".replace(" ", "")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

このインデントいる...?

Comment threadsrc/client.py

async def on_guild_role_create(self, role):
pass

Copy link
Copy Markdown
Member

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
)
)

Copy link
Copy Markdown
Member

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()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

世界なぜk(ry

Comment threadsrc/message_edit/edit.py Outdated
}

generated_diff_text = ""
for i in range(len(modified_diff) // 2):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これはlen(diff_dict["+"])すればマジックナンバーが要らなくなる

Comment threadsrc/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 "+-"]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

この変数いらなくね

Comment threadsrc/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 ""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここmodified_diffdiff_dict["+"]にすればi * 2である意味が無いと思われ

@isso0424isso0424 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(多分)問題ない

@loxygenK

Copy link
Copy Markdown
ContributorAuthor

やったぜ。
これ僕がマージ処理してええんか?
(していいならsquashするつもり)

@loxygenK
loxygenK merged commit 50654ae into approvers:newHarachoJun 10, 2020
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@loxygenK@isso0424