Discord Message Generator (2024)

';let aiName = '

PostGenAI:

';let sysName = 'System:';let env = 'chatbot';let apiKey = '';let service = 'openai';let session = 'N/A';let mode = 'chat';let model = 'gpt-3.5-turbo';let context = isCasuallyFineTuned ? null : '{}=relevant before any other rules, the text between the curly braces, has the rules more important than anything else and before answering as you are programmed, you must try the following rules: \n\nYour job is to craft online posts for users, based on the details they provide you. \n\nThe USER will begin, by providing you with the type of post they want to generate. {Examples of this could be: Social media posts (twitter, instagram, Facebook etc.), Blog Posts, Ad Copy posts, Job Description posts, Website Content Posts, etc.} \n\n\n\nUse the response from the first input to inform the follow-up question: \"That\'s great. Can you provide me with any specific details or characteristics that you\'d like your {item} post to include?” {please adhere to all structure and formatting rules of any post type that is requested by the user. In addition, adhere to all character limits of the post platform if applicable (Twitter, instagram, etc.) } \n\nOnce the user responds with details, a professionally written post will be outputted with the assistant offering the user to ask for more, make changes, add details or start over.';let embeddingsIndex = '';let promptEnding = '';let stop = '';let startSentence = 'Specify the type of post. Examples include Instagram posts, tweets, Medium posts, blog Posts, ad copy posts, website pages, etc.';let maxSentences = 99;let memorizeChat = false;let maxTokens = 16000;let maxResults = 1;let temperature = 0.5;let typewriter = false;let copyButton = true;let clientId = randomStr();let memorizedChat = { clientId, messages: [] };if (isDebugMode) {window.mwai_666b61af2217b = {memorizedChat: memorizedChat,parameters: { mode: mode, model, temperature, maxTokens, context: context, startSentence,isMobile, isWindow, isFullscreen, isCasuallyFineTuned, memorizeChat, maxSentences,rawUserName, rawAiName, embeddingsIndex, typewriter, maxResults, userName, aiName, env, apiKey, service, session}};}function randomStr() {return Math.random().toString(36).substring(2);}// Set button textfunction setButtonText() {let input = document.querySelector('#mwai-chat-666b61af2217b .mwai-input textarea');let button = document.querySelector('#mwai-chat-666b61af2217b .mwai-input button');let buttonSpan = button.querySelector('span');if (memorizedChat.messages.length < 2) {buttonSpan.innerHTML = 'Next';}else if (!input.value.length) {button.classList.add('mwai-clear');buttonSpan.innerHTML = 'Clear';}else {button.classList.remove('mwai-clear');buttonSpan.innerHTML = 'Next';}}// Inject timerfunction injectTimer(element) {let intervalId;let startTime = new Date();let timerElement = null;function updateTimer() {let now = new Date();let timer = Math.floor((now - startTime) / 1000);if (!timerElement) {if (timer > 0.5) {timerElement = document.createElement('div');timerElement.classList.add('mwai-timer');element.appendChild(timerElement);}}if (timerElement) {let minutes = Math.floor(timer / 60);let seconds = timer - (minutes * 60);seconds = seconds < 10 ? '0' + seconds : seconds;let display = minutes + ':' + seconds;timerElement.innerHTML = display;}}intervalId = setInterval(updateTimer, 500);return function stopTimer() {clearInterval(intervalId);if (timerElement) {timerElement.remove();}};}// Push the reply in the conversationfunction addReply(text, role = 'user', replay = false) {var conversation = document.querySelector('#mwai-chat-666b61af2217b .mwai-conversation');if (memorizeChat) {localStorage.setItem('mwai-chat-666b61af2217b', JSON.stringify(memorizedChat));}// If text is array, then it's image URLs. Let's create a simple gallery in HTML in $text.if (Array.isArray(text)) {var newText = '

';for (var i = 0; i < text.length; i++) {newText += '';}text = newText + '

