question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support restricted bots

See original GitHub issue

I’m trying to make a keybase bot work as a restricted bot, but I’m running into issues when trying to send messages to a keybase team.

If I create a channel like this:

channel = pykeybasebot.types.chat1.ChatChannel(
    name=os.environ.get("KEYBASE_TEAM"),
    topic_name=os.environ.get("KEYBASE_CHANNEL"),
    members_type="team",
)

Then try sending a message like this:

await bot.chat.send(channel, "test")

I get this exception:

Exception: {'code': 0, 'message': 'error from chat server: team readers are unable to create conversations, found role RESTRICTEDBOT'}

If I receive an event, I also can’t respond to it using the channel that’s attached to the event like this:

await bot.chat.send(event.msg.channel, "test")

It throws this exception:

Exception: {'code': 0, 'message': 'invalid send v1 options: need channel or conversation_id'}

I believe this one is because event.msg.channel is ChatChannel(name='', public=None, members_type='team', topic_type='chat', topic_name=None), I think because the bot is restricted.

And it won’t let me use the conv_id as the channel either. When I receive an event and try responding like this:

await bot.chat.send(event.msg.conv_id, "test")

I get the exception:

File "/home/user/.local/share/virtualenvs/app-4PlAip0Q/lib/python3.8/site-packages/pykeybasebot/chat_client.py", line 43, in send
    "channel": channel.to_dict(),
AttributeError: 'str' object has no attribute 'to_dict'

I’m using pykeybasebot 0.2.0.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
xgesscommented, Feb 17, 2020

bumped the version and updated pypi.

0reactions
joshblumcommented, Mar 24, 2021

Yes

On Wed, Mar 24, 2021 at 03:17 Rohit Roy Chowdhury @.***> wrote:

@roychowdhuryrohit-dev https://github.com/roychowdhuryrohit-dev you can use this command:

$ keybase chat conv-info --help NAME: keybase chat conv-info - Get information about a conversation

USAGE: keybase chat conv-info [command options] [conversation]

OPTIONS: –topic-type “chat” Specify topic type of the conversation. Has to be chat or dev –public Only select public conversations. Exclusive to --private –private Only select private conversations. Exclusive to --public. If both --public and --private are present, --private takes priority. –channel Specify the conversation channel.

for example:

$ keybase chat conv-info keybasefriends --channel chat ConversationName: keybasefriends#chat ConversationID: 0000ecb0e173e19ceae1a99b9716f97db41984ad31ff0f6b5be53a603d414e99 ConvIDShort: 0000ecb0e173e19ceae1

Is the ConvID permanent for a channel topic?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/keybase/pykeybasebot/issues/44#issuecomment-805564593, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIXJVAXYXKMPP7CHU3JSI3TFGG2FANCNFSM4KRFCCTA .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bots and Account Restrictions — What You Need To Know
Our support team can see all of your in-app activity and will be able to determine quickly if your account was falsely restricted....
Read more >
Stable telegram bot to save Restricted content with ... - GitHub
A stable telegram bot to get restricted messages with custom thumbnail support , made by Mahesh Chauhan. works for both public and private...
Read more >
Restrict bots to certain channels - Discord Support
At the moment, the only way to restrict bots to one channel only is to manually remove the bot's chat permissions in each...
Read more >
Telegram bot Check Restrictions Bot — @CheckRestrictionBot
Hi, this bot will show you the restrictions applied to a public chat Not Users. Just send me the @username of a group,...
Read more >
What is bot traffic? | How to stop bot traffic - Cloudflare
Bot traffic is non-human traffic to a website. Abusive bot traffic can impact performance and hurt business objectives. Learn how to stop abusive...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found