Do you want to be able to write only numbers in a certain channel, but letters will be deleted?
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
//Channel:
let Channel = `${process.env.channel}`
//Warning message. (Change this)
let warnmessage = `V ta kanal lahko pišete le številke!`;
if(context.params.event.channel_id == Channel) {
if (context.params.event.content.match(/a|b|c|č|d|e|f|g|h|i|j|k|l|m|n|o|p|r|s|š|t|u|v|z|ž|x|y|q|đ|ć/i)) {
await lib.discord.channels['@0.3.1'].messages.destroy({
message_id: `${context.params.event.id}`,
channel_id: `${context.params.event.channel_id}`
});
await lib.discord.channels['@0.3.0'].messages.create({
"channel_id": `${context.params.event.channel_id}`,
"content": "",
"tts": false,
"embeds": [
{
"type": "rich",
"title": `${context.params.event.author.username}`,
"description": `${warnmessage}`,
"color": 0xffd500
}
]
});
}
}