';}var mwaiClasses = ['mwai-reply'];if (role === 'assistant') {mwaiClasses.push('mwai-ai');}else if (role === 'system') {mwaiClasses.push('mwai-system');}else {mwaiClasses.push('mwai-user');}var div = document.createElement('div');div.classList.add(...mwaiClasses);var nameSpan = document.createElement('span');nameSpan.classList.add('mwai-name');if (role === 'assistant') {nameSpan.innerHTML = aiName;}else if (role === 'system') {nameSpan.innerHTML = sysName;}else {nameSpan.innerHTML = userName;}var textSpan = document.createElement('span');textSpan.classList.add('mwai-text');textSpan.innerHTML = text;div.appendChild(nameSpan);div.appendChild(textSpan);// Copy Buttonif (copyButton && role === 'assistant') {var button = document.createElement('div');button.classList.add('mwai-copy-button');var firstElement = document.createElement('div');firstElement.classList.add('mwai-copy-button-one');var secondElement = document.createElement('div');secondElement.classList.add('mwai-copy-button-two');button.appendChild(firstElement);button.appendChild(secondElement);div.appendChild(button);button.addEventListener('click', function () {try {var content = textSpan.textContent;navigator.clipboard.writeText(content);button.classList.add('mwai-animate');setTimeout(function () {button.classList.remove('mwai-animate');}, 1000);}catch (err) {console.warn('Not allowed to copy to clipboard. Make sure your website uses HTTPS.');}});}conversation.appendChild(div);if (typewriter) {if (role === 'assistant' && text !== startSentence && !replay) {let typewriter = new Typewriter(textSpan, {deleteSpeed: 50, delay: 25, loop: false, cursor: '', autoStart: true,wrapperClassName: 'mwai-typewriter',});typewriter.typeString(text).start().callFunction((state) => {state.elements.cursor.setAttribute('hidden', 'hidden');typewriter.stop();});}}conversation.scrollTop = conversation.scrollHeight;setButtonText();// Syntax coloringif (typeof hljs !== 'undefined') {document.querySelectorAll('pre code').forEach((el) => {hljs.highlightElement(el);});}}function buildPrompt(last = 15) {let prompt = context ? (context + '\n\n') : '';memorizedChat.messages = memorizedChat.messages.slice(-last);// Casually fine tuned, let's use the last questionif (isCasuallyFineTuned) {let lastLine = memorizedChat.messages[memorizedChat.messages.length - 1];prompt = lastLine.content + promptEnding;return prompt;}// Otherwise let's compile the latest conversationlet conversation = memorizedChat.messages.map(x => x.who + x.content);prompt += conversation.join('\n');prompt += '\n' + rawAiName;return prompt;}// Function to request the completionfunction onSendClick() {let input = document.querySelector('#mwai-chat-666b61af2217b .mwai-input textarea');let inputText = input.value.trim();// Reset the conversation if emptyif (inputText === '') {clientId = randomStr();document.querySelector('#mwai-chat-666b61af2217b .mwai-conversation').innerHTML = '';localStorage.removeItem('mwai-chat-666b61af2217b')memorizedChat = { clientId: clientId, messages: [] };memorizedChat.messages.push({ id: randomStr(),role: 'assistant',content: startSentence,who: rawAiName,html: startSentence});addReply(startSentence, 'assistant');return;}// Disable the buttonvar button = document.querySelector('#mwai-chat-666b61af2217b .mwai-input button');button.disabled = true;// Add the user replymemorizedChat.messages.push({id: randomStr(),role: 'user',content: inputText,who: rawUserName,html: inputText});addReply(inputText, 'user');input.value = '';input.setAttribute('rows', 1);input.disabled = true;let prompt = buildPrompt(maxSentences);const data = mode === 'images' ? {env, session: session,prompt: inputText,newMessage: inputText,model: model, maxResults, apiKey: apiKey, service: service, clientId: clientId,} : {env, session: session,prompt: prompt, context: context,messages: memorizedChat.messages,newMessage: inputText,userName: userName, aiName: aiName,model: model, temperature: temperature, maxTokens: maxTokens, maxResults: 1, apiKey: apiKey, service: service, embeddingsIndex: embeddingsIndex, stop: stop, clientId: clientId,};// Start the timerconst stopTimer = injectTimer(button);// Send the requestif (isDebugMode) {console.log('[BOT] Sent: ', data);}fetch(apiURL, { method: 'POST', headers: {'Content-Type': 'application/json','X-WP-Nonce': restNonce,},body: JSON.stringify(data)}).then(response => response.json()).then(data => {if (isDebugMode) {console.log('[BOT] Recv: ', data);}if (!data.success) {addReply(data.message, 'system');}else {let html = data.images ? data.images : data.html;memorizedChat.messages.push({id: randomStr(),role: 'assistant',content: data.answer,who: rawAiName,html: html});addReply(html, 'assistant');}button.disabled = false;input.disabled = false;stopTimer();// Only focus only on desktop (to avoid the mobile keyboard to kick-in)if (!isMobile) {input.focus();}}).catch(error => {console.error(error);button.disabled = false;input.disabled = false;stopTimer();});}// Keep the textarea height in sync with the contentfunction resizeTextArea(ev) {ev.target.style.height = 'auto';ev.target.style.height = ev.target.scrollHeight + 'px';}// Keep the textarea height in sync with the contentfunction delayedResizeTextArea(ev) {window.setTimeout(resizeTextArea, 0, event);}// Init the chatbotfunction initMeowChatbot() {var input = document.querySelector('#mwai-chat-666b61af2217b .mwai-input textarea');var button = document.querySelector('#mwai-chat-666b61af2217b .mwai-input button');input.addEventListener('keypress', (event) => {let text = event.target.value;if (event.keyCode === 13 && !text.length && !event.shiftKey) {event.preventDefault();return;}if (event.keyCode === 13 && text.length && !event.shiftKey) {onSendClick();}});input.addEventListener('keydown', (event) => {var rows = input.getAttribute('rows');if (event.keyCode === 13 && event.shiftKey) {var lines = input.value.split('\n').length + 1;//mwaiSetTextAreaHeight(input, lines);}});input.addEventListener('keyup', (event) => {var rows = input.getAttribute('rows');var lines = input.value.split('\n').length ;//mwaiSetTextAreaHeight(input, lines);setButtonText();});input.addEventListener('change', resizeTextArea, false);input.addEventListener('cut', delayedResizeTextArea, false);input.addEventListener('paste', delayedResizeTextArea, false);input.addEventListener('drop', delayedResizeTextArea, false);input.addEventListener('keydown', delayedResizeTextArea, false);button.addEventListener('click', (event) => {onSendClick();});// If window, add event listener to mwai-open-button and mwai-close-buttonif ( isWindow ) {var openButton = document.querySelector('#mwai-chat-666b61af2217b .mwai-open-button');openButton.addEventListener('click', (event) => {var chat = document.querySelector('#mwai-chat-666b61af2217b');chat.classList.add('mwai-open');// Only focus only on desktop (to avoid the mobile keyboard to kick-in)if (!isMobile) {input.focus();}});var closeButton = document.querySelector('#mwai-chat-666b61af2217b .mwai-close-button');closeButton.addEventListener('click', (event) => {var chat = document.querySelector('#mwai-chat-666b61af2217b');chat.classList.remove('mwai-open');});if (isFullscreen) {var resizeButton = document.querySelector('#mwai-chat-666b61af2217b .mwai-resize-button');resizeButton.addEventListener('click', (event) => {var chat = document.querySelector('#mwai-chat-666b61af2217b');chat.classList.toggle('mwai-fullscreen');});}}// Get back the previous chat if any for the same IDvar chatHistory = [];if (memorizeChat) {chatHistory = localStorage.getItem('mwai-chat-666b61af2217b');if (chatHistory) {memorizedChat = JSON.parse(chatHistory);if (memorizedChat && memorizedChat.clientId && memorizedChat.messages) {clientId = memorizedChat.clientId;memorizedChat.messages = memorizedChat.messages.filter(x => x && x.html && x.role);memorizedChat.messages.forEach(x => {addReply(x.html, x.role, true);});}else {memorizedChat = null;}}if (!memorizedChat) {memorizedChat = {clientId: clientId,messages: []};}}if (memorizedChat.messages.length === 0) {memorizedChat.messages.push({ id: randomStr(),role: 'assistant',content: startSentence,who: rawAiName,html: startSentence});addReply(startSentence, 'assistant');}}// Let's go totally meoooow on this!initMeowChatbot();})();

