/[sudobot]/trunk/commands/warn.js
ViewVC logotype

Diff of /trunk/commands/warn.js

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 10 by rakin, Mon Jul 29 17:28:12 2024 UTC revision 25 by rakin, Mon Jul 29 17:28:16 2024 UTC
# Line 1  Line 1 
1    const History = require("../src/History");
2  const MessageEmbed = require("../src/MessageEmbed");  const MessageEmbed = require("../src/MessageEmbed");
3    
4  module.exports = {  module.exports = {
# Line 81  module.exports = { Line 82  module.exports = {
82                      console.log(err);                      console.log(err);
83                  }                  }
84    
85                  await user.send({                  console.log('fr');
                     embeds: [  
                         new MessageEmbed()  
                         .setAuthor({  
                             iconURL: msg.guild.iconURL(),  
                             name: `\tYou have been warned in ${msg.guild.name}`  
                         })  
                         .addFields([  
                             {  
                                 name: "Reason",  
                                 value: typeof reason === 'undefined' ? '*No reason provided*' : reason  
                             },  
                             {  
                                 name: "Strike",  
                                 value: data.count + ' time(s)'  
                             }  
                         ])  
                     ]  
                 });  
86    
87                  callback(data);                  await app.logger.logWarn(msg, user, warned_by1 === undefined ? msg.author : warned_by1, typeof reason === 'undefined' ? '*No reason provided*' : reason);
88                    
89                    await History.create(user.id, msg.guild, 'warn', warned_by1 === undefined ? msg.author.id : warned_by1.id, async (data2) => {
90                        await user.send({
91                            embeds: [
92                                new MessageEmbed()
93                                .setAuthor({
94                                    iconURL: msg.guild.iconURL(),
95                                    name: `\tYou have been warned in ${msg.guild.name}`
96                                })
97                                .addFields([
98                                    {
99                                        name: "Reason",
100                                        value: typeof reason === 'undefined' ? '*No reason provided*' : reason
101                                    },
102                                    {
103                                        name: "Strike",
104                                        value: data.count + ' time(s)'
105                                    }
106                                ])
107                            ]
108                        });
109        
110                        callback(data);
111                    });
112              });              });
113          });          });
114      }      }

Legend:
Removed from v.10  
changed lines
  Added in v.25

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26