[3.2][RC] Autorespond to new topic

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Scam Warning
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
Ger
Recognised Extension Developer
Posts: 1736
Joined: Wed Jan 02, 2008 7:35 pm
Location: 192.168.1.100
Contact:

[3.2][RC] Autorespond to new topic

Post by Ger » Wed Jul 18, 2018 2:45 pm

Extension Name: Autorespond
Author: Ger

Extension Description:
This extension creates an auto-reply message to newly created topics, useful sometimes for service oriented boards.

Features:
  • Define options per forum
  • Define a user and a message to be posted
  • Use tokens to parse specific topic variables like username/title and such
Extension Version: 1.0.0-RC

Extension Download: https://github.com/GerB/autoresponder

Translations:
Dutch and English included.
Last edited by Ger on Tue Aug 21, 2018 9:48 am, edited 5 times in total.
My extensions:
Simple CMS, Feed post bot, Avatar Resize, Modbreak, Magic OGP, Live topic update, Modern Quote, Quoted Where (GDPR) and Autoresponder.
Newest: FAQ manager for 3.2

Like my work? Buy me a coffee to keep it coming. :ugeek:
-Available for custom work-

User avatar
Ger
Recognised Extension Developer
Posts: 1736
Joined: Wed Jan 02, 2008 7:35 pm
Location: 192.168.1.100
Contact:

Re: [DEV] Autorespond to new topic

Post by Ger » Wed Jul 18, 2018 2:47 pm

Please note; at the moment this extension has all it's config predefined in the event listener as it's more a proof of concept. ACP options will come later.
Last edited by Ger on Mon Jul 23, 2018 6:42 am, edited 1 time in total.
My extensions:
Simple CMS, Feed post bot, Avatar Resize, Modbreak, Magic OGP, Live topic update, Modern Quote, Quoted Where (GDPR) and Autoresponder.
Newest: FAQ manager for 3.2

Like my work? Buy me a coffee to keep it coming. :ugeek:
-Available for custom work-

User avatar
</Solidjeuh>
Registered User
Posts: 998
Joined: Tue Mar 29, 2016 3:45 am
Location: Aalst (Belgium)
Name: Andy Dm
Contact:

Re: [DEV] Autorepond to new topic

Post by </Solidjeuh> » Wed Jul 18, 2018 3:41 pm

Can it also include a {nickname} option?
Like: Hello {nickname}, welcome to ....

Or is it the option that is yet to come "Define a user and a message to be posted" ?
Wij promoten UW muziek in ons forum & delen alles via Sociale media!
Muziek wordt ook toegevoegd in de playlist van
textradio.be!
Mail uw single + hoesje + info naar: info@muziekpromo.net of Solidjeuh@textradio.be
===============
Onze Website: https://www.muziekpromo.net

User avatar
Ger
Recognised Extension Developer
Posts: 1736
Joined: Wed Jan 02, 2008 7:35 pm
Location: 192.168.1.100
Contact:

Re: [DEV] Autorepond to new topic

Post by Ger » Wed Jul 18, 2018 6:41 pm

That option is now only for the user that's posting the auto-reply. But I think the message posted could have some variables as well. Haven't thought about it yet so if you have some ideas, please drop them here. :)
My extensions:
Simple CMS, Feed post bot, Avatar Resize, Modbreak, Magic OGP, Live topic update, Modern Quote, Quoted Where (GDPR) and Autoresponder.
Newest: FAQ manager for 3.2

Like my work? Buy me a coffee to keep it coming. :ugeek:
-Available for custom work-

User avatar
eunaumtenhoid
Registered User
Posts: 754
Joined: Wed Jun 03, 2009 12:46 am
Location: ????

Re: [DEV] Autorepond to new topic

Post by eunaumtenhoid » Sun Jul 22, 2018 6:25 pm

NICE work^^ waitin for more news
My translations of the extensions for Brazilian Portuguese
https://github.com/phpBBTraducoes