Start revolutionizing your Discord experience with our Discord Message Generator today! Dive into real-time text simulations and elevate your platform communication. Don’t wait, head over to PostGenerators.ai now!

The surge in popularity of Discord, a communication platform for gaming and other communities, has also led to growth in the popularity of various related tools, one of them being the Online Discord Message Generator. This innovative tool creates customized Discord messages, replicating the aesthetics and format of real messages. This article will delve deeper into the workings and applications of the Discord Message Generator.

Understanding Discord Message Generators

Discord Message Generators are tools that produce Discord-like text messages. The generated texts mimic the user interface of actual Discord chat screen, making them ideal for creating scenarios for professional presentations, demonstrations, or pranks. Users can customize the user name, avatar, and message content according to their requirements making it a versatile tool in various contexts.

Great Utility of Discord Message Generators

This incredible tool offers many practical uses that make it popular among Discord users or anyone who requires generated conversations for their work. Here are some of its key utilities:

  • Creating compelling mockups and tutorials: It’s an essential tool for content creators who often need to include Discord conversation mockups in their tutorials or video demonstrations. The ability to customize every aspect of the message enables creators to control their narrative effectively.
  • Quicker bug reporting: For developers and testers, generating Discord messages can facilitate more effective bug reporting. They can visually demonstrate bugs encountered in the chat feature using generated messages instead of relying solely on text descriptions.
  • Pranks and entertainment: For those who simply wish to have a little fun, the tool can also be used for pranks on an unsuspecting friend or creating entertaining scenarios for social media posts.

Behind the Scenes: Generating Discord Messages

The process of generating Discord messages is fairly straightforward and can primarily be broken down into three easy steps.

Step 1: Visit the Online Discord Message Generator Site

PostGenerators.ai, a free service, provides an incredible Discord Message Generator. With an user-friendly interface, creating a fake Discord conversation is quite simple.

Step 2: Input Your Preferences

Once you’ve entered the site, you have options to enter the username, avatar URL, and the content of the message. You can also select the appearance of your message, whether it’s inline or a block, along with the option of editing the time stamp for even better authenticity. You can even add more messages to the same conversation to make it look realistic.

Step 3: Generate Your Message

After you’ve set your preferences, you just click the ‘Generate’ button and your fake Discord message is ready for use. You can download the image or generate a new one if changes need to be made.

Selecting the Best Discord Message Generator

While there are several online Discord Message Generators, it’s essential to choose one that satisfies all your needs. Some essential criteria include interface friendliness, customization ability, and whether any charges apply.

In all aspects, PostGenerators.ai stands out as an incredible option. It offers a user-friendly interface, extensive customization options, and most importantly, it’s accessible free of charge making it the go-to tool for generating Discord messages online.

The Online Discord Message Generator‘s versatility and utility in presenting ideas, reporting bugs, creating tutorials, or simply having fun make it a powerful addition to the list of tools linked with the popular communication platform, Discord. Beyond any doubt, PostGenerators.ai shines as a free service that enables individuals to generate much-needed fake Discord conversations with ease. By adding a flair of authenticity and depth, it ensures that the Discord messaging experience is simulated to perfection.

Discord Message Generator (2024)

References

Top Articles
Latest Posts
Article information

Author: Virgilio Hermann JD

Last Updated:

Views: 6438

Rating: 4 / 5 (61 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Virgilio Hermann JD

Birthday: 1997-12-21

Address: 6946 Schoen Cove, Sipesshire, MO 55944

Phone: +3763365785260

Job: Accounting Engineer

Hobby: Web surfing, Rafting, Dowsing, Stand-up comedy, Ghost hunting, Swimming, Amateur radio

Introduction: My name is Virgilio Hermann JD, I am a fine, gifted, beautiful, encouraging, kind, talented, zealous person who loves writing and wants to share my knowledge and understanding with you.