- Düzenlendi
miranekmen Money eklentisi kurulu mu?
Eğer kurulu ise şunları yapın
money eklentisinin altında src/events/GiveMoney.php ’nin altına
subscribe fonksiyonunun nun içine bunu ekleyin.
public function subscribe(Dispatcher $events)
{
$events->listen(Posted::class, [$this, 'ErkenCevap']);
}
Daha sonra yeni fonksiyon oluşturun.
public function ErkenCevap(Posted $event)
{
$discussmoney = (float)$this->settings->get('antoinefr-money.moneyfordiscussion', 0);
$postmoney = (float)$this->settings->get('antoinefr-money.moneyforpost', 0);
if ($event->post['number'] == 2 ) {
$post = $event->post['discussion_id'];
$kullanicipost = Post::query()->where('discussion_id', $post)
->where('user_id', $event->post->user_id)
->get()->count();
if (strlen(trim($event->post->content)) > 20 && $kullanicipost < 2) {
$this->giveMoney($event->post->user, $postmoney / 2);
}
}
}
Bu şekilde 20 harf ve üzeri cevap yazan ilk kişi cevap için belirlediğiniz değerin yarısını ek olarak alır.