User avatar
Ger
Recognised Extension Developer
Posts: 1736
Joined: Wed Jan 02, 2008 7:35 pm
Location: 192.168.1.100
Contact:

Re: [BETA] Autorespond to new topic

Post by Ger » Mon Jul 23, 2018 11:19 am

First BETA release is now available. You can set options in the ACP now on a per forum basis (ACP->forums->edit forum)
Froddelaar wrote:
Wed Jul 18, 2018 3:41 pm
Can it also include a {nickname} option?
Like: Hello {nickname}, welcome to ....

Or is it the option that is yet to come "Define a user and a message to be posted" ?
I've created several tokens for now:
{topic_title}: Topic title
{poster_username}: Username of the user that starts a new topic
{ar_username}: Uername of for the user posting the auto-reply
{board_url}: Link to your board
{topic_url}: Link to the topic
My extensions:
Simple CMS, Feed post bot, Avatar Resize, Modbreak, Magic OGP, Live topic update, Modern Quote, Quoted Where (GDPR) and Autoresponder.
Newest: FAQ manager for 3.2

Like my work? Buy me a coffee to keep it coming. :ugeek:
-Available for custom work-

entriti
Registered User
Posts: 8
Joined: Fri Jul 13, 2018 12:26 pm

Re: [3.2][BETA] Autorespond to new topic

Post by entriti » Wed Jul 25, 2018 10:23 am

I'm trying to use this mod, but when I call the function --> pb::autoreply_post($subject, $forum_id, $topic_id, $data_bot) answer the forum with my user.

How could I modify this behavior? I want a different user to answer ("bot user").


Add picture.

Image

Thanks!

User avatar
Ger
Recognised Extension Developer
Posts: 1736
Joined: Wed Jan 02, 2008 7:35 pm
Location: 192.168.1.100
Contact:

Re: [3.2][BETA] Autorespond to new topic

Post by Ger » Wed Jul 25, 2018 11:27 am

entriti wrote:
Wed Jul 25, 2018 10:23 am
when I call the function --> pb::autoreply_post($subject, $forum_id, $topic_id, $data_bot)
That's not a function within this extension. The main stuff happens here: https://github.com/GerB/autoresponder/b ... er.php#L89

It takes only the $event as a parameter. As you can see I switch user when I submit the auto-reply. You can see how I do that here.
My extensions:
Simple CMS, Feed post bot, Avatar Resize, Modbreak, Magic OGP, Live topic update, Modern Quote, Quoted Where (GDPR) and Autoresponder.
Newest: FAQ manager for 3.2

Like my work? Buy me a coffee to keep it coming. :ugeek:
-Available for custom work-

entriti
Registered User
Posts: 8
Joined: Fri Jul 13, 2018 12:26 pm

Re: [3.2][BETA] Autorespond to new topic

Post by entriti » Thu Jul 26, 2018 9:27 am

Hi Ger,

2 questions:

- Because you use Symfony?
- Where do I download symfony? (or add your dir symfony)

Thanks :D

User avatar
david63
Jr. Extension Validator
Posts: 14723
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: [3.2][BETA] Autorespond to new topic

Post by david63 » Thu Jul 26, 2018 9:30 am

entriti wrote:
Thu Jul 26, 2018 9:27 am
- Where do I download symfony? (or add your dir symfony)
You do not need to do anything with Symfony - it is part of the phpBB package
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

entriti
Registered User
Posts: 8
Joined: Fri Jul 13, 2018 12:26 pm

Re: [3.2][BETA] Autorespond to new topic

Post by entriti » Thu Jul 26, 2018 9:44 am

main_listern.php have:
/**
* @ignore
*/
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

Return this:

Code: Select all

