-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: new command to generate an invite link
- Loading branch information
Showing
3 changed files
with
22 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ def crew_help() -> str: | |
Start a chat:\t/start_chat [email protected],[email protected] Chat_Title Hello friends! | ||
Change the bot's name:\t/set_name Name | ||
Change the bot's avatar:\t/set_avatar <attach image> | ||
Generate invite link:\t\t/generate-invite | ||
Show this help text:\t\t/help | ||
Change the help message for outsiders:\t/set_outside_help Hello outsider | ||
""" | ||
|
@@ -63,6 +64,16 @@ def set_avatar( | |
return "Avatar changed to this image." | ||
|
||
|
||
def generate_invite(account: deltachat.Account) -> str: | ||
"""Return a https://i.delta.chat invite link for chatting with the bot. | ||
:return: the invite link, e.g.: https://i.delta.chat | ||
""" | ||
openpgp4fpr = account.get_setup_contact_qr() | ||
invite = "https://i.delta.chat/#" + openpgp4fpr[12::] | ||
return invite | ||
|
||
|
||
def start_chat( | ||
ac: deltachat.Account, | ||
command: deltachat.Message, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters