-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathDontAskCommand.php
More file actions
79 lines (69 loc) · 1.94 KB
/
Copy pathDontAskCommand.php
File metadata and controls
79 lines (69 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
declare(strict_types=1);
namespace He4rt\BotDiscord\SlashCommands;
use Discord\Parts\Interactions\Command\Option;
use Discord\Parts\Interactions\Interaction;
use Discord\Parts\User\User;
use Illuminate\Support\Facades\Date;
class DontAskCommand extends AbstractSlashCommand
{
/**
* The command name.
*
* @var string
*/
protected $name = 'perguntar';
/**
* The command description.
*
* @var string
*/
protected $description = 'Não peça para perguntar. Mande direto!';
/**
* Determines whether the command requires admin permissions.
*
* @var bool
*/
protected $admin = false;
/**
* Determines whether the command should be displayed in the commands list.
*
* @var bool
*/
protected $hidden = false;
/**
* The slash command options.
*
* @var array<mixed>
*/
protected $options = [
[
'name' => 'user',
'description' => 'Mencione um usuário para citar.',
'type' => Option::USER,
'required' => true,
],
];
/**
* Handle the command.
*/
public function handle(Interaction $interaction): void
{
/** @var User $targetUser */
$targetUser = $interaction->data->resolved->users->get('id', $this->value('user'));
$this
->message()
->title('Não peça para perguntar.')
->footerIcon($interaction->guild->icon)
->thumbnailUrl($targetUser->avatar)
->footerText(Date::now()->format('Y').' © He4rt Developers')
->imageUrl('https://media.discordapp.net/attachments/546151895010508827/1046092564513701909/Frame_1282_1.png')
->timestamp(now())
->content("Ei <@{$this->value('user')}>
Explique a ideia
Mostre o que você tentou
Mostre o que deu errado
E nos facilite a resolver o seu problema!")
->reply($interaction);
}
}