Fatal error: Uncaught exception 'Symfony\Component\DependencyInjection\Exception\InvalidArgumentException' with message 'A service definition must be an array or a string starting with "@" but NULL found for service "autoresponder.listener" in C:\wamp64\www\phpBB3\config\production/container\../../default/container/services.yml. Check your YAML syntax.' in C:\wamp64\www\phpBB3\vendor\symfony\dependency-injection\Loader\YamlFileLoader.php:148 Stack trace: #0 C:\wamp64\www\phpBB3\vendor\symfony\dependency-injection\Loader\YamlFileLoader.php(126): Symfony\Component\DependencyInjection\Loader\YamlFileLoader->parseDefinition('autoresponder.l...', NULL, 'C:\\wamp64\\www\\p...') #1 C:\wamp64\www\phpBB3\vendor\symfony\dependency-injection\Loader\YamlFileLoader.php(71): Symfony\Component\DependencyInjection\Loader\YamlFileLoader->parseDefinitions(Array, 'C:\\wamp64\\www\\p...') #2 C:\wamp64\www\phpBB3\vendor\symfony\config\Loader\FileLoader.php(101): Symfony\Component\DependencyInjection\Loader\YamlFileLoader->load('C:\\wamp64\\ww in C:\wamp64\www\phpBB3\vendor\symfony\config\Loader\FileLoader.php on line 122

And my services.yml:
autoresponder.listener:
class: phpbb\event\main_listener
arguments:
- '@user'
- '@auth'
- '@dbal.conn'
- '@request'
tags:
- { name: event.listener }

User avatar
Ger
Recognised Extension Developer
Posts: 1736
Joined: Wed Jan 02, 2008 7:35 pm
Location: 192.168.1.100
Contact:

Re: [3.2][BETA] Autorespond to new topic

Post by Ger » Thu Jul 26, 2018 10:00 am

What version of phpBB you have?

Almost every extension for phpBB uses events and thus Symfony. If this doesn't work for you, you must have done something wrong.
My extensions:
Simple CMS, Feed post bot, Avatar Resize, Modbreak, Magic OGP, Live topic update, Modern Quote, Quoted Where (GDPR) and Autoresponder.
Newest: FAQ manager for 3.2

Like my work? Buy me a coffee to keep it coming. :ugeek:
-Available for custom work-

entriti
Registered User
Posts: 8
Joined: Fri Jul 13, 2018 12:26 pm

Re: [3.2][BETA] Autorespond to new topic

Post by entriti » Thu Jul 26, 2018 10:36 am

viewtopic.php:
include($phpbb_root_path . 'event/main_listener.' . $phpEx);
pb::post_autorespond_message('reply');

Result:
Fatal error: Call to undefined method pb::post_autorespond_message() in C:\wamp64\www\phpBB3\viewtopic.php on line 2471
In my workspace i have main_listener.php in C:\wamp64\www\phpBB3\event


If add your service (services.yml rename services_autoresponder.yml):

Code: Select all

C:\wamp64\www\phpBB3\config\default\container\services.yml
imports:
    - { resource: services_autoresponder.yml }

The requested environment production is not available.
my version is phpbb 3.2


thanks!

User avatar
david63
Jr. Extension Validator
Posts: 14723
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: [3.2][BETA] Autorespond to new topic

Post by david63 » Thu Jul 26, 2018 10:53 am

Forgive me for asking a basic question - but do you know how to install an extension? If not I suggest that you follow the link in my signature
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
Ger
Recognised Extension Developer
Posts: 1736
Joined: Wed Jan 02, 2008 7:35 pm
Location: 192.168.1.100
Contact:

Re: [3.2][BETA] Autorespond to new topic

Post by Ger » Thu Jul 26, 2018 11:19 am

It seems to me you are approaching this way differently than how extensions should be integrated. Or at least how they're intended to be integrated. As david63 says, please follow the regular way of installing extensions by uploading it to ./ext/ger/autoresponder and hit the install button in ACP. It's also described in the readme.
My extensions:
Simple CMS, Feed post bot, Avatar Resize, Modbreak, Magic OGP, Live topic update, Modern Quote, Quoted Where (GDPR) and Autoresponder.
Newest: FAQ manager for 3.2

Like my work? Buy me a coffee to keep it coming. :ugeek:
-Available for custom work-

Post Reply

Return to “Extensions in Development”

Who is online

Users browsing this forum: Blitze and 34 guests