Support restricted bots
See original GitHub issueI’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:
- Created 4 years ago
- Comments:8 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
bumped the version and updated pypi.
Yes
On Wed, Mar 24, 2021 at 03:17 Rohit Roy Chowdhury @.***> wrote: